Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add PlantUML diagram support #180

Open
PeterDaveHello opened this issue May 17, 2024 · 2 comments
Open

Feature Request: Add PlantUML diagram support #180

PeterDaveHello opened this issue May 17, 2024 · 2 comments

Comments

@PeterDaveHello
Copy link
Contributor

Thanks for the great work on mdpdf! It's been a convenient tool for converting Markdown to PDF.

It looks like mdpdf currently doesn't support rendering PlantUML diagrams embedded in the Markdown source. PlantUML is a popular plain text format for defining various types of diagrams. Having native support for it, similar to how GitLab supports rendering PlantUML code blocks directly in Markdown files, would be a handy feature.

This would allow users to easily include sequence diagrams, use case diagrams, class diagrams, etc., right in their Markdown documents and have them show up properly in the generated PDF.

Is this a feature you would consider adding to mdpdf? Let me know what you think!

@elliotblackburn
Copy link
Owner

Glad you've found the package useful!

mdpdf started as just something I needed to help me with some assignments when I was in university (too long ago now). I've never really had a need for a UML plugin to be honest, although I could see it being useful to other users so I'd happily have support for it. That said, I don't have much time to dedicate to the project at the moment so it's not something I'd be able to add any time soon. I'd be up for reviewing a pull request though if someone else fancied it.

The markdown -> html step uses Showdownjs, so you'd either need a pre-processor to generate images before that step and replace the markup, or a showdown plugin. A showdown plugin would be preferrable, even if it didn't do the full range of functionality that PlantUML supports as it would be far easier to maintain on this side. But I'm up for discussing some ideas with anyone who wants to have a go at implementing it.

@PeterDaveHello
Copy link
Contributor Author

Thanks @BlueHatbRit, I just took a look at Showdownjs, and it looks like the development has been pending for a while. Though I might not be able to take a deep look, but maybe a trick is to use plantuml-encoder(https://www.npmjs.com/package/plantuml-encoder) to encode the PlantUML code block, and use a PlantUML server to handle the rendering, that's how GitLab is doing it, if I remember correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants