Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
11 posts
|
I would really like to generate a block like this:
[graphviz, Mini, svg] .... digraph Mini { // rankdir=LR; node [shape=Mrecord,style=filled,fillcolor="#00CC00",rank=same]; doIt [label="doIt\n(DoIt)|{ <in> in| }"] ; node [shape=plaintext,style=plain,rank=same]; "in" -> doIt:in ; } .... from my own plugin. Unfortunately the createBlock method isn't documented very good: return createBlock(parent, "paragraph", content, attributes, new HashMap<>()); Is using return createBlock(parent, "graphviz", content, attributes, new HashMap<>());all I have to do? Thanks in advance, Ole |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
On Thu, Nov 6, 2014 at 5:44 AM, Ole [via Asciidoctor :: Discussion] <[hidden email]> wrote:
This step only puts a block node named graphviz into the tree, so the name only affects which convert handler is selected. If you want to trigger the Asciidoctor Diagram extension, you have to push the raw AsciiDoc lines onto the reader so that the parser reads them as though they were in the original document. Here's an example in Ruby: https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/textql-block.rb#L26 An alternative solution is to delegate to the process method of the Asciidoctor Diagram API. To do that from Java, you'll need an interface to the Ruby code so that you can call its API, similar to how AsciidoctorJ works in general. It might be nice if we could provide this API wrapper out of the box in AsciidoctorJ Diagram. (Here's a rough example of how that looks: https://github.com/opendevise/jruby-embed-demo/blob/master/src/main/java/demo/AsciidoctorJLite.java) (Another solution is to run a Ruby scriplet to invoke the Asciidoctor Diagram API). I hope that helps a little ;) |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
11 posts
|
Sadly, its not so easy...
I can't really read this Ruby example but I think I would need to access a reader via the given parent. Unfortunately, the parent is an abstract class 'AbstractBlock' in AsciiDoctorJ that doesn't expose any reader. Otherwise this looks like an easy way to go. :-)
I can read that example but it looks like an exploring expedition on the border between Java and Ruby will be necessary to get this running. It will be the slightly more performant solution, though. The first solution seems to be *much* easier to do, if the reader just has to be made accessible via the API. Thanks for your help so far Ole |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
2681 posts
|
Ole, I know this is a tough one, but it's an important use case, so we definitely want to find a way to make it happen. I think you're right that we should focus on getting solution #1 working. It should definitely be possible if we figure out what modifications, if any, we need to the AsciidoctorJ API. What would really help us here is if we added a test to AsciidoctorJ for this scenario. Then, we not only get it working, but we can verify it stays working. And that starts with filing an issue. Could you start one in asciidoctor/asciidoctorj? It would also be a good opportunity to move the asciidoctorj-extensions-lab to the Asciidoctor organization and add this example (or something similar) to it. Cheers, -Dan On Nov 10, 2014 8:44 AM, "Ole [via Asciidoctor :: Discussion]" <[hidden email]> wrote:
... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
11 posts
|
What would really help us here is if we added a test to AsciidoctorJ for this scenario. Then, we not only get it working, but we can verify it stays working. And that starts with filing an issue. Could you start one in asciidoctor/asciidoctorj? OK. I opened this issue now: https://github.com/asciidoctor/asciidoctorj/issues/215 Best regards, Ole |
Free forum by Nabble | Edit this page |