hop export
hop export writes the diagram of a pipeline or a workflow to a file, in SVG or Mermaid format.
It exports one file, or every pipeline and workflow in a folder.
It uses the same exporters as File > Export diagram in Hop Gui, so you can create the diagrams from a script or a build.
The installation also has hop-export.sh and hop-export.bat, which run the same command.
# One file
hop export -f pipelines/load-orders.hpl -o diagrams/load-orders.svg
# One file as Mermaid
hop export -f workflows/main.hwf --format mermaid -o diagrams/main.mmd
# Every pipeline and workflow in a folder and its subfolders
hop export -s /path/to/project -t /path/to/diagrams --recursive
# The formats this installation can write
hop export --list-exporters
Options
| Option | Description |
|---|---|
|
The pipeline ( |
|
The file to write, for |
|
|
|
The folder to export every pipeline and workflow from. |
|
The folder to write the diagrams to, for |
|
With |
|
Scale an SVG diagram, for example |
|
Notes are included by default. Use |
|
List the exporters in this installation, with their format and file extension. |
|
Enable a project first, so that variables such as |
|
Enable an environment, and its project, first. |
The project options are the same as for hop run:
hop export -j my-project -f '${PROJECT_HOME}/pipelines/load-orders.hpl' -o /tmp/load-orders.svg
Run hop export --help for the full list, which also has -pl, --environments and the other options of the hop command.
Formats
Hop has an SVG and a Mermaid exporter for both pipelines and workflows.
Plugins can add more; --list-exporters shows what your installation has.
$ ./hop export --list-exporters
Available Diagram Exporters (4):
ID: pipeline-mermaid
Name: Pipeline Mermaid Exporter
Format: MERMAID
Extension: .mmd
Description: Exports a pipeline diagram to Mermaid flowchart (.mmd)
ID: pipeline-svg
Name: Pipeline SVG Exporter
...
-
SVG draws the diagram as it looks in Hop Gui, with the transform and action icons and the notes.
-
Mermaid writes a text flowchart (
.mmd) with a node per transform or action and an arrow per hop. You can keep it next to the project in version control, or paste it into a page that renders Mermaid.
Exporting a folder
With -s, hop export exports every .hpl and .hwf file in the folder, and with -r in its subfolders too.
Each diagram is written under -t with the same relative path, for example pipelines/load-orders.hpl becomes pipelines/load-orders.svg.
-
-tmust be an existing folder. With-r, its subfolders must exist as well. -
The export stops at the first file it can’t export, for example a diagram whose folder is missing under
-t, or a file that is not valid XML. The diagrams written before it stay. -
A pipeline and a workflow with the same name in the same folder are written to the same file, so only the last one is kept.
At the end, the command logs how many diagrams it exported.
Exit codes
hop export ends with 0 when the export is done, and with 1 when it fails, for example when the source folder doesn’t exist or a diagram can’t be written.
The hop-export.sh and hop-export.bat scripts end with other codes:
| Code | Meaning |
|---|---|
|
The export is done. |
|
The help was shown, with |
|
The export failed, for example when the source folder doesn’t exist or a file is not a valid pipeline or workflow. |
|
An option is not valid. |