Skip to content

Conversation

@cesarParra
Copy link
Owner

@cesarParra cesarParra commented Feb 25, 2024

Add support for inline diagraming through Mermaid.

The new @mermaid tag can be used to describe Mermaid diagrams through code. It works similarly to how @example
works, where the code gets placed in individual lines after defining the tag.

Example:

/**
 * @description My Class' description
 * @mermaid
 * sequenceDiagram
 *    participant dotcom
 *    participant iframe
 *    participant viewscreen
 *    dotcom->>iframe: loads html w/ iframe url
 *    iframe->>viewscreen: request template
 *    viewscreen->>iframe: html & javascript
 *    iframe->>dotcom: iframe ready
 *    dotcom->>iframe: set mermaid data on iframe
 *    iframe->>iframe: render mermaid
 */
public class MyClass {
}

The diagram displays as

image

Note that to be able to make use of this feature you need to use a Markdown reader that supports rendering Mermaid (for example, Github's markdown reader has it built-into it).

@cesarParra cesarParra marked this pull request as ready for review February 25, 2024 22:10
@cesarParra cesarParra merged commit 963498d into master Feb 25, 2024
@cesarParra cesarParra deleted the mermaid-support branch April 15, 2024 11:15
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.

2 participants