pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
611 stars 166 forks source link

Added a caption for PlantUML diagrams #39

Closed SommerEngineering closed 5 years ago

SommerEngineering commented 5 years ago

Dear community,

I added a caption for PlantUML diagrams, as discussed at the mailing list, cf. https://groups.google.com/forum/#!msg/pandoc-discuss/xItcBa8OtuI/s9MoBfc_CwAJ

SommerEngineering commented 5 years ago

I updated also the README to use the new captions. The Makefile is fine.

SommerEngineering commented 5 years ago

Thanks @tarleb for your feedback. I will fix that as soon as possible.

tarleb commented 5 years ago

Clean and beautiful code, and well documented, too! There are currently no tests for the new filters, which is why the CI build fails. Can you add some?

I think the figure numbering filter deserves a separate pull request, so we don't mix different things in one PR.

SommerEngineering commented 5 years ago

@tarleb I removed the figure numbering filter. I will create another PR for that. Tests are added.

SommerEngineering commented 5 years ago

Okay, here's the summary of my changes: We can now create figures with different systems and languages:

This filter also creates the corresponding captions. In the captions, markdown statements can also be processed. As default, this filter produces SVG vector graphics. For Microsoft Word (docx), Microsoft PowerPoint (pptx), and the RTF formats 300 DPI PNGs will be produced instead.

Under Windows there is currently a bug in Pandoc: When SVG graphics are generated, there is an access violation with this README.md file. This occurs when the SVG file is to be written from LaTeX / Inkscape to the Pandoc's media bag. I'm reporting this issue to Pandoc. Under Linux e.g. the Travis CI, this issue does not appear.

SommerEngineering commented 5 years ago

I created an issue for Pandoc: https://github.com/jgm/pandoc/issues/5436

tarleb commented 5 years ago

Thanks! I'll take a look soon.

SommerEngineering commented 5 years ago

The Windows issue jgm/pandoc#5436 was fixed with Pandoc 2.7.2. I updated the output.html and added a hint regarding the usage of the Java variables.

tarleb commented 5 years ago

I finally found the time to start a review. This is a great PR and probably already in mergeable state. I'll leave some more comments inline over the next day, but those should be understood less as "needs to be changed" but more as "what do you think about".

tarleb commented 5 years ago

Two other small things: the filter name currently contains a underscore, while all other filters in this repo use a hyphen to separate words; it would be good to be consistent there. I think output.html should not have been part of the original plantuml filter, it can be removed.

Please let me know whether you prefer to do more work, or whether you'd rather see this merged right away. I'm okay with both options, we can still fix things after merging.

SommerEngineering commented 5 years ago

Thank @tarleb for the advise :-) I fixed anything. The PR might be good to go now :-)

SommerEngineering commented 5 years ago

By the way: PR #37 is might obsolete since Graphviz is included here.

tarleb commented 5 years ago

Great, thanks!