Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GitLab style plantuml blocks and additional diagram types #456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

th-yoo
Copy link

@th-yoo th-yoo commented Jul 19, 2024

Examples

  • PlantUML tags are used in the same way as before
    @startuml
    A <|-- B
    @enduml
  • Defaults to @startuml
    ```plantuml
    A <|-- B
    ```
    ```plantuml
    @startuml
    A <|-- B
    @enduml
    ```
   @startuml
   A <|-- B
   @enduml

All three blocks above are equivalent. However, blocks without plantuml code tag (triple backtick + "plantuml") will not be rendered in Gitlab.

  • Support for newly added tags
@startditaa
+---------+  /--------\   +-------+
| cBLU    +--+cAAA    +---+Version|
|         |  |  Data  |   |   V3  |
|    +----+  |  Base  |   |cRED{d}|
|    |cPNK|  |     {s}|   +-------+
|    |    |  \---+----/
+----+----+    
@endditaa
  • Some PlantUML tags have their options
@startditaa -E
+---------+  /--------\   +-------+
| cBLU    +--+cAAA    +---+Version|
|         |  |  Data  |   |   V3  |
|    +----+  |  Base  |   |cRED{d}|
|    |cPNK|  |     {s}|   +-------+
|    |    |  \---+----/
+----+----+    
@endditaa

…ypes

This commit introduces support for GitLab style ```plantuml blocks and extends the diagram types available to include {ebnf, regex, ditaa, gantt, chronology, chen}.
@guillaume-d
Copy link

Couldn't this be implemented using Gollum 6's custom language handlers instead, or am I missing something?

Also the @start... syntax could stay without support for new diagram types. Not adding them there may be both good (backward-compatibility) and bad (inconsistent with backtick syntax).

@dometto
Copy link
Member

dometto commented Aug 26, 2024

Thank you for submitting this @th-yoo!

Couldn't this be implemented using Gollum 6's custom language handlers instead, or am I missing something?

Thanks for mentioning this @guillaume-d -- I think that would indeed be the best and most maintainable way to implement this functionality.

@th-yoo do you think you could rework this PR to incorporate this idea? Let me know if you need pointers to implement the language handler. It might (but also might not) make sense to implement this in gollum instead of gollum-lib, compare the Mermaid implementation here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants