Skip to content

💡 Feature Request - {% startmermaid %} block tag #18

@maiksprenger

Description

@maiksprenger

Implementation PR

No response

Reference Issues

No response

Summary

Hi, thank you for a neat little project!

At my work, we'd like to implement a few larger diagrams, and it's hard to format them in the single {% mermaid "" %} template tag. I propose a second, block template tag, and am happy to implement it if you think it's worth doing.

I would keep support for specifying theme and version, and I'd update the existing tests to test them with both versions of the tag. The resulting output should be identical, apart from maybe whitespace differences.

What do you think?

Basic Example

{% startmermaid %}
graph TD
    A[Enter Chart Definition] --> B(Preview)
    B --> C{decide}
    C --> D[Keep]
    C --> E[Edit Definition]
    E --> B
    D --> F[Save Image and Code]
    F --> B
{% endmermaid %}

Drawbacks

  • block template tag code is more complex than simple tags

Unresolved questions

  • How would we call the new template tags? startmermaid/endmermaid? mermaid_block/endmermaid_block? diagram/enddiagram? Or would we try to be clever and support both versions with a single mermaid tag?

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions