mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
68.69k stars 6.07k forks source link

Auto-document parameters available for all diagrams. #5542

Open RokeJulianLockhart opened 1 month ago

RokeJulianLockhart commented 1 month ago

Proposal and Example

As https://github.com/orgs/mermaid-js/discussions/5135#discussion-5951285 states:

Initially I was going to post "Document ability for ER diagram to use layoutDirection" but it seems like this is a more general need across the package.

ER diagrams of a hierarchical system can get very very tall. Sometimes that doesn't fit with inline examples, eg. between paragraphs where you might want to layout a few entities horizontally to show their relationship.

The ER plot has a pretty well documented config object here, where layoutDirection is supported:

https://github.com/mermaid-js/mermaid/blob/d8e26dcb17fc31e7d901c95920d003578026466d/packages/mermaid/src/config.type.ts#L915

but that's not shown anywhere in the docs. Instead only the fill and stroke fields are documented. I don't have time at the moment to look through how the documentation is generated, but it seems like it should be straightforward to autogenerate a table from the config object itself so the docs don't go out of sync with the library.

Screenshots

No response

nirname commented 1 week ago

It is there https://mermaid.js.org/config/schema-docs/config.html, but obviously people cannot find it, because it is at a separate page image

So my point that this documentation must be either referenced from diagram specific pages or referenced & embedded simultaneously. But there are some global options that are not diagram-related, so we need to keep this page.