timofurrer / pandoc-mermaid-filter

Pandoc filter for mermaid code blocks
MIT License
75 stars 21 forks source link

How to append pupeteer config option? #2

Closed RidaAyed closed 6 years ago

RidaAyed commented 6 years ago

Hi

@timofurrer how can I add the -p puppeteer-config.json as outlined in https://github.com/mermaidjs/mermaid.cli

Using this option I can get rid of the sandbox issue. E.g. This works:

mmdc -p puppeteer-config.json -i flowchart.mmd -o output.svg

barskern commented 6 years ago

Hi,

I managed to append a custom puppeteer config by changing the following this line to include -p /absolute/path/to/puppeteer-config.json.

The line should then look like this:

subprocess.check_call([MERMAID_BIN, "-p", "/absolute/path/to/puppeteer-config.json`", "-i", src, "-o", dest])

In the puppeteer-config file I have:

{
  "args": ["--no-sandbox"]
}

This is a clumsy but simple solution. I was thinking about sending a PR so that this could be set through an environment variable. It should only be a few lines of code.

barskern commented 6 years ago

Created a pull request now @RidaAyed, see #4.