Skip to content
Connect an agent
Command reference

plotwork render

Draw the first diagram of a file, or a view link, to an SVG that carries its source. It is a command of the Plotwork command line, the npm package @buun_group/plotwork.

TL;DR

QuestionAnswer
What does it do?Draw the first diagram of a file, or a view link, to an SVG that carries its source.
How do I run it?npx -y @buun_group/plotwork@0.1.0-beta.13 render, or plotwork render once the package is installed.
What does it write?One SVG.
Does it use the network?No. A view link is decoded on this machine.
Does it read the repository settings?Yes: the header defaults of the settings file apply to every diagram. See Configuration.
How do I read this in a terminal?plotwork render --help

Synopsis

sh
plotwork render <file|link> [--out <svg>] [--theme light|dark|auto] [--no-embed-source] [--config <file>]

What it does

Draws the first diagram of a Markdown or .diagram file to one SVG. The source is written into the SVG, so read can give it back later; --no-embed-source leaves it out.

The file can also be a viewUrl, svgUrl, or pngUrl a Plotwork tool returned. Quote it: the diagram is decoded from the link on this machine and never fetched.

Options

OptionDefaultWhat it does
--out <svg>the file name with .svg, or diagram.svg for a linkThe SVG to write.
--theme light|dark|autothe theme of the settings, else lightThe colours to draw in; auto draws one picture that follows the reader.
--no-embed-sourcethe source is embeddedLeave the source out of the SVG.
--config <file>PLOTWORK_CONFIG, else the nearest plotwork.config.json or .plotwork/config.json from the file up to the repository rootThe repository settings file to read: header defaults, and the style rules check applies.

Examples

Draw a diagram file to an SVG.

sh
plotwork render checkout.diagram --out checkout.svg

Draw it in the dark theme.

sh
plotwork render checkout.diagram --theme dark --out checkout.dark.svg

Write the picture of a view link a tool returned, with no request.

sh
plotwork render "<viewUrl>" --out flow.svg

Exit codes

CodeWhen
0The SVG was written.
1The diagram has an error, or the file holds no diagram.
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.

See also

DocWhy
Command referenceEvery command of the command line
Viewing diagramsThe view links a tool returns
Editing an existing diagramWhy the source is embedded
Exit codes and output formatsWhat every code and format means