Re: [racket-users] Using GraphViz inside of Scribble?

2021-01-27 Thread 'William J. Bowman' via Racket Users
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
> . The same technique
> can be used for Scribble, but you would want to use image
> 
> as the tag function. You might also need to use define-runtime-path
> 
> .
> 
> On Wed, Jan 27, 2021 at 9:23 PM Tim Meehan  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  package for
> > Racket now.
> > I'm no good with Scribble, but I bet that someone clever could add some
> > automatic graphs to it without much trouble.
> >
> > I'm not much good at GraphViz either, but here is my take on the first two
> > ASCII art diagrams. I just used "dot -Tpdf" to make the tests.
> >
> > --
> > 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+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/racket-users/CACgrOxKkeVxdMq9-94%2BX87oCmBKaY0XHg-Sq4yj-fPLy%2B6MYyg%40mail.gmail.com
> > 
> > .
> >
> 
> -- 
> 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+unsubscr...@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.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/YBJOuMD2v2n29%2BpY%40williamjbowman.com.


Re: [racket-users] Using GraphViz inside of Scribble?

2021-01-27 Thread Sorawee Porncharoenwase
Here’s how to add graphviz to Pollen
. The same technique
can be used for Scribble, but you would want to use image

as the tag function. You might also need to use define-runtime-path

.

On Wed, Jan 27, 2021 at 9:23 PM Tim Meehan  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  package for
> Racket now.
> I'm no good with Scribble, but I bet that someone clever could add some
> automatic graphs to it without much trouble.
>
> I'm not much good at GraphViz either, but here is my take on the first two
> ASCII art diagrams. I just used "dot -Tpdf" to make the tests.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CACgrOxKkeVxdMq9-94%2BX87oCmBKaY0XHg-Sq4yj-fPLy%2B6MYyg%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@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.


[racket-users] Using GraphViz inside of Scribble?

2021-01-27 Thread Tim Meehan
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  package for Racket
now.
I'm no good with Scribble, but I bet that someone clever could add some
automatic graphs to it without much trouble.

I'm not much good at GraphViz either, but here is my take on the first two
ASCII art diagrams. I just used "dot -Tpdf" to make the tests.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CACgrOxKkeVxdMq9-94%2BX87oCmBKaY0XHg-Sq4yj-fPLy%2B6MYyg%40mail.gmail.com.


hierarchy_2.dot
Description: MS-Word document


hierarchy_1.dot
Description: MS-Word document