All Projects → sytsereitsma → mdbook-plantuml

sytsereitsma / mdbook-plantuml

Licence: MIT License
mdBook preprocessor to render PlantUML diagrams to png images in the book output directory

Programming Languages

rust
11053 projects
python
139335 projects - #7 most used programming language
Batchfile
5799 projects

Projects that are alternatives of or similar to mdbook-plantuml

nimibook
A port of mdbook to nim(ib)
Stars: ✭ 34 (-20.93%)
Mutual labels:  mdbook
plant erd
ERD exporter with PlantUML and mermaid format
Stars: ✭ 126 (+193.02%)
Mutual labels:  plantuml
dcdg.dart
Dart Class Diagram Generator
Stars: ✭ 98 (+127.91%)
Mutual labels:  plantuml
PlantUML-colors
This script is to show all named color suggested by PlantUML
Stars: ✭ 52 (+20.93%)
Mutual labels:  plantuml
PlantUMLDesignPatterns
No description or website provided.
Stars: ✭ 34 (-20.93%)
Mutual labels:  plantuml
erdiagram
Entity-Relationship diagram code generator library
Stars: ✭ 28 (-34.88%)
Mutual labels:  plantuml
PlantUml-Language-Service
PlantUml Language Service extension for Visual Studio 2017 and 2019
Stars: ✭ 24 (-44.19%)
Mutual labels:  plantuml
learn-haskell-blog-generator
Learn Haskell by building a blog generator - a book about Haskell.
Stars: ✭ 66 (+53.49%)
Mutual labels:  mdbook
smeagol-galore
A git-based wiki featuring markdown, a WYSIWYG Editor, PlantUML, and much more
Stars: ✭ 21 (-51.16%)
Mutual labels:  plantuml
hexo-filter-plantuml
Using PlantUML to generate UML Diagram for hexo
Stars: ✭ 23 (-46.51%)
Mutual labels:  plantuml
vuepress-theme-cool
A custom vuepress theme with mermaid and plantuml, katex and vue components.
Stars: ✭ 57 (+32.56%)
Mutual labels:  plantuml
compose plantuml
Generate Plantuml graphs from docker-compose files
Stars: ✭ 77 (+79.07%)
Mutual labels:  plantuml
vue-showdowns-editor
A markdown editor using codemirror and previewer using @jhuix/showdowns for Vue.js.
Stars: ✭ 27 (-37.21%)
Mutual labels:  plantuml
docker plantuml
docker container for plantuml
Stars: ✭ 41 (-4.65%)
Mutual labels:  plantuml
mkdocs build plantuml
MkDocs plugin to help generate your plantuml images locally or remotely as files (NOT inline)
Stars: ✭ 31 (-27.91%)
Mutual labels:  plantuml
architecture-viewer
Visualize your PlantUML sequence diagrams as interactive architecture diagrams!
Stars: ✭ 57 (+32.56%)
Mutual labels:  plantuml
kstatemachine
KStateMachine is a Kotlin DSL library for creating finite state machines (FSM) and hierarchical state machines (HSM).
Stars: ✭ 63 (+46.51%)
Mutual labels:  plantuml
plantuml-libs
A set of PlantUML libraries and a NPM cli tool to design diagrams which focus on several technologies/approaches: Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), C4 Model or even EventStorming and more.
Stars: ✭ 75 (+74.42%)
Mutual labels:  plantuml
salesforce-plantuml
Salesforce app to generate UML class & ER-diagrams from your org data. Leverages the PlantUML library.
Stars: ✭ 89 (+106.98%)
Mutual labels:  plantuml
mdBook-zh
中文翻译:<mdBook> 一个从 Markdown 文件创建现代在线书籍的实用程序 ❤️ 更新 ✅ 2022-1-8
Stars: ✭ 24 (-44.19%)
Mutual labels:  mdbook

mdBook PlantUML

mdBook preprocessor to render PlantUML code blocks as images in your book.

Contents

Usage

First create the preprocessor in your book.toml file:

[book]
authors = ["Dzjengis Khan"]
multilingual = false
src = "src"
title = "mdBook PlantUML preprocessor"

[preprocessor.plantuml]
plantuml-cmd="plantuml.exe"

The above assumes both the mdbook-preprocessor and the plantuml executable are on your path.

Then simply add a PlantUML code block in your book text:

Some text here

```plantuml
@startuml
A --|> B
@enduml
```

Some more text.

The plantuml code block will be replaced an image reference to an SVG image if possible, or png if PlantUML does not support svg for the requested diagram type (i.e. ditaa).

Image formats

