mermaid-js / mermaid-cli

Command line tool for the Mermaid library
MIT License
2.52k stars 238 forks source link

Option to only page-break across lines (and not text) -- and to label page edges so it's easy to line them up? #744

Open philCryoport opened 2 months ago

philCryoport commented 2 months ago

Is your feature request related to a problem? Please describe. Default behavior with no options other than input and output with long & skinny flowcharts leads to page-breaks across shapes and text.

The pdfFit option makes for easy on-screen viewing of those really long & skinny flowcharts. However, if I hand this to somebody not-very-techie, and if they try to print it, it'll come out really tiny.

If I walk them through scaling it across multiple pages...then their PDF viewer will decide where it wants to insert page-breaks...most likely across shapes and text...so not winning the war here...

Describe the solution you'd like

  1. Option to have mermaid-cli arrange the diagram so that page-breaks will be opportune -- that is, only across lines -- specifically line sections that do not have text right there (bump it to the side of a page-break)
  2. Option when doing these special page-breaks to put identifiers for each page-break on both sides of each page-break -- so that one can go "oh ok this is page-break 'A'...lemme find the other page-break 'A' on another page...ah so the diagram is going from this page to that page". Hopefully that makes sense...

Describe alternatives you've considered ¯_(ツ)_/¯

Additional context ¯_(ツ)_/¯