pandoc-ext / diagram

Generate diagrams from embedded code; supports Mermaid, Dot/GraphViz, PlantUML, Asymptote, and TikZ.
MIT License
53 stars 9 forks source link

Usage with Quarto and plantuml diagram #6

Closed FabienSe closed 1 year ago

FabienSe commented 1 year ago

I found this information in the readme

While it is possible to use this filter with Quarto, it is not encouraged. Quarto comes its own system for diagram generation, and that should be used instead.

I looked at the documentation, Quarto comes with native support of Mermaid and Graphviz. This affirmation is then true for those types of diagrams. But I did not see a way to extend the native support with other format like plantuml.

This extension could be a good fit to integrate plantuml support to Quarto ?

Sorry to ping you @cderv, may be you can help to answer my question ?

Thanks a lot for you help!

cderv commented 1 year ago

No worry. Feel free to ping me in distant repo like this - otherwise I would miss it.

And Yes you're right. Quarto supports Mermaid and Graphviz. For Plantuml I believe this is extensions should be safe to use, isn't it @tarleb ?

tarleb commented 1 year ago

That's true, it should work, but I didn't test with Quarto yet. I'd actually be grateful if someone could test that and report remaining bugs and incompatibilities, as I hope to do a proper release of this filter soon – Quarto should be fully supported when that happens.

FabienSe commented 1 year ago

Cool, I can test the plantuml integration with Quarto on my side!

I can also try to contribute if needed to make this filter usable with quarto install extension like https://github.com/pandoc-ext/abstract-section

tarleb commented 1 year ago

Thank you @FabienSe! All and any help is welcome.

FabienSe commented 1 year ago

I tested diagram.lua with the following qmd file:

---
filters:
  - diagram.lua
diagram:
  cache: true
  cache-dir: .cache/plantuml
---

# Welcome for fun

```{.plantuml}
'| label: fig-auth
@startuml
Alice -> Bob: Authentication Request Bob  super --> Alice: Authentication Response
Alice -> Bob: Another authentication Request Alice <-- Bob: another Response
@enduml

I found a problem while testing the integration with quatro. I will open a seperate isssue linked to it.
After removing the problem. The rendering and caching was working well.

I tried to convert the file in markdown, docx, with a project to do a [docusaurus](https://quarto.org/docs/output-formats/docusaurus.html) site. 
tarleb commented 1 year ago

The filter is now usable as a Quarto extension and can be installed with quarto add pandoc-ext/diagram.