{"_id":"@akashacms/diagrams-maker","_rev":"7-586138ecf9f903b6e889cd709bff0949","name":"@akashacms/diagrams-maker","dist-tags":{"latest":"0.9.6"},"versions":{"0.9.0":{"name":"@akashacms/diagrams-maker","version":"0.9.0","keywords":["PlantUML","Markdown","Static Content Management System","AkashaCMS"],"author":{"name":"David Herron","email":"david@davidherron.com"},"license":"ISC","_id":"@akashacms/diagrams-maker@0.9.0","maintainers":[{"name":"reikiman","email":"david@davidherron.com"}],"homepage":"https://github.com/akashacms/plugins-diagrams#readme","bugs":{"url":"https://github.com/akashacms/plugins-diagrams/issues"},"bin":{"diagrams-maker":"dist/cli.js"},"dist":{"shasum":"c016c13428ae22fd7b5260588e2fd6c36404da90","tarball":"https://registry.npmjs.org/@akashacms/diagrams-maker/-/diagrams-maker-0.9.0.tgz","fileCount":11,"integrity":"sha512-FNFlKXIkvltXxuEqmRD/CK5eeNYbJHwODuVd6+AIegt/0MblaQGLHQ08jCFTv/gKqjDGXj6TksTzL6BTZltaRw==","signatures":[{"sig":"MEYCIQCp+eMmSnLd59cqgAeHRZTMKXISvyE97mtTeEw7ZrdjRAIhAKYyu0kP7jjF/lpqJ4GIvyZNfM6apmZY7TxrdUF5nXCh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11891715},"main":"dist/index.js","type":"module","types":"dist/index.js","gitHead":"662026f809bf93b3c3ff6f6d51f2b4d8a209e6c4","scripts":{"build":"npx tsc","watch":"npx tsc -w","dopublish":"npm publish --access public"},"_npmUser":{"name":"reikiman","email":"david@davidherron.com"},"repository":{"url":"git+https://github.com/akashacms/plugins-diagrams.git","type":"git"},"_npmVersion":"10.9.2","description":"Process PlantUML diagrams into SVG, PNG, as well as AkashaCMS integration","directories":{},"_nodeVersion":"23.6.0","dependencies":{"commander":"^13.0.0","html-entities":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.10.7"},"peerDependencies":{"akasharender":"^0.9.1"},"_npmOperationalInternal":{"tmp":"tmp/diagrams-maker_0.9.0_1737641757265_0.7373659262377881","host":"s3://npm-registry-packages-npm-production"}},"0.9.1":{"name":"@akashacms/diagrams-maker","version":"0.9.1","keywords":["PlantUML","Markdown","Static Content Management System","AkashaCMS"],"author":{"name":"David Herron","email":"david@davidherron.com"},"license":"ISC","_id":"@akashacms/diagrams-maker@0.9.1","maintainers":[{"name":"reikiman","email":"david@davidherron.com"}],"homepage":"https://github.com/akashacms/plugins-diagrams#readme","bugs":{"url":"https://github.com/akashacms/plugins-diagrams/issues"},"bin":{"diagrams-maker":"dist/cli.js"},"dist":{"shasum":"7d09e8760f55223398ef7e05ae05217bff5202c2","tarball":"https://registry.npmjs.org/@akashacms/diagrams-maker/-/diagrams-maker-0.9.1.tgz","fileCount":13,"integrity":"sha512-gRKu8/skW0f3Anq4Wq3HhvKB951fKSi0qgpBD7M0xfiO9XrHuXacWQNgwPk8t2GjbmWfl9oGGE7kvnBoWxKL4w==","signatures":[{"sig":"MEUCIQDiaTY/aeF30mFGkZecoH7hi9zA/18XPf7LOTFaxT65qgIgKuY9RBLuyGy0Nwdsb16bl72gOZB9juxNTdDk0MBbGKw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11937517},"main":"dist/index.js","type":"module","types":"dist/index.js","gitHead":"8ed8414bbc0ac7c30d0c29b813bf6681e15f3cc7","scripts":{"build":"npx tsc","watch":"npx tsc -w","dopublish":"npm publish --access public"},"_npmUser":{"name":"reikiman","email":"david@davidherron.com"},"repository":{"url":"git+https://github.com/akashacms/plugins-diagrams.git","type":"git"},"_npmVersion":"10.8.2","description":"Process PlantUML diagrams into SVG, PNG, as well as AkashaCMS integration","directories":{},"_nodeVersion":"20.18.2","dependencies":{"commander":"^13.0.0","@pintora/cli":"^0.7.6","html-entities":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.10.7"},"peerDependencies":{"akasharender":"^0.9.1"},"_npmOperationalInternal":{"tmp":"tmp/diagrams-maker_0.9.1_1741473828932_0.2011780187914154","host":"s3://npm-registry-packages-npm-production"}},"0.9.2":{"name":"@akashacms/diagrams-maker","version":"0.9.2","keywords":["PlantUML","Markdown","Static Content Management System","AkashaCMS"],"author":{"name":"David Herron","email":"david@davidherron.com"},"license":"ISC","_id":"@akashacms/diagrams-maker@0.9.2","maintainers":[{"name":"reikiman","email":"david@davidherron.com"}],"homepage":"https://github.com/akashacms/plugins-diagrams#readme","bugs":{"url":"https://github.com/akashacms/plugins-diagrams/issues"},"bin":{"diagrams-maker":"dist/cli.js"},"dist":{"shasum":"9cb3fafe7910c1a090da4361acfa02bd8b2464cc","tarball":"https://registry.npmjs.org/@akashacms/diagrams-maker/-/diagrams-maker-0.9.2.tgz","fileCount":13,"integrity":"sha512-8x1pbrbatIR3gTmY1/kCk8g3Mqbx7YWHVTYicmnsReMxPxM509dQeI4lEqdtsdFAJwLNEyIsCbRoUU2ibvlmbg==","signatures":[{"sig":"MEYCIQDxUA8aoeK+/yTHEDNroZXw43onzpnynR/IY1sSX1rUuQIhAPkBa7ABsr5i7iqmKTxEZCpZz1tkAPkJZgK2/R3/hlu2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11937436},"main":"dist/index.js","type":"module","types":"dist/index.js","gitHead":"71fdc83be32ee341d68129cc4d330e5d65c5f38b","scripts":{"build":"npx tsc","watch":"npx tsc -w","dopublish":"npm publish --access public"},"_npmUser":{"name":"reikiman","actor":{"name":"reikiman","type":"user","email":"david@davidherron.com"},"email":"david@davidherron.com"},"repository":{"url":"git+https://github.com/akashacms/plugins-diagrams.git","type":"git"},"_npmVersion":"11.4.2","description":"Process PlantUML diagrams into SVG, PNG, as well as AkashaCMS integration","directories":{},"_nodeVersion":"24.3.0","dependencies":{"commander":"^14.0.0","@pintora/cli":"^0.8.x","html-entities":"^2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.10.7"},"peerDependencies":{"akasharender":"^0.9.x"},"_npmOperationalInternal":{"tmp":"tmp/diagrams-maker_0.9.2_1751101933145_0.5438329821970447","host":"s3://npm-registry-packages-npm-production"}},"0.9.3":{"name":"@akashacms/diagrams-maker","version":"0.9.3","keywords":["PlantUML","Markdown","Static Content Management System","AkashaCMS"],"author":{"name":"David Herron","email":"david@davidherron.com"},"license":"ISC","_id":"@akashacms/diagrams-maker@0.9.3","maintainers":[{"name":"reikiman","email":"david@davidherron.com"}],"homepage":"https://github.com/akashacms/plugins-diagrams#readme","bugs":{"url":"https://github.com/akashacms/plugins-diagrams/issues"},"bin":{"diagrams-maker":"dist/cli.js"},"dist":{"shasum":"7eaa4b158ed6e3c2780a46c86a333b25926a44c2","tarball":"https://registry.npmjs.org/@akashacms/diagrams-maker/-/diagrams-maker-0.9.3.tgz","fileCount":19,"integrity":"sha512-T3Pmto7UDIC96LpGhCF8iaMQt59ZGDwlbm5r2FkYJFbQfdkVJ2Q0Gv36kS+FHJa45bY/m/ekQ8E2mKmGXreN2A==","signatures":[{"sig":"MEUCIGxvcpHjfPrHbHrgBEw7A8bmzSkMApSa3g+JDmMZ3sBDAiEAm5vXn3sK8Cl2gWLxO3tPCM9MHPq72lRiIkgoFWKsvek=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11973207},"main":"dist/index.js","type":"module","types":"dist/index.js","gitHead":"468dba9e3c5f61727e30ba828e3b3da538bc8723","scripts":{"build":"npx tsc","watch":"npx tsc -w","dopublish":"npm publish --access public"},"_npmUser":{"name":"reikiman","actor":{"name":"reikiman","type":"user","email":"david@davidherron.com"},"email":"david@davidherron.com"},"repository":{"url":"git+https://github.com/akashacms/plugins-diagrams.git","type":"git"},"_npmVersion":"11.4.2","description":"Process PlantUML diagrams into SVG, PNG, as well as AkashaCMS integration","directories":{},"_nodeVersion":"24.3.0","dependencies":{"commander":"^14.0.0","@pintora/cli":"^0.8.x","html-entities":"^2.5.2","@mermaid-js/mermaid-cli":"^11.6.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.10.7"},"peerDependencies":{"akasharender":"^0.9.x"},"_npmOperationalInternal":{"tmp":"tmp/diagrams-maker_0.9.3_1751920237252_0.750776717721255","host":"s3://npm-registry-packages-npm-production"}},"0.9.4":{"name":"@akashacms/diagrams-maker","version":"0.9.4","keywords":["PlantUML","Markdown","Static Content Management System","AkashaCMS"],"author":{"name":"David Herron","email":"david@davidherron.com"},"license":"ISC","_id":"@akashacms/diagrams-maker@0.9.4","maintainers":[{"name":"reikiman","email":"david@davidherron.com"}],"homepage":"https://github.com/akashacms/plugins-diagrams#readme","bugs":{"url":"https://github.com/akashacms/plugins-diagrams/issues"},"bin":{"diagrams-maker":"dist/cli.js"},"dist":{"shasum":"e41631b76d60fe1a6104f7500491e13ab213d8ff","tarball":"https://registry.npmjs.org/@akashacms/diagrams-maker/-/diagrams-maker-0.9.4.tgz","fileCount":19,"integrity":"sha512-WYDPqe9MDl4gWfGcHm2EalDMbZZ7rpeNwpX55bXNCCTxfYJ+jmPMGe5fzQbiwaPRozO836X7BBqqxW792YU9dQ==","signatures":[{"sig":"MEQCIHkG01zlUPlnTGjD+cmLC3kMxAr69rlYyYWSfVAdD2nCAiAl6/eUa/wIgNyZRzdECwhKDfvKosxGl+kzIGZwg9be4A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11983081},"main":"dist/index.js","type":"module","types":"dist/index.js","gitHead":"f0f6f7f3ef33c0c81826f07db12efca83805326a","scripts":{"build":"npx tsc","watch":"npx tsc -w","dopublish":"npm publish --access public"},"_npmUser":{"name":"reikiman","actor":{"name":"reikiman","type":"user","email":"david@davidherron.com"},"email":"david@davidherron.com"},"repository":{"url":"git+https://github.com/akashacms/plugins-diagrams.git","type":"git"},"_npmVersion":"11.4.2","description":"Process PlantUML diagrams into SVG, PNG, as well as AkashaCMS integration","directories":{},"_nodeVersion":"24.3.0","dependencies":{"commander":"^14.0.0","@pintora/cli":"^0.8.x","html-entities":"^2.5.2","@mermaid-js/mermaid-cli":"^11.6.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.10.7"},"peerDependencies":{"akasharender":"^0.9.x"},"_npmOperationalInternal":{"tmp":"tmp/diagrams-maker_0.9.4_1752138237588_0.6383477091365393","host":"s3://npm-registry-packages-npm-production"}},"0.9.5":{"name":"@akashacms/diagrams-maker","version":"0.9.5","keywords":["PlantUML","Markdown","Static Content Management System","AkashaCMS"],"author":{"name":"David Herron","email":"david@davidherron.com"},"license":"ISC","_id":"@akashacms/diagrams-maker@0.9.5","maintainers":[{"name":"reikiman","email":"david@davidherron.com"}],"homepage":"https://github.com/akashacms/plugins-diagrams#readme","bugs":{"url":"https://github.com/akashacms/plugins-diagrams/issues"},"bin":{"diagrams-maker":"dist/cli.js"},"dist":{"shasum":"0dc643080f1b5fbb8c912557ccc866e03f6ca644","tarball":"https://registry.npmjs.org/@akashacms/diagrams-maker/-/diagrams-maker-0.9.5.tgz","fileCount":20,"integrity":"sha512-567RfRkTKYIUemqmFSSekvzaitHuxea95xfoCdnT7U2Z+qvtDyU+h0kicdCg6tqBBqtO/kTgVBeNILyMXNeY4A==","signatures":[{"sig":"MEUCIFqiC4zW/E+MdskgLH1inAMcP+E37JGZujRqz0iGhcEVAiEAzBtEqD8z6gi54sutWpNoxtJPR8ho3wjQeLTk3YXUeG0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11986387},"main":"dist/index.js","type":"module","types":"dist/index.js","gitHead":"bcc0d23e5e755caf147fad0acbbc68dcf74d1a26","scripts":{"build":"npx tsc","watch":"npx tsc -w","dopublish":"npm publish --access public"},"_npmUser":{"name":"reikiman","email":"david@davidherron.com"},"repository":{"url":"git+https://github.com/akashacms/plugins-diagrams.git","type":"git"},"_npmVersion":"11.4.2","description":"Process PlantUML diagrams into SVG, PNG, as well as AkashaCMS integration","directories":{},"_nodeVersion":"24.4.0","dependencies":{"commander":"^14.0.0","@pintora/cli":"^0.8.x","html-entities":"^2.5.2","@mermaid-js/mermaid-cli":"^11.6.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.10.7"},"peerDependencies":{"akasharender":"^0.9.x"},"_npmOperationalInternal":{"tmp":"tmp/diagrams-maker_0.9.5_1752922614007_0.5559649342960591","host":"s3://npm-registry-packages-npm-production"}},"0.9.6":{"name":"@akashacms/diagrams-maker","version":"0.9.6","description":"Process PlantUML diagrams into SVG, PNG, as well as AkashaCMS integration","bin":{"diagrams-maker":"dist/cli.js"},"main":"dist/index.js","types":"dist/index.js","type":"module","scripts":{"build":"npx tsc","watch":"npx tsc -w","dopublish":"npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/akashacms/plugins-diagrams.git"},"keywords":["PlantUML","Markdown","Static Content Management System","AkashaCMS"],"author":{"name":"David Herron","email":"david@davidherron.com"},"license":"ISC","bugs":{"url":"https://github.com/akashacms/plugins-diagrams/issues"},"homepage":"https://github.com/akashacms/plugins-diagrams#readme","dependencies":{"@mermaid-js/mermaid-cli":"^11.6.0","@pintora/cli":"^0.8.x","commander":"^14.0.0","html-entities":"^2.5.2"},"devDependencies":{"@types/node":"^22.10.7","typescript":"^5.7.3"},"peerDependencies":{"akasharender":"^0.9.x"},"_id":"@akashacms/diagrams-maker@0.9.6","gitHead":"d61e9f96223f00a32d356938d4b70732608b713c","_nodeVersion":"24.4.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-XXz3xBxpoDBIBfPzQGEI2xdaX1r2wJ8n8hHMzDSP0LnSC4PnKsAZ9lFnu8MfAwXGZZbJ8UT6S5+uf4q0iCv8yw==","shasum":"9e668369ecb4bc6425478c52ef15d9241ae245dc","tarball":"https://registry.npmjs.org/@akashacms/diagrams-maker/-/diagrams-maker-0.9.6.tgz","fileCount":20,"unpackedSize":11988181,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCUV2nfORH7CJpJALDAB4rFbUHU07r8NIn3IlOuysmsnwIgUArjVOTMur8AHPDBha2Z1XMesp8p7CQ4PlTULYn9Ees="}]},"_npmUser":{"name":"reikiman","email":"david@davidherron.com"},"directories":{},"maintainers":[{"name":"reikiman","email":"david@davidherron.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/diagrams-maker_0.9.6_1752931151238_0.8013359594976899"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-23T14:15:57.136Z","modified":"2025-07-19T13:19:11.785Z","0.9.0":"2025-01-23T14:15:57.620Z","0.9.1":"2025-03-08T22:43:49.241Z","0.9.2":"2025-06-28T09:12:13.465Z","0.9.3":"2025-07-07T20:30:37.635Z","0.9.4":"2025-07-10T09:03:57.894Z","0.9.5":"2025-07-19T10:56:54.314Z","0.9.6":"2025-07-19T13:19:11.580Z"},"bugs":{"url":"https://github.com/akashacms/plugins-diagrams/issues"},"author":{"name":"David Herron","email":"david@davidherron.com"},"license":"ISC","homepage":"https://github.com/akashacms/plugins-diagrams#readme","keywords":["PlantUML","Markdown","Static Content Management System","AkashaCMS"],"repository":{"type":"git","url":"git+https://github.com/akashacms/plugins-diagrams.git"},"description":"Process PlantUML diagrams into SVG, PNG, as well as AkashaCMS integration","maintainers":[{"name":"reikiman","email":"david@davidherron.com"}],"readme":"# @akashacms/diagrams-maker\n\nProcess PlantUML, Mermaid, or Pintora, diagrams and either convert into an output file, or embed as HTML in a document.\n\nPlantUML diagrams are rendered locally using a copy of `plantuml.jar`, specifically the version released under the MIT license.  By using the JAR file, you are not reliant on an external server.\n\n**NOTE**: This package requires the Java runtime to be installed on your machine and in your path.  You can test this by running `java --help` at the command line.\n\n**NOTE**: It was intended that this package also support KaTeX.  Those who are interested (or not) should see [the issue queue entry](https://github.com/akashacms/plugins-diagrams/issues/7) for this task.\n\n## INSTALL\n\nIn an AkashaCMS project directory:\n\n```shell\n$ npm install @akashacms/diagrams-maker --save\n```\n\n## Usage - CLI -- PlantUML\n\nThe package includes a CLI tool with the following synopsis:\n\n```shell\nUsage: npx diagrams-maker plantuml [options]\n\nRender PlantUML files\n\nOptions:\n  --input-file <inputFN...>  Path for document to render\n  --output-file <outputFN>   Path for rendered document\n  --charset <charset>        To use a specific character set. Default: UTF-8\n  --darkmode                 To use dark mode for diagrams\n  --debugsvek                To generate intermediate svek files\n  --filename <fileNm>        \"example.puml\" To override %filename% variable\n  --nbthread <nThreads>      To use (N) threads for processing.\n                             Use \"auto\" for 4 threads.\n  --nometadata               To NOT export metadata in PNG/SVG generated files\n  --output-dir <outDir>      To generate images in the specified directory\n  --teps                     To generate images using EPS format\n  --thtml                    To generate HTML file for class diagram\n  --tlatex                   To generate images using LaTeX/Tikz format\n  --tpdf                     To generate images using PDF format\n  --tpng                     To generate images using PNG format (default)\n  --tscxml                   To generate SCXML file for state diagram\n  --tsvg                     To generate images using SVG format\n  --ttxt                     To generate images with ASCII art\n  --tutxt                    To generate images with ASCII art\n                             using Unicode characters\n  --tvdx                     To generate images using VDX format\n  --txmi                     To generate XMI file for class diagram\n  --verbose                  To have log information\n  -h, --help                 display help for command\n```\n\nMost of these options correspond directly to the CLI arguments for `plantuml.jar` as listed on the PlantUML website.\n\nOne mode is a single input file, and a single output file:\n\n```shell\n$ npx diagrams-maker plantuml \\\n      --input-file flight.puml \\\n      --output-file flight.png  \\\n      --tpng\n```\n\nThis converts the PlantUML diagram in the named file into a PNG.\n\nThe `--input-file` parameter can be used multiple times.  In that case, the parameters are treated as the `[file/dir] [file/dir] [file/dir]` parameters for `plantuml.jar`.  The `--output-file` parameter, if given, is ignored in this case.  You may use the `--output-dir` parameter to affect where the files land.\n\n```shell\n$ npx diagrams-maker plantuml \\\n    --input-file file1.puml --input-file dir/with/diagrams \\\n    --output-dir out\n    --tpng\n```\n\nThis will search for PlantUML documents in the named files or directories, generating PNG files, with the files landing in a directory hierarchy under the `out` directory.\n\n## USAGE - CLI - Pintora\n\nThe package includes the following CLI commands to use Pintora.\n\n```shell\n$ npx diagrams-maker pintora --help\nUsage: diagrams-maker pintora [options]\n\nRender Pintora files\n\nOptions:\n  --input-file <inputFN>    Path for document to render\n  --output-file <outputFN>  Path for rendered document\n  --pixel-ratio <ratio>\n  --mime-type <mt>          MIME type for output file\n  --bg-color <color>        String describing background color\n  --width <number>          Width of the output, height will be calculated according to the diagram content ratio\n  -h, --help                display help for command\n```\n\nThe only mode is to render a single input file to an output file:\n\n```shell\n$ npx diagrams-maker pintora \\\n      --input-file flight.pintora \\\n      --output-file flight.png  \\\n      --mime-type image/png\n```\n\nThe `--mime-type` option selects between `image/svg+xml`, `image/jpeg`, or `image/png`.\n\n## USAGE - CLI - Mermaid\n\nWhile this package now supports Mermaid, it does not have CLI support.\n\n<!-- ## USAGE - CLI - KaTeX -->\n\n## API - PlantUML\n\nThe `diagram-maker` package exports an API providing similar functionality.\n\n```js\nimport { doPlantUMLOptions, doPlantUMLLocal } from '@akashacms/diagrams-maker';\n\nawait doPlantUMLLocal({\n  inputBody: `\n    @startuml\n    ... diagram\n    @enduml\n    `,\n  outputFN: '/path/to/destination/diagram.png',\n  tpng: true\n} as doPlantUMLOptions);\n```\n\nThis converts an inline diagram into a PNG file at the named filesystem location.  The structure of the _options_ parameter is described by `doPlantUMLOptions`.\n\nThe `inputFNs` is an array treated similarly to the `--input-file` parameter for the CLI.\n\nThere are three modes for treating inputs and outputs:\n\n* No `inputFNs`, in which case `inputBody` is output to the `outputFN` which is required.\n* One entry in the `inputFNs` which is output to the `outputFN` which is required.\n* Multiple entries in the `inputFNs`, and the output location is influenced by `outputDir`.\n\n## Usage - AkashaCMS project\n\nThe `@akashacms/diagrams-makers` package includes an AkashaCMS plugin, as well as a Markdown-IT plugin supporting Mermaid.\n\nSetup, configuration:\n\n```js\nimport {\n    DiagramsPlugin,\n    MarkdownITMermaidPlugin\n} from '@akashacms/diagrams-makers';\n\nconfig.use(DiagramsPlugin);\n\nconst scratchDir = path.join(process.cwd(), '_mermaid');\nconfig.addDocumentsDir(scratchDir);\nconfig.findRendererName('.html.md')\n.use(MarkdownITMermaidPlugin, {\n    fspath: scratchDir,\n    prefix: '/_mermaid'\n});\n```\n\n### PlantUML diagrams in AkashaCMS projects\n\nIn a document the `<diagrams-plantuml>` tag is used for rendering a single PlantUML diagram into either PNG or SVG.\n\nThe PlantUML document can be used inline\n\n```html\n<diagrams-plantuml output-file=\"./flight.png\" tpng>\n@startuml\nstart\n\nif (Graphviz installed?) then (yes)\n  :process all \n  diagrams;\nelse (no)\n  :process only \n  __sequence__ and __activity__ diagrams;\nendif\n\nstop\n@enduml\n</diagrams-plantuml>\n```\n\nThe diagram is rendered into the AkashaCMS `renderDestination` directory hierarchy to a location relative to the document being rendered.\n\nEither the `tpng` or `tsvg` property (not attribute) is used to indicate the output format.\n\nThe diagram can also be in the filesystem:\n\n```html\n<diagrams-plantuml\n    input-file=\"./img/flight.puml\"\n    output-file=\"./img/flight.png\"\n    tpng/>\n<diagrams-plantuml\n    input-file=\"/path/to/diagrams/flight.puml\"\n    output-file=\"./img/flight.png\"\n    tpng/>\n```\n\nThe `input-file` path must be a virtual path within either an `assets` or `documents` directory.\n\nIf the `input-file` is an absolute pathname, it is relative to the root of the virtual filespace of the AkashaCMS project configuration.  A relative pathname is relative to the file being rendered.\n\n### Pintora diagrams in an AkashaCMS project\n\nIn a document the `<diagrams-pintora>` tag is used for rendering a single Pintora diagram into PNG, JPEG, or SVG.\n\nThe Pintora document can be used inline\n\n```html\n<diagrams-pintora output-file=\"./flight.png\" mime-type=\"image/png\">\nsequenceDiagram\n  Frida-->>Georgia: Flowers are beautiful\n  @note over Frida,Georgia: Painters\n  @note right of Georgia: Right\n  @start_note left of Georgia\n  multiline\n  note\n  @end_note\n</diagrams-pintora>\n```\n\nOr, the Pintora document can be in an external file:\n\n```html\n<diagrams-pintora input-file=\"./flight.pint\" output-file=\"./flight.jpeg\" mime-type=\"image/jpeg\"/>\n```\n\nSometimes a Pintora document will not parse correctly when used in-line.  The solution for such a case is to place the diagram description in a file.\n\n### Inline Mermaid diagrams in an AkashaCMS project\n\nTo implement this behavior, add `MarkdownITMermaidPlugin` to Markdown-IT as shown above.\n\nIn a document, we can include an inline Mermaid document like so:\n\n```\n```mermaid optional title goes here\ngraph TD;\n    A-->B;\n    A-->C;\n    B-->D;\n    C-->D;\n```\n```\n\nIn otherwords, within a 3-backtick fence labeled with the language `mermaid`, you place a Mermaid document.  You may also use a three-tilde fence (`~~~mermaid`) if you prefer.\n\nA document title can be included by adding a space after `mermaid` then adding text to be used as the title.\n\nBehind the scenes this is saved out to a file in the filesystem.  This will be within the `scratchDir` defined in the code snippet above.  The file name will be hash-coded and have the extension `.mermaid`.  In the rendered HTML, there will be a custom tag in this form:\n\n```html\n<diagrams-mermaid\n        caption=\"${title}\"\n        input-file='${mmdFileName}'\n        output-file='${svgFileName}'/>\n```\n\nThis custom tag is processed by `DiagramsPlugin`.  It invokes the Mermaid CLI `run` function to render the Mermaid document into SVG.\n\nThe above is replaced by this:\n\n```html\n<figure ${Tid} ${Tclazz}>\n<img src=\"${encode(outputFN)}\" ${Talt} ${Ttitle}/>\n${cap}\n</figure>\n```\n\nNotice that the optional `title` text described earlier is passed as the `caption` option.  This ends up in the `${cap}` field of the template as `<figcaption>${encode(caption)}</figcaption>`.\n\nIn all cases, the Mermaid document is rendered in SVG format.\n\n### Rendering Mermaid diagrams in an AkashaCMS project\n\nIn the previous subsection we described rendering a Mermaid document that's inline in a Markdown document.  One can also directly use the `diagrams-mermaid` custom element as shown above.\n\n```html\n<diagrams-mermaid\n        id=\"${id}\"\n        class=\"${class}\"\n        alt=\"${alt}\"\n        title=\"${title}\"\n        caption=\"${caption}\"\n        input-file='${mmdFileName}'\n        output-file='${svgFileName}'/>\n```\n\nIn this mode, the MarkdownITMermaidPlugin class is not required.  Instead, the configuration can simply be:\n\n```js\nconfig.use(DiagramsPlugin);\n```\n\nCurrently, the usage is as shown here, with `input-file` and `output-file` options.  Additionally, `id`, `class`, `alt`, `title`, and `caption` options are available, and pass into the rendered HTML using the template shown earlier.\n\nIn all cases, the Mermaid document is rendered in SVG format.\n","readmeFilename":"README.md"}