views:

28

answers:

1

I'm in the middle of reading More Programming Pearls and read the chapter on the Pic language (see also Kernighan's paper) with some interest.

Anyone out there using it? It seems like it might be fairly easily translatable into SVG. There's a GNU version (w/ docs by Eric Raymond!) but it only outputs groff and TeX.

A: 

aha, looks like esr also wrote a program called doclifter:

doclifter translates documents written in troff macros to DocBook. Structural subsets of the requests in man(7), mdoc(7), ms(7), me(7), mm(7), and troff(1) are supported.

The translation brings over all the structure of the original document at section, subsection, and paragraph level. Command and C function synopses are translated into DocBook markup, not just a verbatim display. Tables (TBL markup) are translated into DocBook table markup. PIC diagrams are translated into SVG. Troff-level information that might have structural implications is preserved in XML comments.

edit: even better, GNU pic2plot:

The pic2plot program takes one or more files in the pic language, and either displays the figures that they contain on an X Window System display, or produces an output file containing the figures. Many graphics file formats are supported.

The pic language is a 'little language' that was developed at Bell Laboratories for creating box-and-arrow diagrams of the kind frequently found in technical papers and textbooks. A directory containing documentation on the pic language is distributed along with the plotting utilities. On most systems it is installed as /usr/share/pic2plot or /usr/local/share/pic2plot. The directory includes Brian Kernighan's original technical report on the language, Eric Raymond's tutorial on the GNU implementation, and some sample pic macros contributed by W. Richard Stevens.

Jason S