5

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.

Black
  • 312
  • 2
  • 15
  • Which version of doxygen are you using? You probably want to use the `\startuml` / `\enduml` commands (as you tried at the last lines). Regarding the triple backticks there is already an issue: https://github.com/doxygen/doxygen/issues/7543 . Why did you used the backslashes before the backticks? Do you get any warnings? – albert Feb 04 '20 at 09:15
  • @albert I noted that backticks are necessary for stack to not split code block into parts, my doxygen version is 1.8.16 (or 15, don't have access to machine RN, but it is not later than november as I build it from source). The `\startuml` | `\enduml` markers did not worked either. – Black Feb 04 '20 at 09:44
  • @qwerty_so It might not be obvious, sorry gonna add it. `How to use uml diagrams in custom markdown files, in doxygen.` – Black Feb 04 '20 at 09:45
  • 1
    You need to edit your question. A comment is not enough. – qwerty_so Feb 04 '20 at 09:51
  • 1
    Regarding the "The \startuml | \enduml markers did not worked either.", this must have to do something with your installation. Did you install plantuml? What is in your `PLANTUML_JAR_PATH` in your doxygen configuration file (Doxyfile). Did you get a warning? Please rerun with `doxygen -d extcmd` to give the commands as run by doxygen. When you build it in November 2019 from git it is the master version (between 1.8.16 and 1.8.17, please give the output of `doxygen -v`). For easy comparison of settings also provide the output of `doxygen -x Doxyfile`. – albert Feb 04 '20 at 09:53
  • The way to use plantuml in custom markdown file in doxygen is by way of the method mentioned already by you with `@startuml` / `@enduml`. – albert Feb 04 '20 at 10:45
  • @albert, first of all – thank you for helping. I have tested all things you asked (edited question). I was indeed missing `PLANTUML_JAR_PATH`, which I already fixed, but effect isn't different. I have added aswell both verrsion (with `@` and with `\` into tested code samples. – Black Feb 04 '20 at 14:45
  • Okay, @albert. I am just foolish man, with to quick hands for his skill/mind. I did not removed "out" folder. Once I removed the `out`, everything went smoothly. Code has spit out errors, which I easily fixed on my own. Thank you for great amount of help! – Black Feb 04 '20 at 14:57
  • 3
    Fortunately the problem is solved. The plantuml is indeed sometimes a bit cumbersome, to regenerate one has to remove the `inline_umlgraph_cache_all.pu` file in the `OUTPUT_DIRECTORY` otherwise doxygen thinks the files were already generated (unless one of the `@startuml` codes changed) . – albert Feb 04 '20 at 15:01
  • I think this does only work when the plantuml commands are not quoted, e.g. like: ``` text .... @startuml ... @enduml – oliverleo Nov 04 '20 at 13:26

1 Answers1

1

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

```
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • While I did not expect this question to get so much traction, I find this answer fascinating. I will test it (at some point) and accept the answer if it works ;) – Black Jul 08 '22 at 17:05