-
Notifications
You must be signed in to change notification settings - Fork 216
HTML: add elk layout engine as option for HTML display #2526
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
base: master
Are you sure you want to change the base?
HTML: add elk layout engine as option for HTML display #2526
Conversation
c343e87
to
1a27d12
Compare
Small follow-up from Drop-In. It'd be great to have an example of how you specify this for the sample article, perhaps the one used in the demos above. |
We do have an existing pub var for @theme. I am ready to go with adding @layout-engine for book level config. They both get rendered down (all use cases) toJS - either a JSON file or JS that is written into the HTML output. And there are other options someone might want to play with. So at this point I am wondering do we just provide a way to put JSON in the pub file (publisher/common/mermaid would be an element that has json)? Or to point to a JSON file to use? Feels better than getting into the business of creating markup for every Mermaid option someone might want to specify at the book level. |
It would be easy enough to deprecate the More complex to fix up via writing to an external file, but also doable. |
OK, you've lost me on this one. ;-) I thought this was complete, but then there could be a new And, BTW, the idea of JSON in the publisher file gave me a real shock. |
Force pushed with awful commit so you can see what I was blathering about. In drop in you had started to muse about a book level default for renderer if we already were doing something else in the pub file for mermaid. At the time I said "no, we don't have a pub var" - had forgotten about theme. Rather than create pub attributes on mermaid 1 by 1 (and then try to keep them in sync with anything that happens in mermaid land), I am thinking it would be better to let author's point to some JSON that has the configs they want. Or we call it good enough for now and if there is ever a demand for a third config option we think about refactoring. In which case I can rebase to clean up commits and we should be done. |
Case in point... I am realizing I would love to have "hide empty member boxes in class diagrams" default to on. Hypothetically, someone might want to specify this set of options for the base initialization:
So I am thinking let them put that in a file and have pub var specify name of the file. Instead of creating pub file markup so they can specify every possible option. |
Who is the "someone"? ;-) That sounds to me like something an author would set, like our various Re-theme-ing should be a publisher option. Change the look, not the content. A layout engine does feel like it might be a publisher choice. Maybe an empty box is important, how does the publisher know? Most important branch of my git repo is Let's give the author source/preamble/initialization freedom/setup and let's constrain the publisher to what they can legitimately mess around with. Do layout here as a publisher option? New PR for a |
Publisher for layout engine & theme makes sense. Which is what we have right now. I'll clean it up and force push. Mermaid preamble for author stuff will go on the "someday" list. |
7917524
to
656e5ba
Compare
656e5ba
to
b868048
Compare
Just tested in HTML and PDF. Looks good. |
The elk layout engine does a better job with complex diagrams. See examples below.
This is already available in the CLI mermaid used for generating static images from diagrams.
Compare elk:
https://mermaid.live/edit#pako:eNqFlMuOgyAUhl_FnLU2tl4h3Uw6m1k0bTK7iRuiVE0VGsRkOp2--3ih0xqIuhL4OB_nT-AGKc8oYHAcJ2EpZ6cyxwmzrIpceSuxRatzwsbFijTNe0lyQeqeeHwHkVGxp7LgmbX9dRzrWHBGZ4kDq8oF5IN9Si4mzJFca8rkK7UjTbGAvKUpb5lcKiRoVk6hvounRWvqZV0p5pCxvp7MEMTTYgjmhVCeeWg06YwK9OkyJDxhlG0JG30GqnfM5KfKzyc4Fp-NcKrR-zZ5dEoXGZiJydCxSWUKRnMpCGzIRZkBlqKlNtRU1KQfwq3fnoAsaE0TwN1vRsQ5gYTduz0Xwr44rx_bBG_zAvCJVE03ai8ZkVRd2_9ZQVl333b9AQGv_aEG4Bt8A_bCaOWFLop85EXB2kc2XAEjb7VGcRDFgev5KI42dxt-Bqm7ClE3GXgodt3Q99DGhr4nLvbjyzI8MPc_E-NL6g
To standard:
https://mermaid.live/edit#pako:eNqFlMtugzAQRX8lmjWJbB7hoW6qdNNFlEjdVWws7ATUYEfGSE3T_HsNuEmQLWCFzZk5zJXsKxSCMsgg58WJNM1bRY6S1Dlf3J-dpExumSoFXbz8LpeLfSk4myR2_FTNIO_8Qwk5YvbkUjOunqkNacoZ5LUoRMvVXCPJaDWGuikeFmuop-9GMYUM_e1k-iAeFkcwT4TxTEODyWZMoA-XI-ERY2xz2OBzUJ1jIj_TfjrBoflkhGONPbfLY1O2yMGMTI6JXSpXMJbLQODBUVYUMiVb5kHNZE26JVy78hxUyWqWQ6ZfKZFfuT6UN11zJvxTiPq_TIr2WEJ2IKdGr9ozJYqZY3vflYzr87bpfhAyHCR9E8iu8K2XYbSKg3WIEpQmCKEw8uCitxFaxesIJ2GE8RonKLh58NN70SqKfT-N0xQFvo9x4EE3lZDb4e7or5DbH5H9QYU