Search code examples
umlmarkdowndoxygenplantumlmermaid

Using UML in doxygen markdown page


I am using doxygen for my personal project and desire to use any type of UML language on page created by myself (markdown page). I do not mean to use it in code (it does work), but on a document created by myself, refer to example underneath:

# Example

sequenceDiagram
    participant Alice
    participant Bob
    Alice->>John: Hello John, how are you?
    loop Healthcheck
        John->>John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail!
    John-->>Alice: Great!
    John->>Bob: How about you?
    Bob-->>John: Jolly good!

```plantuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
```

```mermaid
sequenceDiagram
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob:Another authentication Response
Bob --> Alice: Another authentication Response
```

@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml

\startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
\enduml

And here is the output:

Result

While this text works (mermaid) for typora and plantuml generates together with mermaid on gitlab.

doxygen -x Doxyfile output:

# Difference with default Doxyfile 1.8.17 (9b14bf58c30a02ef19abebec280568532dc58ed4)
PROJECT_NAME           = Name
PROJECT_NUMBER         = 0.0.1
PROJECT_BRIEF          = "Brief"
OUTPUT_DIRECTORY       = out
INLINE_INHERITED_MEMB  = YES
INPUT                  = ./files \
                         ../src/
RECURSIVE              = YES
PLANTUML_JAR_PATH      = /home/<SURNAME>/Installations/plantuml.jar

Question is:

How to use uml diagrams in custom markdown file in doxygen.


Solution

  • It is probably too late for you but doxygen added now the function to integrate plantuml in markdown with version 1.9.4.

    There you can see the examples of how you can include plantuml in your markdown file:

    https://github.com/doxygen/doxygen/pull/9198

    Now it's possible to use backticks like this:

    ```plantuml
    
    Your Diagram
    
    ```