asciidoctor / brackets-asciidoc-preview

Live Preview of AsciiDoc for Adobe Brackets
MIT License
51 stars 16 forks source link

support asciidoctor-diagram version 1.5.2 #35

Closed charlottedeclercq closed 7 years ago

charlottedeclercq commented 7 years ago

Hi,

In asciidoctor-diagram version 1.5.2, it is now possible to substitute asciidoc declared variables in the plantuml block. As shown in below example :

:parent-class: Parent
:child-class: Child

[plantuml,class-inheritence,png,subs="attributes+"]
....
class {parent-class}
class {child-class}
{parent-class} <|-- {child-class}
....

Is it possible for you to handle this in this bracket extension ?

Thank you,

Charlotte

nerk commented 7 years ago

I'll have to look into that. The problem is that the diagram is actually being sent to a plantuml server for processing, which does not know anything about asciidoctor attributes. It would be necessary to substitute these variables within the Brackets extension before sending the preprocessed block to the Plantuml server. Should not be difficult, though.

mojavelinux commented 7 years ago

Asciidoctor Diagram recently made a similar improvement. Although it follows a different path to generate the diagram, the process is still the same. When reading the content of the block, you need to be sure to apply the attributes as requested. See https://github.com/asciidoctor/asciidoctor-diagram/issues/105.

charlottedeclercq commented 7 years ago

Thank you for your answer. On my computer I use brackets to edit asciidoc documents that contain plantuml diagrams, and I publish thoses documents on a server on which a job runs regularly to generate the html document, from asciidoc. This job uses the command : asciidoctor -r asciidoctor-diagram ... So I have the attributes interpreted on the server, but not on my computer in the brackets editor. Last step is to have this in brackets, thanks to you :-).

charlottedeclercq commented 7 years ago

thank you, I tested it : it works perfectly ! :+1:

nerk commented 7 years ago

Great!