I've been using graphviz inside Scribble for a bit.
I found the package a bit inflexible and didn't produce output to my liking, so
I just rolled my own 'dot->svg' for HTML output:
> (require (only-in xml cdata)
> scribble/html-properties)
> (define (dot->svg . rest)
> (elem #:style
> (style #f
> (list
> (xexpr-property
> (cdata #f #f (apply string-append (drop (port->lines (run-dot (apply string-append rest) "svg")) 3)))
> (cdata #f #f ""))))))
Example:
> @dot->svg{
> digraph {
>
> node [ shape="box" ]
>
> /* The Languages */
>
> L0 [label="x64"];
> L1 [label="elf64"];
>
> /* The Passes */
>
> edge [fontname="Courier"]
>
> L0 -> L1 [label="nasm"];
> }
> }
--
William J. Bowman
On Wed, Jan 27, 2021 at 09:37:51PM -0800, Sorawee Porncharoenwase wrote:
> Here’s how to add graphviz to Pollen
> <
https://github.com/mbutterick/pollen-users/issues/46>. The same technique
> can be used for Scribble, but you would want to use image
> <
https://docs.racket-lang.org/scribble/base.html?q=image#%28def._%28%28lib._scribble%2Fbase..rkt%29._image%29%29>
> as the tag function. You might also need to use define-runtime-path
> <
https://docs.racket-lang.org/reference/Filesystem.html?q=define-runtime-path#%28form._%28%28lib._racket%2Fruntime-path..rkt%29._define-runtime-path%29%29>
> .
>
> On Wed, Jan 27, 2021 at 9:23 PM Tim Meehan <
btme...@gmail.com> wrote:
>
> > IMHO, Racket's documentation is the gold standard. I tell everyone I work
> > with that we should document things this well.
> > Until now, I haven't seen any room for potential improvements.
> >
> > Now, I like ASCII art as much as the next person, but when I was reading
> > the documentation for the GUI class hierarchy, I remembered that there was
> > a graphviz <
https://github.com/pykello/racket-graphviz> package for
> > <
https://groups.google.com/d/msgid/racket-users/CACgrOxKkeVxdMq9-94%2BX87oCmBKaY0XHg-Sq4yj-fPLy%2B6MYyg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> > .
> >
>
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
racket-users...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/CADcuegstUJsYGjcm5C7_Hniw_%3DTvb69FyQa820JN4vP0kChD%2BA%40mail.gmail.com.