The image is svg, or png by default, depending on the diagram type. If desired it can be changed to another one of PlantUMLs output formats (note that some formats are not supported by all browsers and or PlantUML server implementations).

See https://plantuml.com/command-line (Types of Output File) for available formats. mdbook-plantuml uses the short param name (case sensitive, without the '-')

A diagram in UTF-8 text format (inlined automatically)
```plantuml,format=utxt
@startuml
A --|> B
@enduml
```

Force png format:
```plantuml,format=png
@startuml
A --|> B
@enduml
```

Options

  • plantuml-cmd: Optional command override for PlantUML (defaults to "java -jar plantuml.jar" on Windows and "/usr/bin/plantuml" on Linux). When a URL is provided it is assumed you want to generate the images using a PlantUML server implementation.
  • clickable-img: Optional (false by default). When true images can be clicked and are opened in a new tab/window.

Features

  • plantuml-server Add http server support only
  • plantuml-ssl-server Add https server support (default)

Examples: Install without server support: cargo install mdbook-plantuml --no-default-features

Install with http server support: cargo install mdbook-plantuml --no-default-features --features plantuml-server

Install with https server support: cargo install mdbook-plantuml --no-default-features --features plantuml-ssl-server

Example server configuration

Below is an example server configuration.

You can test your server by appending the URL with "/png/SoWkIImgAStDuGh8ISmh2VNrKT3LhR5J24ujAaijud98pKi1IW80". Using the example below this example you'd end up with this URL. When it is working correctly you should see the following image:

[book]
authors = ["Dzjengis Khan"]
multilingual = false
src = "src"
title = "mdBook PlantUML preprocessor"

[preprocessor.plantuml]
plantuml-cmd="http://localhost:8080/plantuml"

Troubleshooting rendering issues

mdBook communicates to the preprocessor using stdio. As a result log output from the preprocessor is not printed to the screen. When the preprocessor's markdown error output is insufficient for you it is possible to redirect logging to the file ./output.log by using the command line switch -l. See the config below for an example:

[book]
authors = ["Sytse Reitsma"]
multilingual = false
src = "src"
title = "mdBook E2E test book"

[preprocessor.plantuml]
plantuml-cmd="http://localhost:8080/plantuml"
command = "mdbook-plantuml -l"

Change log

0.7.0 (2020-08-29)

  • 🏎️ Speed! Added caching to only regenerate the changed code blocks, instead of all of them.
  • Feature gated the PlantUML server and ssl server (default is ssl server). Issue #16
  • Fixed infinite rebuild loop when using the mdbook serve command. Because the preprocessor output cannot be written directly to the book output dir anymore the images need to be created in the src dir unfortunately (mdBook change). You still end up with one extra rebuild when images are updated, I cannot prevent this (the gitignore file of mdbook should be able to prevent this, but it does not). Issue #17

0.6.0-beta (2020-01-29)

  • 🏎️ Speed! Added caching to only regenerate the changed code blocks, instead of all of them.
  • Feature gated the PlantUML server and ssl server (default is ssl server). Issue #16
  • Dropped pulldown-cmark in favor of a home grown markdown parser. The conversion from markdown and back caused changes in the document. Issue #15
  • These are pretty major changes, hence the beta label.

0.5.0 (2019-11-08)

  • mdBook from v0.3.2 on deletes the book output directory when rendering starts, causing all generated preprocessor output to be deleted too. The only workaround at the moment is outputting the images to the src directory. This is ugly, but a temporary solution until mdBook allows for other ways of adding resources from a preprocessor. See this issue
  • More thorough README.md

0.4.0 (2019-09-25)

  • PlantUML server support, woot!
  • Fixed issue where all markdown after the first PlantUML image was not rendered anymore (preprocessors cannot output HTML apparently).
  • Images in nested chapters now have the correct URL (thanks @rafasf).
  • Allow logging to file to troubleshoot preprocessor issues.

0.3.0 (2019-08-29)

  • Generate SVG image files rather than inline svg
  • For ditaa images revert to png, because PlantUML does not support svg for ditaa diagrams (issue #9)

0.2.0 (2019-07-08)

  • Generated SVG image is now wrapped in a div with class type 'plantuml'
  • More detailed error information when SVG generation failed (including a hint for a possible cause).

0.1.0 (2019-07-08)

  • First version

Building and installing on Linux

I primarily work on Windows, and rust is not that portable yet apparently.

When you get the following error while installing/building mdbook-plantuml on Linux:

failed to run custom build command for `openssl-sys v0.9.49`

Make sure you have libssl-dev and pkg-config installed:

sudo apt update
sudo apt install libssl-dev pkg-config
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].