CLI reference#
YMPrint installs a single command, ym, with two subcommands.
ym --help
Command |
What it does |
|---|---|
Render a YAML file to a PDF once. |
|
Render, open the PDF in Okular, which will hot-reload on every save. |
ym convert#
Render a single YAML file to a PDF.
ym convert SRC [DEST] [--config-dir DIR]
Argument |
Required |
Meaning |
|---|---|---|
|
β |
Path to the source YAML report. |
|
Output PDF path. Defaults to the source path with a |
|
|
Directory holding a project config file. If omitted, YMPrint searches parent directories for one. If a config file is not found in the parent directories, the internal default configuration will take priority. |
Examples
# Write report.pdf next to report.yml
ym convert report.yml
# Choose an explicit output path
ym convert report.yml output/inspection.pdf
# Use a shared project config directory
ym convert report.yml --config-dir ../shared-config
On success it prints the resolved output path:
βοΈ .... π ... PDF created: /path/to/report.pdf
ym live#
Render the PDF, open it in the Okular viewer, and rebuild automatically whenever the source (or the non-default config file) changes.
Ideal for live authoring.
ym live SRC [DEST] [--config-dir DIR]
Argument |
Required |
Meaning |
|---|---|---|
|
β |
YAML file to render and watch. |
|
Output PDF path. Defaults to the source path with a |
|
|
Directory of config files to also watch for changes. |
What it watches. Live mode watches the source file and, if a config directory is in
play, the config files within it (config.ymprint.yml.
When any of them changes, the PDF is re-rendered and Okular refreshes.
ym live report.yml
YMPrint live mode watching report.yml β Ctrl+C to quit
Edit and save your report in another window; the preview updates. Press Ctrl+C to stop.
Note
Live mode uses Okular as the viewer. Install it via your system package manager (for
example sudo apt install okular on Debian/Ubuntu). See
Installation β Live preview.
Config discovery#
When you donβt pass --config-dir, YMPrint walks up from the current working directory
looking for a config file (a *.ymprint.yml project config). The nearest match is used.
This enables a whole tree of documents to share one project style. See Configuration.