Command reference
plotwork read
Print the source a Plotwork SVG, a view link, or a hosted link carries, to edit it. It is a command of the Plotwork command line, the npm package @buun_group/plotwork.
TL;DR
| Question | Answer |
|---|---|
| What does it do? | Print the source a Plotwork SVG, a view link, or a hosted link carries, to edit it. |
| How do I run it? | npx -y @buun_group/plotwork@0.1.0-beta.13 read, or plotwork read once the package is installed. |
| What does it write? | The source, only with --out. |
| Does it use the network? | Only for a hosted link: one request for that picture. A file or a view link is read on this machine. |
| Does it read the repository settings? | No. |
| How do I read this in a terminal? | plotwork read --help |
Synopsis
sh
plotwork read <file.svg|link> [--out <file>]What it does
Prints the source a Plotwork picture carries, so the diagram can be changed and drawn again. The target is an SVG file, a view link a tool returned, or a hosted link such as https://cdn.plotwork.dev/d/<token>.svg.
The source goes to standard output, or to --out, and everything else to standard error, so plotwork read picture.svg > picture.diagram writes only the source. A picture with no embedded source prints what can be read from it, such as its title and labels, and exits 1.
Options
| Option | Default | What it does |
|---|---|---|
--out <file> | standard output | Write the source to a file. |
Examples
Get the source back from a picture in the repository.
sh
plotwork read docs/assets/diagrams/flow.svg > flow.diagramGet the source of a hosted picture.
sh
plotwork read https://cdn.plotwork.dev/d/<token>.svg --out flow.diagramExit codes
| Code | When |
|---|---|
0 | The source was printed or written. |
1 | The picture carries no source, the source has errors, or a hosted link could not be read. |
2 | A 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
| Doc | Why |
|---|---|
| Command reference | Every command of the command line |
| Editing an existing diagram | Change a picture you already have |
| Hosted diagrams | The links read fetches |
| Exit codes and output formats | What every code and format means |