Asciidoctor-pdf: Warnings using asciidoctor-diagram with asciidoctor-pdf

Created on 13 Jul 2016  路  5Comments  路  Source: asciidoctor/asciidoctor-pdf

Using the asciidoctor-diagram module with asciidoctor-pdf even though it looks like it produces valid output and works OK when generating the PDF warnings and errors like the following appear:

asciidoctor: WARNING: document.adoc: line 19: invalid style for literal block: ditaa
asciidoctor: WARNING: document.adoc: line 39: invalid style for listing block: plantuml

   **** Error: File did not complete the page properly and may be damaged.
               Output may be incorrect.

   **** This file had errors that were repaired or ignored.
   **** The file was produced by:
   **** >>>> Asciidoctor PDF 1.5.0.alpha.11, based on Prawn 2.1.0 <<<<
   **** Please notify the author of the software that produced this
   **** file that it does not conform to Adobe's published PDF
   **** specification.

   **** The rendered output from this file may be incorrect.

I haven't found any reference about asciidoctor-diagram in asciidoctor-pdf is it supposed to be supported?

The markup that produced the warnings is the following

[ditaa]
....
                   +-------------+
                   | Asciidoctor |-------+
                   |   diagram   |       |
                   +-------------+       | PNG out
                       ^                 |
                       | ditaa in        |
                       |                 v
 +--------+   +--------+----+    /---------------\
 |        | --+ Asciidoctor +--> |               |
 |  Text  |   +-------------+    |   Beautiful   |
 |Document|   |   !magic!   |    |    Output     |
 |     {d}|   |             |    |               |
 +---+----+   +-------------+    \---------------/
     :                                   ^
     |          Lots of work             |
     +-----------------------------------+
....

[plantuml, sample-plantuml-diagram, alt="Class diagram", width=135, height=118]
----
class BlockProcessor
class PlantUmlBlock
BlockProcessor <|-- PlantUmlBlock
----

Most helpful comment

You need to enable Asciidoctor Diagram when you run asciidoctor-pdf. These are independent modules.

asciidoctor-pdf -r asciidoctor-diagram document.adoc

Of course, you need to have asciidoctor-diagram installed:

gem install asciidoctor-diagram

I'm not sure why you are getting a corrupt PDF. That doesn't seem related to this issue.

All 5 comments

You need to enable Asciidoctor Diagram when you run asciidoctor-pdf. These are independent modules.

asciidoctor-pdf -r asciidoctor-diagram document.adoc

Of course, you need to have asciidoctor-diagram installed:

gem install asciidoctor-diagram

I'm not sure why you are getting a corrupt PDF. That doesn't seem related to this issue.

Thanks, I do have it installed and I pass the -r option, actually it works and produces a valid diagram, my question is mainly aimed at the warnings to make sure everything was working well.

With the same adoc using plain asciidoctor (and -r asciidoctor-diagram) no warning appears.

If you get these warnings:

asciidoctor: WARNING: document.adoc: line 19: invalid style for literal block: ditaa
asciidoctor: WARNING: document.adoc: line 39: invalid style for listing block: plantuml

then Asciidoctor Diagram is not being used. You can check by running:

$ gem which asciidoctor-diagram

That should show you a path to the Ruby file.

The PDF errors are likely being caused by something else in the document. I'd need to see the whole document so I can reproduce.

Sorry the problem was in a ruby script I use to generate the figure table before actually generating the document which lacked the corresponding require directive for asciidoctor-diagram.

Sorry and thanks

Excellent!

Was this page helpful?
0 / 5 - 0 ratings