Skip to content

Allow defining options for PlantUML in Markdown

Carl Kittelberger requested to merge (removed):pr/plantuml-gfm-svg into master

Hello,

this would be my first merge request here, and also my first try at contributing to Ruby code. Hopefully this is useful even if only as a suggestion! :)

What does this MR do?

This merge requests implements a way to define additional options for PlantUML diagrams like format and width in Markdown texts by defining them using the already known syntax from AsciiDoc as language for the code block.

Example usage:

```plantuml, format=svg, width=512px
A -> B
B -> C
C -> A
```

The old syntax with just ```plantuml continues working as before.

The respective extra information that Markdown does not support defining the options has been removed from the documentation.

Are there points in the code the reviewer needs to double check?

I was not sure if there is a more integrated way to parse the options than manually splitting the language line and turning it into an options object. Plus that bit of code may not be fully optimized despite its shortness. For this reason I am also not sure if this fully adheres by the merge request performance guides.

Why was this MR needed?

The Markdown parser for texts written in the wiki or in the issue tracker didn't support the various options that PlantUML accepts for all the other document types. This will allow for SVG output instead of the default PNG output.

Screenshots (if relevant)

This is not a change to the graphical user interface part of GitLab.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Edited by Carl Kittelberger

Merge request reports