Pod::Parser::Groffmom to the CPAN

Ovid on 2009-10-28T22:20:09

Shortly you'll be able to get Pod::Parser::Groffmom from the CPAN. As always, the latest version is available from github.

I wanted to upload a new version of my Logic Programming in Perl article, but replacing presentations is currently disabled in Slideshare :( I've added syntax highlighting to it and I changed "Salvador FandiE<241>o" to "Salvador Fandiño", as one would expect. In other words, I now handle "E<$number>" escapes better.

I also changed "=for highlight $language" to "=begin highlight $language" after Matts pointed out that I was using the wrong POD command.

Now, I need to figure out the best way to support hyperlinks (mom might not do that) and how to embed literal mom sequences in the POD, in case someone wants fine-grained control. Of course, adding "table of contents" and "index" generation would also be nice. Oh, and copyright info on every header or footer. And numeric and roman lists. And ...

Update: The github version now allows you to create a table of contents. You merely need to include =head1 TOC anywhere in the document. Regrettably, due to limitations with MOM, the table of contents is the last page of the document. This is fine for printing (when you merely have to swap the TOC to the front (perhaps after the cover (=head1 COVER) page), but it's lousy for online. Perhaps some post processing of the PostScript file is in order.


Two-pass parsing for TOC at beginning

jnareb on 2009-10-29T09:11:37

You can try to use technique that LaTeX uses: it writes information about sections and references to *.aux (auxilliary) file, so that table of contents might be at first page and you can refer to objects (equations, tables, figures, sections, etc.) which are later in the document.





P.S. Do I understand correctly that mom is to groff like LaTeX is to TeX?

Re:Two-pass parsing for TOC at beginning

Ovid on 2009-10-29T12:48:28

The mom docs specifically state that .TOC must be the last macro in the document. It says nothing about multi-pass parsing. And yeah, mom is a set of macros for groff. Very handy.