Skip to content

Commit 7489100

Browse files
garf1242raghur
andauthored
Add scale factor option (#72)
mermaid-cli includes a scale factor (`-s`) option. Allow to configure it with `scale` option or `MERMAID_FILTER_SCALE` environment variable. Co-authored-by: Raghu <[email protected]>
1 parent 035cb39 commit 7489100

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function mermaid(type, value, format, meta) {
3333
background: process.env.MERMAID_FILTER_BACKROUND || 'white',
3434
caption: process.env.MERMAID_FILTER_CAPTION || '',
3535
filename: process.env.MERMAID_FILTER_FILENAME || '',
36+
scale: process.env.MERMAID_FILTER_SCALE || 1,
3637
imageClass: process.env.MERMAID_FILTER_IMAGE_CLASS || ''
3738
};
3839
var configFile = path.join(folder, ".mermaid-config.json")
@@ -78,7 +79,7 @@ function mermaid(type, value, format, meta) {
7879

7980
var savePath = tmpfileObj.name + "." + options.format
8081
var newPath = path.join(outdir, `${options.filename}.${options.format}`);
81-
var fullCmd = `${cmd} ${confFileOpts} ${puppeteerOpts} -w ${options.width} -f -i ${tmpfileObj.name} -t ${options.theme} -b ${options.background} -o ${savePath}`
82+
var fullCmd = `${cmd} ${confFileOpts} ${puppeteerOpts} -w ${options.width} -s ${options.scale} -f -i ${tmpfileObj.name} -t ${options.theme} -b ${options.background} -o ${savePath}`
8283
// console.log(fullCmd, savePath)
8384
exec(fullCmd);
8485
//console.log(oldPath, newPath);

0 commit comments

Comments
 (0)