Can asciidoctor-diagram be used with asciidoctor-pdf.js?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Can asciidoctor-diagram be used with asciidoctor-pdf.js?

mbaker00

I have used the current version of asciidoctor (2.0.10) with asciidoctor-diagram extension and the non-js asciidoctor-pdf extension to create pdf from .adoc files successfully. I have also installed the javascript version of asciidoctor-pdf. I am running in terminal on macOS.

I can run either asciidoctor-pdf or asciidoctor-pdf.js if I specify the path first. But, if I include the -r asciidoctor-diagram extension command when using the javascript version of asciidoctor-pdf I get an error. Example asciidoctor-pdf -r asciidoctor-diagram Bones.adoc yields 'error Error: Cannot find module asciidoctor-diagram.

I like the output of asciidoctor-pdf.js so much better because my documents have lots of floats via the [.right], [.left], and [.float-group]. I would like the maintain the ability to use diagrams.

I have tried including paths in the commands for the extension but either I am not including the path correctly or it's not possible in the alpha to use the diagram extension. asciidoctor-pdf.js package was installed with the global flag if that matters.

Any hints from anyone using the combo of asciidoctor-pdf.js with asciidoctor-diagram successfully?

Thanks, Michael

Reply | Threaded
Open this post in threaded view
|

Re: Can asciidoctor-diagram be used with asciidoctor-pdf.js?

David Jencks
Hi Michael,

Asciidoctor-diagram is ruby-only so it won’t work with asciidoctor.js (or asciidoctor-pdf.js).  It’s possibly that asciidoctor-diagram could be transpiled to javascript as asciidoctor is, but since no one has done it I suspect it’s impractical.  At any rate I don’t know anything about how to do it.

There are a couple of possible javascript replacement extensions:

eshepelyuk/asciidoctor-plantuml.js  I’ve contributed to this, and know the latest code works well.  Unfortunately the latest npm bundle doesn’t reflect the current code, it’s some very old version, and the maintainer seems disinclined to update it.  You can “build it yourself” however.  There are better instructions on my latest MR than in the actual project.  Personally, I like the output to be inline svg. This seems to work pretty well with asciidoctor-pdf.js.

https://github.com/Mogztter/asciidoctor-kroki I haven’t used this, but it is very similar to the above, but using the kroki server.  I think the npm release is current.

Hope this helps.  You may get more timely feedback on https://gitter.im/asciidoctor/asciidoctor, although I certainly prefer email.

David Jencks


On Feb 5, 2020, at 12:02 PM, mbaker00 [via Asciidoctor :: Discussion] <[hidden email]> wrote:

I have used the current version of asciidoctor (2.0.10) with asciidoctor-diagram extension and the non-js asciidoctor-pdf extension to create pdf from .adoc files successfully. I have also installed the javascript version of asciidoctor-pdf. I am running in terminal on macOS.

I can run either asciidoctor-pdf or asciidoctor-pdf.js if I specify the path first. But, if I include the -r asciidoctor-diagram extension command when using the javascript version of asciidoctor-pdf I get an error. Example asciidoctor-pdf -r asciidoctor-diagram Bones.adoc yields 'error Error: Cannot find module asciidoctor-diagram.

I like the output of asciidoctor-pdf.js so much better because my documents have lots of floats via the [.right], [.left], and [.float-group]. I would like the maintain the ability to use diagrams.

I have tried including paths in the commands for the extension but either I am not including the path correctly or it's not possible in the alpha to use the diagram extension. asciidoctor-pdf.js package was installed with the global flag if that matters.

Any hints from anyone using the combo of asciidoctor-pdf.js with asciidoctor-diagram successfully?

Thanks, Michael


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Can-asciidoctor-diagram-be-used-with-asciidoctor-pdf-js-tp7571.html
To start a new topic under Asciidoctor :: Discussion, [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Can asciidoctor-diagram be used with asciidoctor-pdf.js?

mbaker00
David,
Thank you for the help. I was able to install asciidoctor-kroki to use as an extension with asciidoctor-pdf.js.
This worked with the diagrams within my asciidoctor file.

Michael
Reply | Threaded
Open this post in threaded view
|

Re: Can asciidoctor-diagram be used with asciidoctor-pdf.js?

mojavelinux
Administrator
That's great to hear, Michael! kroki is awesome.

-Dan

On Mon, Mar 2, 2020 at 7:20 PM mbaker00 [via Asciidoctor :: Discussion] <[hidden email]> wrote:
David,
Thank you for the help. I was able to install asciidoctor-kroki to use and an extension with asciidoctor-pdf.js.
This worked with the diagrams within my asciidoctor file.

Michael


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Can-asciidoctor-diagram-be-used-with-asciidoctor-pdf-js-tp7571p7719.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux