sytsereitsma / mdbook-plantuml

mdBook preprocessor to render PlantUML diagrams to png images in the book output directory
MIT License
76 stars 14 forks source link

fail to render ditaa #9

Closed donbowman closed 4 years ago

donbowman commented 4 years ago

I have this:

@startditaa
+---------------------------------------------------------------------+
|                    LoadBalancer                                     |
+--------------+----------------------------------+-------------------+
               |                                  |
               v                                  v
+--------------------------+               +--------------------------+ 
| nginx-ingress            |               | nginx-ingress            |
| nginx-ingress-controller |               | nginx-ingress-controller |
+--------------+--------+--+               +--+---+-------------------+ 
               |        |                     |   |
        +------+--------|---------------------+   |
        |  (tcp/24224)  |                         |
        |               |             (tcp/443)   |
        |               +----+----+---------------+
        |                    |    |
        v                    |    |
 +------------+              | +--+---------------+
 | fluent-bit |              | |     oauth2       |
 | forwarder  |              | |     oauth2       |
 +-----+------+              | +------------------+
       |                     |
       |                     |
 +-----+------+            +-+--------------------+
 | fluent-bit +->(kafka)   |     kibana           |
 |  processor |            |     kibana           |
 +--+---------+            +-------------------+--+
    |                                          |
 +--|------------------+   +-------------------|--+
 |  | Elasticsearch    |   |    Elasticsearch  v  |
 |  \->client master<--------->master      client |
 |                     |   |                      |
 +---------------------+   +----------------------+
@endditaa

I get this error:

PlantUML rendering error:
Failed to decode generated inline diagram file (invalid utf-8 sequence of 1 bytes from index 0).

When i extract that and run plantuml manually, I get a valid SVG file.

I suspect this is because ditaa outputs png (regardless of command line), so we would need to handle that.

https://github.com/donbowman/gitbook-plugin-local-plantuml/blob/master/index.js#L43 is how I handled this in gitbook

sytsereitsma commented 4 years ago

Thanks for the report and details, this will require some rework of the code, because I generate everything inline now. Not sure when I will get to it.

donbowman commented 4 years ago

https://github.com/stathissideris/ditaa/pull/30 in the upstream would render ditaa to svg, but plantuml https://github.com/plantuml/plantuml/issues/38 does not