-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat: Title support via front matter for ER, state, class, git, and graph diagrams #3706
Conversation
The failure in the "E2E / build (18.x, 1) (pull_request) " check appears unrelated:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failure in the "E2E / build (18.x, 1) (pull_request) " check appears unrelated
Yep! Just seems to be GitHub's servers being flakey.
This isn't a proper review (I'm not an expert on the rendering code, so will leave that to other reviewers), but from one I've seen, it all looks good! Thanks for adding tests and demo examples!
Potential improvements:
- Can you add a
title
example to thepackages/mermaid/src/docs/classDiagram.md
?
Thanks for the review @aloisklink! Extracting the rendering logic to a helper method sounds reasonable, so I went ahead and did that and added tests for it. I also updated the docs for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Again, I'm not super experienced with SVG/d3/rendering code, so another reviewer will need to double-check that.
As a quick example, this is what the new title in the http://localhost:9000/git.html demo looks like:
Wow Mason! A big job, I appreciate changes that align diagrams. One of the challenges going forward is keeping the diagrams in line. Will do a deep dive here as it affect many diagrams. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @MasonM!
Great job but we are not there yet! I have reviewed you changes and found some issues. When you introduced the title keyword you also unwittingly made it impossible to create a state named title, a flowchart with an id of title/usage of title in a subgraph title or an er diagram with an entity title.
We are very restrictive with changes that would break existing diagrams. It is one thing to introduce a change leading to a developer having update the integration of mermaid on a site but whole other thing with an update that is forcing authors to go in and update the already written documentation.
On possible fix for the issue would be, to be more restrictive with scoping out what a title is, in the lexer. The solutions will probably differ between the different diagrams though. Another avenue could be to use the different states in the parser to know if a title could be expected.
One example of a breaking diagram:
erDiagram
title ||--o{ ORDER : places
CUSTOMER {
string title
string custNumber
string sector
}
ORDER ||--|{ LINE-ITEM : title
ORDER {
int orderNumber
string deliveryAddress
}
LINE-ITEM {
string productCode
int quantity
float pricePerUnit
}
Good luck,
Knut
@knsv Thanks for the review! I understand the important of retaining backwards-compatibility, but I'd assumed there was some leeway here, since the changes that introduced If the policy is that backwards-incompatible changes are strictly forbidden, then the only option I can see is using a directive, e.g.:
That's cumbersome, but it's guaranteed to be backwards-compatible, and all the diagrams already support directives. I can go ahead and implement that if you want, but if there is some leeway here, then changing |
Hi! Yeah, thats the price of an organically growing syntax. If I started today I would make the syntax a little different so that states in the parser can be applied easier but it is as it is. I am thinking that restricting the lexer regarding the title could be a good place to start. Right now you use Hope this helps! |
That's still a breaking change for some diagram types. Consider this state diagram, which currently renders as a diagram with the states It sounds like you're okay with "minor" breaking changes, but the definition of "minor" is quite subjective. That's perfectly reasonable, but I can't read your mind, and I'd prefer not to guess and spend a lot of time implementing a new syntax, only to be told it won't be accepted because it's too big of a breaking change. Could you please tell me the exact grammar you'd like to see for each diagram type? |
You are right, that solution will only work for flowcharts and er diagrams. We need a different solution for state diagrams. I would to start with proposing to delay State diagrams a bit so that we can get this done in October as a part of Hacktoberfest. |
@knsv It's going to break class diagrams too. Example. As I see it, there's four options here:
Which of these 4 options would you prefer? |
Thanks for your analysis. Some feedback: Some broader ideas:
What do you think? |
That's a good idea. Having special syntax for distinguishing metadata (like the title) from the actual diagram data is likely be useful in the future. Implementing it in a backwards-compatible way will be tricky, but it's only going to get more challenging as Mermaid continues to grow and adds more diagrams and syntax. State diagrams are particularly challenging due to the lax grammar, and |
Hmmmm, what about having an optional YAML header in a mermaid definition? In many markdown software, you can optionally add a YAML header to add Markdown metadata, e.g. something like: ---
title: My title
date: 1970-01-01
author: FirstName LastName
---
# Hello world The rules would be the same as in Markdown, it must be the first thing in a Mermaid definition, it might be valid YAML, and it must be between Here is my mermaid definition:
```mermaid
---
title: my graph
author: FirstName LastName
---
flowchart LR
A[Hard] -->|Text| B(Round)
B --> C{Decision}
``` Benefits:
|
Jumping in (since I'm currently working with the state diagram parser) -- Why is Is it only the problem with the state diagrams? If so, it's not hard to write a rule that looks for not just for |
I believe it's because of backwards compatibility, there's a pretty good chance somebody has already created a mermaid state diagram that uses E.g. something like: ```mermaid
stateDiagram
title: Example state diagram
my2ndState: My second state
title --> my2ndState
``` stateDiagram
title
title: Example state diagram
my2ndState: My second state
title --> my2ndState
Or ```mermaid
stateDiagram
title
description
title --> description
``` stateDiagram
title
description
title --> description
|
Ah Makes total sense. Thanks for spelling that out for me @aloisklink . |
1aede3b
to
64271fc
Compare
Okay, I couldn't find anything that would break with the
Personally, I think YAML is probably the right way to go. If @knsv agrees, then I can go ahead and implement that using |
I am all for it! Further down the line if things work out I could see directives pulled in to this syntax. The old syntax could remain for backwards compatibility, this would be the documented one. The size increase is worry-some as mermaid is on the heavy side already. I am convinced that having a preprocessing step is the method to use. This will eliminate conflicts with the diagrams. |
Why not then just:
without encapsulating in
|
JSON is valid YAML, so it should be easy to migrate directives to YAML, if we want to support that.
It makes sense if we're using YAML for a few reasons:
Basically, using |
+1 for yaml header. |
It might be worth specifying this using https://json-schema.org/, since YAML can almost always be converted to JSON (I think the only issue is with circular references, but those are very rare). We could then use https://www.npmjs.com/package/json-schema-to-typescript to easily convert these into TypeScript types. And we could use those JSON Schemas for input validation, and print good errors if something is invalid (e.g. what Webpack does). If I have time, I'm considering moving the Mermaid config to JSON Schema too, since the way it is currently documented is incompatible with the new Vitepress website. |
e5ff2d4
to
7d5dc03
Compare
28669aa
to
70f0247
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing! And you've made this PR pretty small too, which means it's a pretty good change!
Some minor nit-picks from me, but they're mostly just nit-picks.
The only required change is to add a test for a YAML that contains ---
on it's own line, e.g.:
title: |
My multi-line string
---
^^^ Has an end-document string in it in it's own line
It's a rare edge-case, but we might run into it if we make a flowchart mermaid
and we want to add a YAML front-matter example to a description :)
We should also change the PR title to saying something about YAML frontmatters. E.g. something like: Add YAML frontmatter to set titles in diagrams
. It might also be worth copying some of #3706 (comment) to the main PR description with a quick example.
it('handles frontmatter with multiple delimiters', () => { | ||
const db = dbMock(); | ||
const text = `---\ntitle: foo---bar\n---\ndiagram\n---\ntest`; | ||
expect(extractFrontMatter(text, db)).toEqual('diagram\n---\ntest'); | ||
expect(db.setDiagramTitle).toHaveBeenCalledWith('foo---bar'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test for a string with a ---
in it on it's own line, e.g like the following YAML:
title: |
My multi-line string
---
^^^ Has an end-document string in it in it's own line
description: Some other junk here
# but what about a comment that has a --- in it?
It might be that the REGEX gets confused by it.
If it's too difficult to handle, it might just be easier to use a library to parse the front-matter like https://github.com/jonschlinkert/gray-matter, although that project hasn't been updated for a while, so 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any way of supporting that syntax without serious compromises:
- Disallowing leading whitespace before the delimiters would work (that's what gray-matter does), but leading whitespace before a diagram is very common, and disallowing it means you can't indent a diagram. e.g.
Lines 19 to 24 in 70f0247
<pre class="mermaid"> --- title: This is a complicated flow --- graph LR accTitle: This is a complicated flow - Changing the
(.*?)
to(.*)
isn't an option because that will break compatibility with diagrams containing---
- Trying to match the indent level of the closing delimiter with that of the opening delimiter won't work because leading whitespace is stripped in
mermaid/packages/mermaid/src/mermaid.ts
Lines 149 to 153 in 70f0247
// transforms the html to pure text txt = utils .entityDecode(txt) .trim() .replace(/<br\s*\/?>/gi, '<br/>');
Do you have any other ideas? If not, I think we should consider this an edge case and not support it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disallowing leading whitespace before the delimiters would work
My gut feeling is that this is the approach we should go for (as that's that is what YAML spec v1.0 section 4.3.1 says), but you are right that many people do indent the diagrams.
We could add a dedent
to https://github.com/mermaid-js/mermaid/blob/70f024735b57ac5b29b5c339ac871078ab46fa5a/packages/mermaid/src/mermaid.ts#LL149-L153. It would only apply to HTML however.
We could also add dedent
inside parse(str)
somewhere (or other functions that takes the Mermaid string directly), e.g. right before:
const diagram = new Diagram(text, parseError); |
But that's not super required. People calling the JavaScript API can use dedent
themselves if they want to use indented strings and the YAML frontmatter, e.g.
import { dedent } from 'ts-dedent';
const myDiagram = dedent`
---
title: This YAML is indented by two spaces.
---
flowchart
"This diagram is indented by two spaces."
`;
const svg = mermaid.render("mermaid-render-element", myDiagram);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, alright, if you're sure that's the way to go, I implemented that in a11ab3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're sure that's the way to go
I'm not fully sure! But I'd rather have the parser be too strict at the the beginning, since we can always loosen things later without it being a breaking change. It's much harder to make something stricter later on, as that would be a breaking change.
But I'd be be happy for people to disagree or if they think there's a better way to do things!
I am slightly leaning towards also adding a dedent
before parsing the Mermaid HTML in mermaid.init/mermaid.initThrowsErrors so that Mermaid diagrams indented in HTML work, but not for JS code in mermaid.parse
. Edit PR created for this in #3859
But that could be a decision for a future PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When adding diagrams in html you inherit the indentation from the tag. This looks better in HTML:
<pre id="diagram" class="mermaid">
---
title: Example Git diagram
---
gitGraph
commit
commit
</pre>
than:
<pre id="diagram" class="mermaid">
---
title: Example Git diagram
---
gitGraph
commit
commit
</pre>
Even though it is less compliant with the standard.
I don't see the multi-line issue as a big problem though. My guess is that the user impact of indenting will affect far, far more users then the lack of ability to use ---
in the beginning of a a multiline row.
I lean towards the more loose application, better to let the very few users that wants to have the --- in the multiline comment fail instead of irritating the users that want to indent.
But Alois has a fair point. Once we let the cat out of the box, it is out. Lets start with this but I suspect that we need to discuss this more and that we might might want to reverse the a11ab3d commit. That can be outside this PR though. Good job @MasonM Solid!
const parsed: FrontMatterMetadata = yaml.load(matches[1], { | ||
// To keep things simple, only allow strings, arrays, and plain objects. | ||
// https://www.yaml.org/spec/1.2/spec.html#id2802346 | ||
schema: yaml.FAILSAFE_SCHEMA, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 This is a good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this!
For other reviewers, currently, the YAML must not be indented, e.g.:
<!-- This is fine, no indentation on the YAML --!>
<pre class="mermaid">
---
title: My title
---
flowchart
my flowchart
</pre>
<!-- This is not fine, there is indentation on the YAML --!>
<pre class="mermaid">
---
title: My title
---
flowchart
my flowchart
</pre>
It may be worth using dedent to automatically remove the indentation from Mermaid code in HTML, but I'm happy for that to be added in a different PR. See discussion in #3706 (comment) for more info.
@knsv Could you please review this? Unfortunately, I have very limited additional free time to spend on this, so if this isn't merged soon, I'll have to close it. |
Will review today |
Approving this but lets add dedent. I like that idea. Solves the indentation issue that will annoy some users! |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [mermaid](https://togithub.com/mermaid-js/mermaid) | [`9.2.2` -> `9.3.0`](https://renovatebot.com/diffs/npm/mermaid/9.2.2/9.3.0) | [![age](https://badges.renovateapi.com/packages/npm/mermaid/9.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/mermaid/9.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/mermaid/9.3.0/compatibility-slim/9.2.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/mermaid/9.3.0/confidence-slim/9.2.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>mermaid-js/mermaid</summary> ### [`v9.3.0`](https://togithub.com/mermaid-js/mermaid/releases/tag/v9.3.0) [Compare Source](https://togithub.com/mermaid-js/mermaid/compare/v9.2.2...v9.3.0) ### Significant Changes - 25% Smaller - New docs - Replaces the deprecated and vulnerable `dagre-d3` with `dagre-es` ### Release Notes - [#​3778](https://togithub.com/mermaid-js/mermaid/issues/3778) Adding a hexgon shape ([#​3834](https://togithub.com/mermaid-js/mermaid/issues/3834)) [@​knsv](https://togithub.com/knsv) - [#​3831](https://togithub.com/mermaid-js/mermaid/issues/3831) Re-enabling themes for er diagrams ([#​3837](https://togithub.com/mermaid-js/mermaid/issues/3837)) [@​knsv](https://togithub.com/knsv) - [#​3882](https://togithub.com/mermaid-js/mermaid/issues/3882) fix for issues with mindmaps with only a single node ([#​3833](https://togithub.com/mermaid-js/mermaid/issues/3833)) [@​knsv](https://togithub.com/knsv) - (chore) remove console stmt in pieDetector ([#​3840](https://togithub.com/mermaid-js/mermaid/issues/3840)) [@​weedySeaDragon](https://togithub.com/weedySeaDragon) - (feat) state classDef documentation ([#​3841](https://togithub.com/mermaid-js/mermaid/issues/3841)) [@​weedySeaDragon](https://togithub.com/weedySeaDragon) - 3882 edge labels ([#​3883](https://togithub.com/mermaid-js/mermaid/issues/3883)) [@​knsv](https://togithub.com/knsv) - Add GHA that will check links + Fix broken links ([#​3765](https://togithub.com/mermaid-js/mermaid/issues/3765)) [@​spier](https://togithub.com/spier) - Add official vim plugin to list in integrations ([#​3847](https://togithub.com/mermaid-js/mermaid/issues/3847)) [@​craigmac](https://togithub.com/craigmac) - Add package visualizations ([#​3823](https://togithub.com/mermaid-js/mermaid/issues/3823)) [@​sidharthv96](https://togithub.com/sidharthv96) - Add support for [@​include](https://togithub.com/include) in docs ([#​3863](https://togithub.com/mermaid-js/mermaid/issues/3863)) [@​sidharthv96](https://togithub.com/sidharthv96) - CI: disable pinning dependencies ([#​3735](https://togithub.com/mermaid-js/mermaid/issues/3735)) [@​aloisklink](https://togithub.com/aloisklink) - Defects/issue 3878 ([#​3880](https://togithub.com/mermaid-js/mermaid/issues/3880)) [@​MrCoder](https://togithub.com/MrCoder) - Feat: Add aria-describedby, aria-roledescription ([#​3808](https://togithub.com/mermaid-js/mermaid/issues/3808)) [@​weedySeaDragon](https://togithub.com/weedySeaDragon) - Fix [#​3799](https://togithub.com/mermaid-js/mermaid/issues/3799): Remove `type` from package.json ([#​3802](https://togithub.com/mermaid-js/mermaid/issues/3802)) [@​sidharthv96](https://togithub.com/sidharthv96) - Fix for [#​3835](https://togithub.com/mermaid-js/mermaid/issues/3835), makes it possible to style path elements ([#​3836](https://togithub.com/mermaid-js/mermaid/issues/3836)) [@​knsv](https://togithub.com/knsv) - Fix typos ([#​3820](https://togithub.com/mermaid-js/mermaid/issues/3820)) [@​endolith](https://togithub.com/endolith) - Housekeeping with eslint-unicorn ([#​3845](https://togithub.com/mermaid-js/mermaid/issues/3845)) [@​sidharthv96](https://togithub.com/sidharthv96) - Integrations added - Visual Studio Code \[Polyglot Interactive Notebooks] ([#​3821](https://togithub.com/mermaid-js/mermaid/issues/3821)) [@​dfinke](https://togithub.com/dfinke) - Mindmap integration docs ([#​3810](https://togithub.com/mermaid-js/mermaid/issues/3810)) [@​sidharthv96](https://togithub.com/sidharthv96) - Reduce mermaid size by 31% ([#​3825](https://togithub.com/mermaid-js/mermaid/issues/3825)) [@​sidharthv96](https://togithub.com/sidharthv96) - Remove extra arrow and adjust cross position ([#​3641](https://togithub.com/mermaid-js/mermaid/issues/3641)) [@​ishuen](https://togithub.com/ishuen) - Replace `dagre`/`dagre-d3` with `dagre-d3-es` ([#​3809](https://togithub.com/mermaid-js/mermaid/issues/3809)) [@​aloisklink](https://togithub.com/aloisklink) - Revert "Added pie" ([#​3842](https://togithub.com/mermaid-js/mermaid/issues/3842)) [@​pbrolin47](https://togithub.com/pbrolin47) - Switch CDN to unpkg.com ([#​3777](https://togithub.com/mermaid-js/mermaid/issues/3777)) [@​sidharthv96](https://togithub.com/sidharthv96) - Switch back to jsdelivr ([#​3873](https://togithub.com/mermaid-js/mermaid/issues/3873)) [@​sidharthv96](https://togithub.com/sidharthv96) - Use `github-dark` to highlight fence blocks in vitepress docs ([#​3807](https://togithub.com/mermaid-js/mermaid/issues/3807)) [@​aloisklink](https://togithub.com/aloisklink) - Use current mermaid version in docs. ([#​3846](https://togithub.com/mermaid-js/mermaid/issues/3846)) [@​sidharthv96](https://togithub.com/sidharthv96) - Use stylis to prepend idSelector ([#​3829](https://togithub.com/mermaid-js/mermaid/issues/3829)) [@​DanInProgress](https://togithub.com/DanInProgress) - bug: State diagram fix classes type ([#​3798](https://togithub.com/mermaid-js/mermaid/issues/3798)) [@​weedySeaDragon](https://togithub.com/weedySeaDragon) - bug: change shiki getHighlighter import ([#​3804](https://togithub.com/mermaid-js/mermaid/issues/3804)) [@​weedySeaDragon](https://togithub.com/weedySeaDragon) - chore(deps): remove dependency on `graphlib` ([#​3861](https://togithub.com/mermaid-js/mermaid/issues/3861)) [@​aloisklink](https://togithub.com/aloisklink) - chore(deps): update all non-major dependencies (minor) ([#​3905](https://togithub.com/mermaid-js/mermaid/issues/3905)) [@​renovate](https://togithub.com/renovate) - chore(deps): update all non-major dependencies (minor) ([#​3791](https://togithub.com/mermaid-js/mermaid/issues/3791)) [@​renovate](https://togithub.com/renovate) - chore(deps): update lycheeverse/lychee-action action to v1.5.4 ([#​3827](https://togithub.com/mermaid-js/mermaid/issues/3827)) [@​renovate](https://togithub.com/renovate) - chore(deps): update pnpm to v7.17.0 ([#​3828](https://togithub.com/mermaid-js/mermaid/issues/3828)) [@​renovate](https://togithub.com/renovate) - chore(deps): update pnpm to v7.17.1 ([#​3862](https://togithub.com/mermaid-js/mermaid/issues/3862)) [@​renovate](https://togithub.com/renovate) - chore(docs): Auto build docs ([#​3547](https://togithub.com/mermaid-js/mermaid/issues/3547)) [@​sidharthv96](https://togithub.com/sidharthv96) - chore: Housekeeping ([#​3783](https://togithub.com/mermaid-js/mermaid/issues/3783)) [@​sidharthv96](https://togithub.com/sidharthv96) - chore: Merge master to develop ([#​3780](https://togithub.com/mermaid-js/mermaid/issues/3780)) [@​sidharthv96](https://togithub.com/sidharthv96) - chore: clean up code in mermaidAPI render() and write specs/tests ([#​3684](https://togithub.com/mermaid-js/mermaid/issues/3684)) [@​weedySeaDragon](https://togithub.com/weedySeaDragon) - chore: delete functions not used in diagrams/c4 code (dead code) ([#​3871](https://togithub.com/mermaid-js/mermaid/issues/3871)) [@​weedySeaDragon](https://togithub.com/weedySeaDragon) - comments in states are skipped now ([#​3762](https://togithub.com/mermaid-js/mermaid/issues/3762)) [@​avijit1258](https://togithub.com/avijit1258) - doc: remove links from atom.io; add note Atom has been archived ([#​3899](https://togithub.com/mermaid-js/mermaid/issues/3899)) [@​weedySeaDragon](https://togithub.com/weedySeaDragon) - docs: refactor Theming doc ([#​3889](https://togithub.com/mermaid-js/mermaid/issues/3889)) [@​huynhicode](https://togithub.com/huynhicode) - feat: Redirect old documentation links. ([#​3797](https://togithub.com/mermaid-js/mermaid/issues/3797)) [@​sidharthv96](https://togithub.com/sidharthv96) - feat: Title support via front matter for ER, state, class, git, and graph diagrams ([#​3706](https://togithub.com/mermaid-js/mermaid/issues/3706)) [@​MasonM](https://togithub.com/MasonM) - fix(deps): update all non-major dependencies (patch) ([#​3790](https://togithub.com/mermaid-js/mermaid/issues/3790)) [@​renovate](https://togithub.com/renovate) - fix(deps): update dependency rollup to v3 ([#​3674](https://togithub.com/mermaid-js/mermaid/issues/3674)) [@​renovate](https://togithub.com/renovate) - fix: LintStaged ([#​3844](https://togithub.com/mermaid-js/mermaid/issues/3844)) [@​sidharthv96](https://togithub.com/sidharthv96) 🎉 **Thanks to all contributors helping with this release!** 🎉 #### What's Changed - chore(deps): update actions/checkout action to v3 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3645](https://togithub.com/mermaid-js/mermaid/pull/3645) - chore(deps): update actions/setup-node action to v3 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3646](https://togithub.com/mermaid-js/mermaid/pull/3646) - Remove inconsistent and deprecated semicolons by [@​revolter](https://togithub.com/revolter) in [https://github.com/mermaid-js/mermaid/pull/3657](https://togithub.com/mermaid-js/mermaid/pull/3657) - Fix windows paths for `docs:build` by [@​arpansaha13](https://togithub.com/arpansaha13) in [https://github.com/mermaid-js/mermaid/pull/3605](https://togithub.com/mermaid-js/mermaid/pull/3605) - feat: make `parseError` function more type-safe by [@​Some-Dood](https://togithub.com/Some-Dood) in [https://github.com/mermaid-js/mermaid/pull/3643](https://togithub.com/mermaid-js/mermaid/pull/3643) - chore(deps): update all non-major dependencies (minor) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3632](https://togithub.com/mermaid-js/mermaid/pull/3632) - chore(deps): update all non-major dependencies (patch) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3671](https://togithub.com/mermaid-js/mermaid/pull/3671) - chore(deps): pin dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3685](https://togithub.com/mermaid-js/mermaid/pull/3685) - Added Open Graph meta tags by [@​danangtomo](https://togithub.com/danangtomo) in [https://github.com/mermaid-js/mermaid/pull/3679](https://togithub.com/mermaid-js/mermaid/pull/3679) - add eslint-plugin-no-only-tests plugin by [@​DKurilo](https://togithub.com/DKurilo) in [https://github.com/mermaid-js/mermaid/pull/3690](https://togithub.com/mermaid-js/mermaid/pull/3690) - Added and configured cspell plugin to eslint by [@​devcer](https://togithub.com/devcer) in [https://github.com/mermaid-js/mermaid/pull/3604](https://togithub.com/mermaid-js/mermaid/pull/3604) - fix: gantt demo diagrams ([#​3655](https://togithub.com/mermaid-js/mermaid/issues/3655)) by [@​isinek](https://togithub.com/isinek) in [https://github.com/mermaid-js/mermaid/pull/3688](https://togithub.com/mermaid-js/mermaid/pull/3688) - Chore/3697 eslint curly by [@​jeroenekkelkamp](https://togithub.com/jeroenekkelkamp) in [https://github.com/mermaid-js/mermaid/pull/3698](https://togithub.com/mermaid-js/mermaid/pull/3698) - Update sequenceDiagram.md by [@​imgss](https://togithub.com/imgss) in [https://github.com/mermaid-js/mermaid/pull/3707](https://togithub.com/mermaid-js/mermaid/pull/3707) - Use `eslint-plugin-tsdoc` for TypeScript files instead of `eslint-plugin-jsdoc` by [@​aloisklink](https://togithub.com/aloisklink) in [https://github.com/mermaid-js/mermaid/pull/3708](https://togithub.com/mermaid-js/mermaid/pull/3708) - chore(deps): pin dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3713](https://togithub.com/mermaid-js/mermaid/pull/3713) - chore(deps): update all non-major dependencies (patch) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3714](https://togithub.com/mermaid-js/mermaid/pull/3714) - Order pie chart slices clockwise by order of entries by [@​jasmaa](https://togithub.com/jasmaa) in [https://github.com/mermaid-js/mermaid/pull/3609](https://togithub.com/mermaid-js/mermaid/pull/3609) - fix: border attribute does not work in a certain writing style by [@​maiermic](https://togithub.com/maiermic) in [https://github.com/mermaid-js/mermaid/pull/3636](https://togithub.com/mermaid-js/mermaid/pull/3636) - add the way to add notes to class diagram by [@​DKurilo](https://togithub.com/DKurilo) in [https://github.com/mermaid-js/mermaid/pull/3647](https://togithub.com/mermaid-js/mermaid/pull/3647) - add statement aliases for ER diagram by [@​DKurilo](https://togithub.com/DKurilo) in [https://github.com/mermaid-js/mermaid/pull/3649](https://togithub.com/mermaid-js/mermaid/pull/3649) - fix: Fix useMaxWidth option for git graph by [@​uttk](https://togithub.com/uttk) in [https://github.com/mermaid-js/mermaid/pull/3652](https://togithub.com/mermaid-js/mermaid/pull/3652) - [#​3659](https://togithub.com/mermaid-js/mermaid/issues/3659) Adding height when not using maxWidth by [@​knsv](https://togithub.com/knsv) in [https://github.com/mermaid-js/mermaid/pull/3668](https://togithub.com/mermaid-js/mermaid/pull/3668) - Change fill attribute to style by [@​CalebUsadi](https://togithub.com/CalebUsadi) in [https://github.com/mermaid-js/mermaid/pull/3719](https://togithub.com/mermaid-js/mermaid/pull/3719) - feat: \[State diagram] Add classDefs and classes to states by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3644](https://togithub.com/mermaid-js/mermaid/pull/3644) - Fill inheritance arrow with background color by [@​vallsv](https://togithub.com/vallsv) in [https://github.com/mermaid-js/mermaid/pull/3543](https://togithub.com/mermaid-js/mermaid/pull/3543) - Ensure example code and rendered output are synced by [@​marcjansen](https://togithub.com/marcjansen) in [https://github.com/mermaid-js/mermaid/pull/3721](https://togithub.com/mermaid-js/mermaid/pull/3721) - fix(git): Support quoted branch names by [@​gibson042](https://togithub.com/gibson042) in [https://github.com/mermaid-js/mermaid/pull/3726](https://togithub.com/mermaid-js/mermaid/pull/3726) - docs: Add link to docs source by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3612](https://togithub.com/mermaid-js/mermaid/pull/3612) - chore(deps): update all non-major dependencies (patch) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3736](https://togithub.com/mermaid-js/mermaid/pull/3736) - chore(deps): update all non-major dependencies (minor) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3737](https://togithub.com/mermaid-js/mermaid/pull/3737) - feat(gantt): Add option 'tickInterval' for custom tick interval by [@​DarkNami](https://togithub.com/DarkNami) in [https://github.com/mermaid-js/mermaid/pull/3729](https://togithub.com/mermaid-js/mermaid/pull/3729) - Fix/convert attr to style in er graph by [@​CalebUsadi](https://togithub.com/CalebUsadi) in [https://github.com/mermaid-js/mermaid/pull/3722](https://togithub.com/mermaid-js/mermaid/pull/3722) - update user story link for [#​3740](https://togithub.com/mermaid-js/mermaid/issues/3740) by [@​6footGeek](https://togithub.com/6footGeek) in [https://github.com/mermaid-js/mermaid/pull/3741](https://togithub.com/mermaid-js/mermaid/pull/3741) - Improved New Documentation by [@​emersonbottero](https://togithub.com/emersonbottero) in [https://github.com/mermaid-js/mermaid/pull/3678](https://togithub.com/mermaid-js/mermaid/pull/3678) - chore: fix cSpell word entry misspelling "mermiad" -> "mermaid" by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3751](https://togithub.com/mermaid-js/mermaid/pull/3751) - Fix link to CSS classes by [@​hugovk](https://togithub.com/hugovk) in [https://github.com/mermaid-js/mermaid/pull/3752](https://togithub.com/mermaid-js/mermaid/pull/3752) - docs: Update references to default config in directives page by [@​raptor0929](https://togithub.com/raptor0929) in [https://github.com/mermaid-js/mermaid/pull/3738](https://togithub.com/mermaid-js/mermaid/pull/3738) - Fix link relative links to documentation files by [@​spier](https://togithub.com/spier) in [https://github.com/mermaid-js/mermaid/pull/3760](https://togithub.com/mermaid-js/mermaid/pull/3760) - chore(deps): update all non-major dependencies (patch) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3769](https://togithub.com/mermaid-js/mermaid/pull/3769) - chore(deps): update all non-major dependencies (minor) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3770](https://togithub.com/mermaid-js/mermaid/pull/3770) - Fix CSpell by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3753](https://togithub.com/mermaid-js/mermaid/pull/3753) - Live edits for Docs by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3755](https://togithub.com/mermaid-js/mermaid/pull/3755) - Switch CDN to unpkg.com by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3777](https://togithub.com/mermaid-js/mermaid/pull/3777) - chore: Housekeeping by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3783](https://togithub.com/mermaid-js/mermaid/pull/3783) - Pnpm issue reproduction by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3784](https://togithub.com/mermaid-js/mermaid/pull/3784) - fix(deps): update all non-major dependencies (patch) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3790](https://togithub.com/mermaid-js/mermaid/pull/3790) - chore: clean up code in mermaidAPI render() and write specs/tests by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3684](https://togithub.com/mermaid-js/mermaid/pull/3684) - chore(deps): update all non-major dependencies (minor) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3791](https://togithub.com/mermaid-js/mermaid/pull/3791) - fix(deps): update dependency rollup to v3 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3674](https://togithub.com/mermaid-js/mermaid/pull/3674) - Add GHA that will check links + Fix broken links by [@​spier](https://togithub.com/spier) in [https://github.com/mermaid-js/mermaid/pull/3765](https://togithub.com/mermaid-js/mermaid/pull/3765) - chore: Merge master to develop by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3780](https://togithub.com/mermaid-js/mermaid/pull/3780) - bug: change shiki getHighlighter import by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3804](https://togithub.com/mermaid-js/mermaid/pull/3804) - Fix [#​3799](https://togithub.com/mermaid-js/mermaid/issues/3799): Remove `type` from package.json by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3802](https://togithub.com/mermaid-js/mermaid/pull/3802) - CI: disable pinning dependencies by [@​aloisklink](https://togithub.com/aloisklink) in [https://github.com/mermaid-js/mermaid/pull/3735](https://togithub.com/mermaid-js/mermaid/pull/3735) - bug: State diagram fix classes type by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3798](https://togithub.com/mermaid-js/mermaid/pull/3798) - Remove extra arrow and adjust cross position by [@​ishuen](https://togithub.com/ishuen) in [https://github.com/mermaid-js/mermaid/pull/3641](https://togithub.com/mermaid-js/mermaid/pull/3641) - comments in states are skipped now by [@​avijit1258](https://togithub.com/avijit1258) in [https://github.com/mermaid-js/mermaid/pull/3762](https://togithub.com/mermaid-js/mermaid/pull/3762) - feat: Redirect old documentation links. by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3797](https://togithub.com/mermaid-js/mermaid/pull/3797) - Mindmap integration docs by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3810](https://togithub.com/mermaid-js/mermaid/pull/3810) - Use `github-dark` to highlight fence blocks in vitepress docs by [@​aloisklink](https://togithub.com/aloisklink) in [https://github.com/mermaid-js/mermaid/pull/3807](https://togithub.com/mermaid-js/mermaid/pull/3807) - chore(deps): update lycheeverse/lychee-action action to v1.5.4 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3827](https://togithub.com/mermaid-js/mermaid/pull/3827) - chore(deps): update pnpm to v7.17.0 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3828](https://togithub.com/mermaid-js/mermaid/pull/3828) - feat: Title support via front matter for ER, state, class, git, and graph diagrams by [@​MasonM](https://togithub.com/MasonM) in [https://github.com/mermaid-js/mermaid/pull/3706](https://togithub.com/mermaid-js/mermaid/pull/3706) - Replace `dagre`/`dagre-d3` with `dagre-d3-es` by [@​aloisklink](https://togithub.com/aloisklink) in [https://github.com/mermaid-js/mermaid/pull/3809](https://togithub.com/mermaid-js/mermaid/pull/3809) - Add package visualizations by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3823](https://togithub.com/mermaid-js/mermaid/pull/3823) - [#​3882](https://togithub.com/mermaid-js/mermaid/issues/3882) fix for issues with mindmaps with only a single node by [@​knsv](https://togithub.com/knsv) in [https://github.com/mermaid-js/mermaid/pull/3833](https://togithub.com/mermaid-js/mermaid/pull/3833) - [#​3778](https://togithub.com/mermaid-js/mermaid/issues/3778) Adding a hexgon shape by [@​knsv](https://togithub.com/knsv) in [https://github.com/mermaid-js/mermaid/pull/3834](https://togithub.com/mermaid-js/mermaid/pull/3834) - Fix for [#​3835](https://togithub.com/mermaid-js/mermaid/issues/3835), makes it possible to style path elements by [@​knsv](https://togithub.com/knsv) in [https://github.com/mermaid-js/mermaid/pull/3836](https://togithub.com/mermaid-js/mermaid/pull/3836) - [#​3831](https://togithub.com/mermaid-js/mermaid/issues/3831) Re-enabling themes for er diagrams by [@​knsv](https://togithub.com/knsv) in [https://github.com/mermaid-js/mermaid/pull/3837](https://togithub.com/mermaid-js/mermaid/pull/3837) - (chore) remove console stmt in pieDetector by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3840](https://togithub.com/mermaid-js/mermaid/pull/3840) - Revert "Added pie" by [@​pbrolin47](https://togithub.com/pbrolin47) in [https://github.com/mermaid-js/mermaid/pull/3842](https://togithub.com/mermaid-js/mermaid/pull/3842) - Fix typos by [@​endolith](https://togithub.com/endolith) in [https://github.com/mermaid-js/mermaid/pull/3820](https://togithub.com/mermaid-js/mermaid/pull/3820) - (feat) state classDef documentation by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3841](https://togithub.com/mermaid-js/mermaid/pull/3841) - Integrations added - Visual Studio Code \[Polyglot Interactive Notebooks] by [@​dfinke](https://togithub.com/dfinke) in [https://github.com/mermaid-js/mermaid/pull/3821](https://togithub.com/mermaid-js/mermaid/pull/3821) - Reduce mermaid size by 31% by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3825](https://togithub.com/mermaid-js/mermaid/pull/3825) - fix: LintStaged by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3844](https://togithub.com/mermaid-js/mermaid/pull/3844) - Add official vim plugin to list in integrations by [@​craigmac](https://togithub.com/craigmac) in [https://github.com/mermaid-js/mermaid/pull/3847](https://togithub.com/mermaid-js/mermaid/pull/3847) - chore(deps): remove dependency on `graphlib` by [@​aloisklink](https://togithub.com/aloisklink) in [https://github.com/mermaid-js/mermaid/pull/3861](https://togithub.com/mermaid-js/mermaid/pull/3861) - chore(deps): update pnpm to v7.17.1 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/3862](https://togithub.com/mermaid-js/mermaid/pull/3862) - Make gitgraph snapshots consistent in E2E tests by [@​aloisklink](https://togithub.com/aloisklink) in [https://github.com/mermaid-js/mermaid/pull/3860](https://togithub.com/mermaid-js/mermaid/pull/3860) - Use stylis to prepend idSelector by [@​DanInProgress](https://togithub.com/DanInProgress) in [https://github.com/mermaid-js/mermaid/pull/3829](https://togithub.com/mermaid-js/mermaid/pull/3829) - Use current mermaid version in docs. by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3846](https://togithub.com/mermaid-js/mermaid/pull/3846) - Add support for [@​include](https://togithub.com/include) in docs by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3863](https://togithub.com/mermaid-js/mermaid/pull/3863) - Housekeeping with eslint-unicorn by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3845](https://togithub.com/mermaid-js/mermaid/pull/3845) - chore: delete functions not used in diagrams/c4 code (dead code) by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3871](https://togithub.com/mermaid-js/mermaid/pull/3871) - Switch back to jsdelivr by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3873](https://togithub.com/mermaid-js/mermaid/pull/3873) - 3882 edge labels by [@​knsv](https://togithub.com/knsv) in [https://github.com/mermaid-js/mermaid/pull/3883](https://togithub.com/mermaid-js/mermaid/pull/3883) - Small fix for issue [#​3881](https://togithub.com/mermaid-js/mermaid/issues/3881) by [@​knsv](https://togithub.com/knsv) in [https://github.com/mermaid-js/mermaid/pull/3884](https://togithub.com/mermaid-js/mermaid/pull/3884) - Defects/issue 3878 by [@​MrCoder](https://togithub.com/MrCoder) in [https://github.com/mermaid-js/mermaid/pull/3880](https://togithub.com/mermaid-js/mermaid/pull/3880) - chore(docs): Auto build docs by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3547](https://togithub.com/mermaid-js/mermaid/pull/3547) - docs: refactor Theming doc by [@​huynhicode](https://togithub.com/huynhicode) in [https://github.com/mermaid-js/mermaid/pull/3889](https://togithub.com/mermaid-js/mermaid/pull/3889) - Feat: Add aria-describedby, aria-roledescription by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3808](https://togithub.com/mermaid-js/mermaid/pull/3808) - Release/9.3.0 by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/3911](https://togithub.com/mermaid-js/mermaid/pull/3911) #### New Contributors - [@​revolter](https://togithub.com/revolter) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3657](https://togithub.com/mermaid-js/mermaid/pull/3657) - [@​Some-Dood](https://togithub.com/Some-Dood) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3643](https://togithub.com/mermaid-js/mermaid/pull/3643) - [@​danangtomo](https://togithub.com/danangtomo) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3679](https://togithub.com/mermaid-js/mermaid/pull/3679) - [@​DKurilo](https://togithub.com/DKurilo) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3690](https://togithub.com/mermaid-js/mermaid/pull/3690) - [@​devcer](https://togithub.com/devcer) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3604](https://togithub.com/mermaid-js/mermaid/pull/3604) - [@​isinek](https://togithub.com/isinek) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3688](https://togithub.com/mermaid-js/mermaid/pull/3688) - [@​jeroenekkelkamp](https://togithub.com/jeroenekkelkamp) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3698](https://togithub.com/mermaid-js/mermaid/pull/3698) - [@​imgss](https://togithub.com/imgss) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3707](https://togithub.com/mermaid-js/mermaid/pull/3707) - [@​jasmaa](https://togithub.com/jasmaa) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3609](https://togithub.com/mermaid-js/mermaid/pull/3609) - [@​uttk](https://togithub.com/uttk) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3652](https://togithub.com/mermaid-js/mermaid/pull/3652) - [@​CalebUsadi](https://togithub.com/CalebUsadi) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3719](https://togithub.com/mermaid-js/mermaid/pull/3719) - [@​marcjansen](https://togithub.com/marcjansen) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3721](https://togithub.com/mermaid-js/mermaid/pull/3721) - [@​DarkNami](https://togithub.com/DarkNami) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3729](https://togithub.com/mermaid-js/mermaid/pull/3729) - [@​6footGeek](https://togithub.com/6footGeek) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3741](https://togithub.com/mermaid-js/mermaid/pull/3741) - [@​hugovk](https://togithub.com/hugovk) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3752](https://togithub.com/mermaid-js/mermaid/pull/3752) - [@​raptor0929](https://togithub.com/raptor0929) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3738](https://togithub.com/mermaid-js/mermaid/pull/3738) - [@​spier](https://togithub.com/spier) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3760](https://togithub.com/mermaid-js/mermaid/pull/3760) - [@​ishuen](https://togithub.com/ishuen) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3641](https://togithub.com/mermaid-js/mermaid/pull/3641) - [@​avijit1258](https://togithub.com/avijit1258) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3762](https://togithub.com/mermaid-js/mermaid/pull/3762) - [@​MasonM](https://togithub.com/MasonM) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3706](https://togithub.com/mermaid-js/mermaid/pull/3706) - [@​endolith](https://togithub.com/endolith) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3820](https://togithub.com/mermaid-js/mermaid/pull/3820) - [@​dfinke](https://togithub.com/dfinke) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3821](https://togithub.com/mermaid-js/mermaid/pull/3821) - [@​craigmac](https://togithub.com/craigmac) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3847](https://togithub.com/mermaid-js/mermaid/pull/3847) - [@​DanInProgress](https://togithub.com/DanInProgress) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3829](https://togithub.com/mermaid-js/mermaid/pull/3829) - [@​MrCoder](https://togithub.com/MrCoder) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3880](https://togithub.com/mermaid-js/mermaid/pull/3880) - [@​huynhicode](https://togithub.com/huynhicode) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/3889](https://togithub.com/mermaid-js/mermaid/pull/3889) **Full Changelog**: mermaid-js/mermaid@v9.2.2...v9.3.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/BirthdayResearch/contented). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC41NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNjIuMSJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
📑 Summary
This adds title support for all diagram types currently lacking support for titles (excluding "info" and "error") using Jekyll-style YAML frontmatter blocks. C4C diagrams, pie charts, gantt charts, requirement diagrams, sequence diagrams, and user journey diagrams already have title support.
Resolves #1433
📏 Design Decisions
mermaid.min.js
by 33KB andmermaid.esm.min.js
by 42KB:titleTopMargin
configuration option for every diagram type for consistency. Making it a global option might make more sense, but that could raise backwards-compatibility concerns (e.g. what if bothgantt.titleTopMargin
and the globaltitleTopMargin
are set).📋 Tasks
Make sure you
develop
branch