Skip to content
Connect an agent
Command reference

plotwork import

Convert Mermaid to Plotwork: a .mmd file, or every mermaid fence of a Markdown file. It is a command of the Plotwork command line, the npm package @buun_group/plotwork.

TL;DR

QuestionAnswer
What does it do?Convert Mermaid to Plotwork: a .mmd file, or every mermaid fence of a Markdown file.
How do I run it?npx -y @buun_group/plotwork@0.1.0-beta.13 import, or plotwork import once the package is installed.
What does it write?The source with --out, or the Markdown file with --write.
Does it use the network?No. It reads and writes files on this machine only.
Does it read the repository settings?No.
How do I read this in a terminal?plotwork import --help

Synopsis

sh
plotwork import <file> [--out <file>] [--write] [--format text|json] [--lenient]

What it does

Converts Mermaid to Plotwork. A .mmd or .mermaid file prints its Plotwork source. A Markdown file is reported on fence by fence, and rewritten only with --write; a fence that cannot be converted is left as it was.

Each diagnostic says what was not carried over and how to say it in Plotwork, and the Plotwork validator then checks the result.

Options

OptionDefaultWhat it does
--out <file>standard outputWrite the source of a .mmd file to a file.
--writeOffRewrite the Markdown file with each fence that converts.
--format text|jsontextjson prints the conversion and its diagnostics as data.
--lenientOffConvert what can be converted and report the rest, instead of refusing a diagram with a statement it cannot carry.

Examples

Convert one Mermaid file.

sh
plotwork import flow.mmd --out flow.diagram

Convert every mermaid fence of a page that converts, in place.

sh
plotwork import README.md --write

Exit codes

CodeWhen
0Everything converted.
1A diagram or a fence could not be converted, or the file could not be read.
2A mistake in the command line: an unknown option, a missing operand, a file or glob that matches nothing, or a settings file that cannot be read. Also when the file is not .mmd, .mermaid, or Markdown.

See also

DocWhy
Command referenceEvery command of the command line
Migrating from MermaidWhat converts and what does not
Exit codes and output formatsWhat every code and format means