On Tuesday 31 July 2001 01:09 pm, Adam Turoff wrote:
> On Tue, Jul 31, 2001 at 10:51:42AM -0400, Kirrily Robert wrote:
> > Schwern wrote:
> > >Adam Turoff gave a talk about stealing ideas from LaTeX, XML and SGML
> > >and incorporating them into POD.  I missed it.  Anyone go?
>
> Um, I did.  :-)

As did I.

> The biggest benefit was adopting an idea from LaTeX: that a tagged
> section defines an _environment_ where content is parsed differently.
> This can be seen with =list and =table (yes, this dialect included tables)
> that did away with the annoying =over/=item/=back bogosity and replaced
> it with
>       =list
>       * item 1
>           paragraph 1
>
>         paragraph 2
>       * item 2
>         note how where spacing *isn't* needed, allowing the author
>         to use space as desired for clarity
>       =end list
>

It all depends on the targetted use and environment.  While working on 
templating code to convert straight text to HTML (specifically), I found 
that you didn't (necessarily) need to differentiate lists (or preformatted 
sections) at all, assuming, of course, that was what the target was.  But it 
relied on the paragraph context, and parsing by individual line would have 
made it more difficult.

Given straight text written under these rules:

This is a regular paragraph.
It can extend however many lines on paper.
It'll all be one <p></p> when done,

- This is an unordered list. It's a paragraph that starts with a
hyphen, and has (for my settings) at least one other line
within the paragraph that starts with a hyphen.
- One line or five lines, whatever makes the most sense for the context.

1. This is an ordered list.  It is a paragraph that begins with a number and 
a period, and has two or more lines within the paragraph that start with the
next respective consecutive number.
2. That, of course, is a pain if you add information later, as you need to
renumber all your lists, but it allows you to start your list with any 
number.
3. If you want autonumbering, then you could start each entry with '#.', or 
something similar.

        This is a preformatted block
        Provided each line within the paragraph is indented with some number
        of space, the whole paragraph (minus the smallest of the initial spaces) 
        is preserved within <pre></pre> blocks.

Since we were also web specific, with HTML as the expected backend, 
auto-taggers based on "URL (URL description)" would handle autoformatting of 
<A> tags, with smarts to handle exit pages, etc.

Obviously, Perl shouldn't be quite that specific, but I think that to some 
extent, POD (or at least the *text* parser portion of POD, since the idea of 
context switching is a good one - can be laxed even further.  The customer 
was happy, because it was very logical in what it did.  If it looked like 
how a person would normal write a list, it was turned into a list.  If it 
looked like how someone would write a URL, it was a converted into a URL.

I didn't have a good solution for tables, mainly because I didn't like a 
tab, comma, or pipe separated solution.  (Which isn't intended as commentary 
on Ziggy.)

Since we were also supposed to filter out "illegal" tags - tags they weren't 
supposed to use - but wanted to get them some markup, I did reuse the 
PODdish inside-out markups for bold, italic, and underlined, which allowed 
me to filter *all* tags out prior to processing.

This isn't a suggestion by any means, just a "here's what I did for this 
problem."

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to