groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Graph in a man page


From: Ken Smith
Subject: Re: [Groff] Graph in a man page
Date: Fri, 20 Aug 2010 09:58:07 -0700

On Fri, Aug 20, 2010 at 7:13 AM, Andre Majorel <address@hidden> wrote:
> OK, so pic is out (and so is tbl unless I kludge the arrows in).
> For the moment, I'm following the path of least resistance :

Have you considered graphviz?  Here is graph.dot for your example.

digraph g {
    rankdir=LR
    X -> Y [label=A]
    Y -> X [label=B]
    Y -> Z [label=C]
    Z -> Y [label=D]
}
EOF

And a makefile that renders an eps using dot (from graphviz) and ASCII
art (using graph-easy).

graph := graph.dot
outputs := eps txt

.PHONY: all
all \
  : $(addprefix $(graph:dot=),$(outputs))

$(graph:dot=eps) \
  : $(graph) \
  ; dot -T ps < $< > $@

$(graph:dot=txt) \
  : $(graph) \
  ; graph-easy --as=ascii $< > $@
EOF

The generated EPS is attached (sorry if that is not customarily done.
It is small so I figured, what the heck.)  Here is the ASCII
rendering.

      B
  +----------+
  v          |
+---+  A   +---+  C   +---+
| X | ---> | Y | ---> | Z |
+---+      +---+      +---+
             ^   D      |
             +----------+

   Regards,
   Ken

Attachment: graph.eps
Description: PostScript document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]