asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
434 stars 106 forks source link

support for graphviz neato (and other layouts)? #100

Closed gliptak closed 8 years ago

gliptak commented 8 years ago

I tried to include and format using neato:

http://www.graphviz.org/Gallery/undirected/philo.gv.txt

but I couldn't find a way to trigger processing using neato;

The command line format would be dot -Kneato but the override -a graphviz="dot -Kneato" didn't seem to work.

Is there a per diagram override I might have missed?

Thanks

pepijnve commented 8 years ago

Hi @gliptak,

Unless there's a way to specify this in the dot file content itself you won't be able to do this at the moment.

The document attribute that you can use to specify the location of the binary is always the name of the binary itself (so dot in this case), but the code does some validation on that and the -Kneato suffix is going to cause problems.

Support for the alternative layouts should be easy enough to add though. I propose to do this via a block level attribute. Something like

[dot,layout=neato]
----
....
----
mojavelinux commented 8 years ago

Support for the alternative layouts should be easy enough to add though. I propose to do this via a block level attribute.

I like it!

I'm also trying to think whether a role or an option would fit here.

If neither of those feels right, we'll stick with the layout attribute idea.

pepijnve commented 8 years ago

I wasn't aware of the role and option asciidoc syntax (and asciidoctor shorthands). You learn something new every day.

I think initially I'm going to stick to the layout attribute. This keeps the style of setting additional flags and options similar to the one that's used in the ditaa extension.

mojavelinux commented 8 years ago

:+1:

Regarding the shorthand, it definitely saves a bunch of typing. Here are the relevant sections in the user manual for future reference:

(Granted, those sections still need a bit of work).

gliptak commented 8 years ago

Looking forward to try this out :)