in reply to Special formatting in pod

At one point, I wanted to put a line break between two lines in a pod.
The reason there's no easy way to do that is because you have to provide the answer to the meaning of such a visual break. Paragraph breaks are provided, and they have a meaning (change of topic). What does a "line break" mean, as an abstraction, in your mind? When would it come up that I (or other pod authors) would want that meaning?

Replies are listed 'Best First'.
Re^2: Special formatting in pod
by shmem (Chancellor) on Mar 25, 2007 at 21:52 UTC
    The meaning is obvious, as layout goes: more space than a period, less than a paragraph break. Not a topic change, but a severe pause, e.g to put things the other way round, or to say "stop here and think about that". Make long paragraphs more readable, provide a hook for the eye to go back - increase redability, the like a blank line inside a block of code provides.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      The reason why I last wanted to do that, is to make a nicely formatted block of contact info.

      The only way you can do it appears to be to either put every line in a separate paragraph, or make a preformatted code block ("verbatim paragraph") out of it. Sucks.

      Ideally the text should formatted as normal text, but respecting my line breaks.

      Or maybe I should be making a bulletless list? Is that possible?

Re^2: Special formatting in pod
by ambrus (Abbot) on Mar 26, 2007 at 07:12 UTC

    It came up in the synopsis section when I want to show multiple commands that the user is supposed to run sequentially. The section would look like this:

    =head1 SYNOPSYS B<heapusg> [B<-n> I<interval>] I<your_program> I<args> B<drawheapg>

    The next sections would then explain that the first command generates a data file (with a default name you can override) and the second command draws a graph of it.

    Anyway, you have a point with this. The same method I show, however, can be used for other special formatting too (like nice links in html), not only line breaks.

      Howdy!

      Simply indent the lines. That indicates that these are verbatim, thus preserving line breaks. I think that even a single space is sufficient.

      yours,
      Michael
        That doesen't really help if you want those lines to be folded by the formatter as normal lines, while preserving the line break at the line end, without having the remaining line space filled up with the next line.

        Verbatim lines are output as they are irrespective of their length, so it's the pager that folds them (in the case of manual pages) or they don't get folded at all and thus produce a horizontal scrollbar in the browser (in the case of html).

        --shmem

        _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                      /\_¯/(q    /
        ----------------------------  \__(m.====·.(_("always off the crowd"))."·
        ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re^2: Special formatting in pod
by Anno (Deacon) on Mar 27, 2007 at 10:24 UTC
    Another problem with a single line break is that its visibility depends on the last line not being nearly full. A forced line break near the right margin doesn't stand out visually. The markup may disappear, depending on formatting you don't control.

    Anno

Re^2: Special formatting in pod
by blazar (Canon) on Mar 27, 2007 at 09:48 UTC
    The reason there's no easy way to do that is because you have to provide the answer to the meaning of such a visual break. Paragraph breaks are provided, and they have a meaning (change of topic). What does a "line break" mean, as an abstraction, in your mind? When would it come up that I (or other pod authors) would want that meaning?

    Well, even TeX provides \\ for simple line breaks: it's a feature one should use parsimoniously (I mean in simple text, special uses are a whole another matter,) but occasionally it can be useful to stress a period ending that must be stronger than a "regular" one and not just as strong as a paragraph break.