Command reference
plotwork validate
Check every diagram of a Markdown or .diagram file; --strict also fails on warnings. It is a command of the Plotwork command line, the npm package @buun_group/plotwork.
TL;DR
| Question | Answer |
|---|---|
| What does it do? | Check every diagram of a Markdown or .diagram file; --strict also fails on warnings. |
| How do I run it? | npx -y @buun_group/plotwork@0.1.0-beta.13 validate, or plotwork validate once the package is installed. |
| What does it write? | Nothing. |
| Does it use the network? | No. It reads and writes files on this machine only. |
| 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 validate --help |
Synopsis
sh
plotwork validate <file> [--strict] [--config <file>]What it does
Parses every diagram of one file: each diagram fence of a Markdown file, or the whole of a .diagram file. Each mistake is printed with its line and column in the file, the code, and a hint that says how to fix it. Warnings, such as a label too long to read, are printed and pass unless --strict is given.
Options
| Option | Default | What it does |
|---|---|---|
--strict | Off | Exit 1 on warnings as well as errors. |
--config <file> | PLOTWORK_CONFIG, else the nearest plotwork.config.json or .plotwork/config.json from the file up to the repository root | The repository settings file to read: header defaults, and the style rules check applies. |
Examples
Check every diagram fence of a Markdown file.
sh
plotwork validate docs/architecture.mdFail on warnings too.
sh
plotwork validate checkout.diagram --strictExit codes
| Code | When |
|---|---|
0 | Every diagram is valid. |
1 | A diagram has an error, or a warning with --strict. |
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 |
| Writing diagrams | The language the errors point at |
| Language reference | Every statement and option |
| Exit codes and output formats | What every code and format means |