PlantUML diagrams preprocessor for Foliant.
Project description
# PlantUML Diagrams Preprocessor for Foliant
[PlantUML](http://plantuml.com/) 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
```bash
$ pip install foliantcontrib.plantuml
```
## Config
To enable the preprocessor, add `plantuml` to `preprocessors` section in the project config:
```yaml
preprocessors:
- plantuml
```
The preprocessor has a number of options:
```yaml
preprocessors:
- plantuml:
cache_dir: !path .diagramscache
plantuml_path: plantuml
params:
...
parse_raw: 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.
`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`.
## Usage
To insert a diagram definition in your Markdown source, enclose it between `<<plantuml>...</plantuml>` tags (indentation inside tags is optional):
```markdown
Here’s a diagram:
<<plantuml>
@startuml
...
@enduml
</plantuml>
```
To set a caption, use `caption` option:
```markdown
Diagram with a caption:
<<plantuml caption="Sample diagram from the official site">
@startuml
...
@enduml
</plantuml>
```
You can override `params` values from the preprocessor config for each diagram. Also you can use `format` alias for `-t*` params:
```markdown
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.
[PlantUML](http://plantuml.com/) 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
```bash
$ pip install foliantcontrib.plantuml
```
## Config
To enable the preprocessor, add `plantuml` to `preprocessors` section in the project config:
```yaml
preprocessors:
- plantuml
```
The preprocessor has a number of options:
```yaml
preprocessors:
- plantuml:
cache_dir: !path .diagramscache
plantuml_path: plantuml
params:
...
parse_raw: 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.
`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`.
## Usage
To insert a diagram definition in your Markdown source, enclose it between `<<plantuml>...</plantuml>` tags (indentation inside tags is optional):
```markdown
Here’s a diagram:
<<plantuml>
@startuml
...
@enduml
</plantuml>
```
To set a caption, use `caption` option:
```markdown
Diagram with a caption:
<<plantuml caption="Sample diagram from the official site">
@startuml
...
@enduml
</plantuml>
```
You can override `params` values from the preprocessor config for each diagram. Also you can use `format` alias for `-t*` params:
```markdown
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file foliantcontrib.plantuml-1.0.4.tar.gz.
File metadata
- Download URL: foliantcontrib.plantuml-1.0.4.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b83f36080fe081f1af220c08b142c0f2333c7071a980e9431d8f657f07f1868
|
|
| MD5 |
f409c4087c8163401b55d599ca4f504c
|
|
| BLAKE2b-256 |
c1d50382931d209773d8aa46c2ed5b6353b4727cfde851fac7bffe49574a4273
|