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
432 stars 106 forks source link

seqdiag, packetdiag and others give errors #45

Closed mikeosbornma closed 9 years ago

mikeosbornma commented 9 years ago

I'm trying to convert over to asciidoctor from asciidoc and installed the latest version of both asciidoctor (1.50) and asciidoctor-diagram (1.2.0) on my Ubuntu machine. All my ditaa and plantuml figures get generated correctly, but the only "diag" figure I can get to work is blockdiag, the others, like seqdiag and packetdiag give me:

invalid style for listing block: packetdiag invalid style for listing block: seqdiag

Is there a step or syntax I missed someplace? Any help would be greatly appreciated.

Thanks,

-Mike

mikeosbornma commented 9 years ago

Also, I'm running this on the command line using "-r asciidoctor-diagram", although I have tried explicitly requiring -r asciidoctor-diagram//blockdiag as well.

pepijnve commented 9 years ago

Hi Mike,

This was an error on my part that has been resolved in the meantime. The code for the other diag types is presented but the block processors weren't being registered. I was planning on fixing this in 1.3.0 unless someone complained, but since you now did I'll make a 1.2.1 release this evening to sort this out.

pepijnve commented 9 years ago

BTW, if you need a workaround urgently, it should be possible to register the necessary block processors manually. To do that you 'll have to create an additional ruby file that you require via the -r command line flag. It should contain something like

require 'asciidoctor/extensions'

Asciidoctor::Extensions.register do
  require_relative 'blockdiag/extension'
  block Asciidoctor::Diagram::PacketDiagBlock, :packetdiag
  block_macro Asciidoctor::Diagram::PacketDiagBlockMacro, :packetdiag
  # Seq, Act, Nw and Rack can be added in the same way
end
mikeosbornma commented 9 years ago

Great! I'll update to 1.2.1 as soon as its released. Thanks so much for the help!

-Mike

pepijnve commented 9 years ago

c585eaa018aba33cb1d10aa14a959ee95b9ebbd6 resolves this. 1.2.1 has been pushed to rubygems.org

mikeosbornma commented 9 years ago

Works great! Thanks for the help.