diff --git a/README.md b/README.md index 13aed84..f6ef65d 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,14 @@ To generate: ## Options -| Name | Default | Description | -| --- | --- | --- | -| `language` | `"mermaid"` | Set this value to the identifier which will replace the code block. If you set it to `"graph"` then you can create graphs using ` ```graph ...`. | -| `theme` | `"default"` | Set this value to one of `"dark"`, `"neutral"`, `"forrest"`, or `"default"`. You can preview the themes in the [Live Editor](https://mermaidjs.github.io/mermaid-live-editor) | -| `viewport.width` | `200` | Set this value to the desired viewport width while rendering the svg | -| `viewport.height` | `200` | Set this value to the desired viewport height while rendering the svg | -| `mermaidOptions` | `{}` | This object specifies the [configuration options](https://mermaidjs.github.io/#/mermaidAPI) passed to `mermaid.initialize()` | +| Name | Default | Description | +| --- | --- | --- | +| `language` | `"mermaid"` | Set this value to the identifier which will replace the code block. If you set it to `"graph"` then you can create graphs using ` ```graph ...`. | +| `theme` | `"default"` | Set this value to one of `"dark"`, `"neutral"`, `"forrest"`, or `"default"`. You can preview the themes in the [Live Editor](https://mermaidjs.github.io/mermaid-live-editor) | +| `viewport.width` | `200` | Set this value to the desired viewport width while rendering the svg | +| `viewport.height` | `200` | Set this value to the desired viewport height while rendering the svg | +| `mermaidOptions` | `{}` | This object specifies the [configuration options](https://mermaidjs.github.io/#/mermaidAPI) passed to `mermaid.initialize()` | +| `puppeteerOptions` | `{args:['--no-sandbox', '--disable-setuid-sandbox']}` | Set this to override the default options passed to [`puppeteer.launch`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions). | ### Defaults diff --git a/index.js b/index.js index b86b066..e0f8582 100644 --- a/index.js +++ b/index.js @@ -40,7 +40,8 @@ module.exports = async ({markdownAST}, language = 'mermaid', theme = 'default', viewport = {height: 200, width: 200}, - mermaidOptions = {} + mermaidOptions = {}, + puppeteerOptions = {args:['--no-sandbox', '--disable-setuid-sandbox']} }) => { // Check if there is a match before launching anything @@ -51,7 +52,7 @@ module.exports = async ({markdownAST}, } // Launch virtual browser - const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']}); + const browser = await puppeteer.launch(puppeteerOptions); await Promise.all(nodes.map(async node => { node.type = 'html'; diff --git a/package.json b/package.json index 0a5913d..ad2bbaa 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,10 @@ "type": "git", "url": "git+https://github.com/ChappIO/gatsby-remark-mermaid.git" }, + "files": [ + "index.js", + "render.html" + ], "keywords": [ "gatsby", "gatsby-plugin",