mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

Title support for every diagram

Open italomaia-bk opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. Titles are really important when sharing diagrams because they give a strong context about what the person is seeing.

Describe the solution you'd like It would be amazing if all memaid diagrams supported a standard title or "name", so, when sharing just the diagram, it would always be clear what the diagram is about.

Describe alternatives you've considered The same way we declare the diagram type as the first instruction, if we could declare the diagram name, it would be really cool. Something like this would also be interesting: graph LR (My Beautiful Graph)

italomaia-bk avatar May 28 '20 12:05 italomaia-bk

Hi @italomaia-bk, we should definitely add support for diagram titles. Issue #556 is also about this topic but only mentions flowcharts. We might as well add this as a common feature for all chart types while we're at it.

GDFaber avatar May 28 '20 12:05 GDFaber

@GDFaber Maybe this could be added to the new rendering engine. Then it would only be in one place for all dagre based diagrams.

knsv avatar Jun 02 '20 17:06 knsv

Workaround using subgraph Title end https://github.com/mermaid-js/mermaid/issues/556#issuecomment-579706603

chris2fr avatar Feb 02 '21 11:02 chris2fr

Are there any updates on this issue? plantuml allows adding a title and header to any graph.

zalsader avatar Apr 08 '22 03:04 zalsader

Any Update? This feature has been requested for 5 years

GianlucaVeschi avatar May 16 '23 09:05 GianlucaVeschi

@GianlucaVeschi unless I'm misunderstanding something, the PR associated with this issue was merged in late 2022: https://github.com/mermaid-js/mermaid/pull/3706

You can now specify Title for all diagrams.

besh avatar Jun 08 '23 17:06 besh

If someone reached here by googling: you just need to add a "yaml frontmatter" to your diagram code with a title property.

Here's a super basic example:

---
title: My Super Cool Title
---
flowchart LR
    id
---
title: My Super Cool Title
---
flowchart LR
    id

meleu-cw avatar Mar 12 '24 12:03 meleu-cw