git – How to integrate UML diagrams into GitLab or GitHub – Stack Overflow
Posted by jpluimers on 2018/12/05
Note that as of somewhere in 2022, GitLab now natively supports PlantUML (even embedded in files like markdown and asciidoc), so here are the updated saved links to the StackOverflow question below: [Wayback/Archive]
Interesting solution: [WayBack/Archive] git – How to integrate UML diagrams into GitLab or GitHub – Stack Overflow (thanks [Wayback/Archive] joanq and [Wayback/Archive] Fuhrmanator)
GitLab support for PlantUML
Example:
- Rendered markdown with PlantUML: [Wayback/Archive] test plantUML ($2499046) · Snippets · Snippets · GitLab
- Raw markdown with PlantUML: [Wayback/Archive] gitlab.com/-/snippets/2499046/raw/main/plantUML.md
Documentation:
- [Wayback/Archive] Snippets | GitLab
- [Wayback/Archive] PlantUML and GitLab | GitLab
When the PlantUML integration is enabled and configured in GitLab, you can create diagrams in snippets, wikis, and repositories. This integration is enabled on GitLab.com for all SaaS users and does not require any additional configuration.
…
After completing the integration, PlantUML converts
plantuml
blocks to an HTML image tag, with the source pointing to the PlantUML instance. The PlantUML diagram delimiters@startuml
/@enduml
aren’t required, as these are replaced by theplantuml
block:- Markdown files with the extension
.md
:```plantuml Bob -> Alice : hello Alice -> Bob : hi ```
For additional acceptable extensions, review the
languages.yaml
file. - AsciiDoc files with the extension
.asciidoc
,.adoc
, or.asc
:[plantuml, format="png", id="myDiagram", width="200px"] ---- Bob->Alice : hello Alice -> Bob : hi ----
- reStructuredText
.. plantuml:: :caption: Caption with **bold** and *italic* Bob -> Alice: hello Alice -> Bob: hi
Although you can use the
uml::
directive for compatibility withsphinxcontrib-plantuml
, GitLab supports only thecaption
option.
…
- Markdown files with the extension
Leave a Reply