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.
I use it. It's really handy for drawing sequence diagrams, in plain text - which you can then version control.
I've messed about with WYSIWYG UML diagram editors in the past, and have come to the conclusion that plain text is a far more reliable option.
Which would you rather? 80 lines of text or a 500kb zip file containing impenetrable XML?
The language is so so tiny, yet expressive - you can learn it in a day or two.
Use it for:
- Component dependency diagrams
- Flow diagrams
- Sequence diagrams
- Server room layouts
- Floor-plans
Basically... Any diagram which doesn't need to be slapped on a website with a beta/web 2.0 sticker. It's not amazingly beautiful, however, it gets the job done.
More resources:
Archive of http://www.umlgraph.org from 2016
http://floppsie.comp.glam.ac.uk/Glamorgan/gaius/web/pic.html
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.
精彩评论