PlantUML Diagrams Preprocessor for Foliant
PlantUML is a tool to generate diagrams from plain text. This preprocessor finds PlantUML diagrams definitions in the source and converts them into images on the fly during project build.
Installation
$ pip install foliantcontrib.plantuml
Config
To enable the preprocessor, add plantuml to preprocessors section in the project config:
preprocessors:
- plantuml
The preprocessor has a number of options:
preprocessors:
- plantuml:
cache_dir: !path .diagramscache
plantuml_path: plantuml
format: png
params:
...
parse_raw: true
as_image: true
cache_dir
: Path to the directory with the generated diagrams. It can be a path relative to the project root or a global one; you can use ~/ shortcut.
> **Note**
>
> To save time during build, only new and modified diagrams are rendered. The generated images are cached and reused in future builds.
plantuml_path
: Path to PlantUML launcher. By default, it is assumed that you have the command plantuml in your PATH, but if PlantUML uses another command to launch, or if the plantuml launcher is installed in a custom place, you can define it here.
format
: Diagram format, list of supported formats. Default: png.
Another way to specify format is to use
t<format>option inparams.
params
: Params passed to the image generation command:
preprocessors:
- plantuml:
params:
config: !path plantuml.cfg
To see the full list of params, run the command that launches PlantUML, with `-h` command line option.
parse_raw
: If this flag is true, the preprocessor will also process all PlantUML diagrams which are not wrapped in <plantuml>...</plantuml> tags. Default value is false.
as_image
: If true — inserts scheme into document as md-image. If false — inserts the file generated by PlantUML directly into the document (only for svg format). Default: true
Usage
To insert a diagram definition in your Markdown source, enclose it between <plantuml>...</plantuml> tags (indentation inside tags is optional):
Here’s a diagram:
<plantuml>
@startuml
...
@enduml
</plantuml>
To set a caption, use caption option:
Diagram with a caption:
<plantuml caption="Sample diagram from the official site">
@startuml
...
@enduml
</plantuml>
You can override values from the preprocessor config for each diagram.
By default, diagrams are in PNG. But this diagram is in EPS:
<plantuml caption="Vector diagram" format="eps">
@startuml
...
@enduml
</plantuml>
Sometimes it can be necessary to process auto-generated documents that contain multiple PlantUML diagrams definitions without using Foliant-specific tags syntax. Use the parse_raw option in these cases.
Metadata
Release files for foliantcontrib.plantuml 1.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| foliantcontrib.plantuml-1.0.10.tar.gz | 8.9 kB | Without provenance | Details for foliantcontrib.plantuml-1.0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| foliantcontrib.plantuml-1.0.10-py3-none-any.whl | Python 3 | none | any | Details for foliantcontrib.plantuml-1.0.10-py3-none-any.whl |
Total release size: 16.4 kB
Release files / foliantcontrib.plantuml-1.0.10.tar.gz
| Download URL | foliantcontrib.plantuml-1.0.10.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dbd5ebeb874592733f9c044df047fe5989011177220e35d6fd9eb9ce4fcb30f2
|
|
BLAKE2b-256 checksum How to use checksums |
42a8884e64a0fdcd6ce04c4ea2d84af6f091eac01a211c7face05d456272da99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
|
Release files / foliantcontrib.plantuml-1.0.10-py3-none-any.whl
| Download URL | foliantcontrib.plantuml-1.0.10-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f11931ddcc7b76b85a534ed45c3c29357d2abc0531d3c42aa93a2f1fecd2dba
|
|
BLAKE2b-256 checksum How to use checksums |
dfdd425ab93e5337e2922363aef329e1ea105b31754af579f0b365c711082548
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
|
Security for foliantcontrib.plantuml 1.0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.