Question: Guidance on implementing Plantuml renderer #648

Open
opened 2026-01-29 14:42:03 +00:00 by claunia · 3 comments
Owner

Originally created by @cjlotz on GitHub (Dec 28, 2023).

Hello. We are looking to add the ability to render Plantuml diagrams using markdig. We've noticed that Markdig.Diagrams has support for nonoml and mermaid diagrams. Is there any documentation that shows the extensibility points for how to go about adding support for Plantuml?

Originally created by @cjlotz on GitHub (Dec 28, 2023). Hello. We are looking to add the ability to render Plantuml diagrams using markdig. We've noticed that Markdig.Diagrams has support for nonoml and mermaid diagrams. Is there any documentation that shows the extensibility points for how to go about adding support for Plantuml?
claunia added the question label 2026-01-29 14:42:03 +00:00
Author
Owner

@xoofx commented on GitHub (Dec 29, 2023):

Is there any documentation that shows the extensibility points for how to go about adding support for Plantuml?

Unfortunately, no doc, but the diagram extension here should be quite straightforward and the HTML code renderer handling it is here

In general, most of the extensions in the Markdig codebase are easy enough to understand them to develop your own.

@xoofx commented on GitHub (Dec 29, 2023): > Is there any documentation that shows the extensibility points for how to go about adding support for Plantuml? Unfortunately, no doc, but the diagram extension [here](https://github.com/xoofx/markdig/blob/master/src/Markdig/Extensions/Diagrams/DiagramExtension.cs) should be quite straightforward and the HTML code renderer handling it is [here](https://github.com/xoofx/markdig/blob/e6afddbaa0d61ec0a8c5df435901387390fd8d8e/src/Markdig/Renderers/Html/CodeBlockRenderer.cs#L34-L57) In general, most of the extensions in the Markdig codebase are easy enough to understand them to develop your own.
Author
Owner

@cjlotz commented on GitHub (Dec 29, 2023):

Thanks @xoofx for the feedback.

I had a look at the implementations, and they seem simple enough due to the fact that both mermaid and nomnoml has support for rendering the diagrams using a JS library. Support for rendering Plantuml using Javascript is still experimental and based on wasm with some issues that I want to avoid. There are existing libraries for transforming the Plantuml code block into a SVG and was hoping to use the libraries to transform the code block into a div that wraps the rendered SVG. This implies some kind of pre-processing and also the ability to specify the configuration for the plantuml server to use for rendering the SVG.

Do the same extension points still apply given the above mentioned description?

@cjlotz commented on GitHub (Dec 29, 2023): Thanks @xoofx for the feedback. I had a look at the implementations, and they seem simple enough due to the fact that both mermaid and nomnoml has support for rendering the diagrams using a JS library. Support for rendering Plantuml using Javascript is still experimental and based on wasm with some issues that I want to avoid. There are [existing libraries](https://github.com/KevReed/PlantUml.Net) for transforming the Plantuml code block into a SVG and was hoping to use the libraries to transform the code block into a div that wraps the rendered SVG. This implies some kind of pre-processing and also the ability to specify the configuration for the plantuml server to use for rendering the SVG. Do the same extension points still apply given the above mentioned description?
Author
Owner

@xoofx commented on GitHub (Dec 29, 2023):

Do the same extension points still apply given the above mentioned description?

You might have to write your own HTML renderer or transform the AST before rendering (e.g transform the codeblock to a HTML block)

@xoofx commented on GitHub (Dec 29, 2023): > Do the same extension points still apply given the above mentioned description? You might have to write your own HTML renderer or transform the AST before rendering (e.g transform the codeblock to a HTML block)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#648