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.10.0 render, or plotwork render once the package is installed.
What does it write?One SVG, and the settings file, when the defaults differ from an organisation's legend choice or diagram style that was read.
Does it use the network?No, unless PLOTWORK_API_KEY is set and --org, PLOTWORK_ORG or brand.organization of the settings names an organisation: then two requests to the Plotwork API read its legend choice and diagram style, which are written over the settings file's defaults. 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>] [--scheme light|dark|auto] [--theme plotwork|slate|ocean|forest|sunset|mono|contrast] [--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.
--scheme light|dark|autothe scheme of the settings, else lightThe color scheme to draw in; auto draws one picture that follows the reader.
--theme plotwork|slate|ocean|forest|sunset|mono|contrastthe header's theme=The colour theme, written into the header of the picture's source.
--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 scheme.

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

Draw it in the ocean colour theme.

sh
plotwork render checkout.diagram --theme ocean

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