Skip to content
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

Text is cut-off in labels workaround for use with this pandoc-filter #8

Open
ghost opened this issue Sep 11, 2019 · 2 comments
Open

Comments

@ghost
Copy link

ghost commented Sep 11, 2019

This is not really an issue, but a workaround I would like to share with other users.

This issue has a proposed workaround which requires that I pass the -c option with a config file to mermaid.
In this pandoc filter I did not find a way to pass this option (correct me if I'm wrong), so I found a workaround.

I added the -c option in the mmdc.cmd file directly to pass the CSS:

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\..\mermaid.cli\index.bundle.js" %* "-c" "c:\Users\username\node_modules\mermaid.cli\mermaid-config.json"
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node  "%~dp0\..\mermaid.cli\index.bundle.js" %* "-c" "c:\Users\username\node_modules\mermaid.cli\mermaid-config.json"
)

Where mermaid-config.json looks like:

{
    "themeCSS": ".label foreignObject { font-size: 14px; }"
}

Now the charts rendered by this filter show the labels correctly again.

@timofurrer
Copy link
Owner

Thanks! Should we maybe add an env variable for options or something like that?

@ghost
Copy link
Author

ghost commented Sep 11, 2019

Thanks! Should we maybe add an env variable for options or something like that?

That would be great of course, e.g. a MERMAID_CFG similar to the PUPPETEER_CFG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant