All Projects → christo-ph → mkdocs_build_plantuml

christo-ph / mkdocs_build_plantuml

Licence: MIT license
MkDocs plugin to help generate your plantuml images locally or remotely as files (NOT inline)

Programming Languages

python
139335 projects - #7 most used programming language
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to mkdocs build plantuml

plantuml2mysql
This utility parses PlantUML class diagram and generates SQL DDL for MySQL
Stars: ✭ 110 (+254.84%)
Mutual labels:  plantuml, uml-diagram
dcdg.dart
Dart Class Diagram Generator
Stars: ✭ 98 (+216.13%)
Mutual labels:  plantuml, uml-diagram
PlantUml-Language-Service
PlantUml Language Service extension for Visual Studio 2017 and 2019
Stars: ✭ 24 (-22.58%)
Mutual labels:  plantuml, uml-diagram
salesforce-plantuml
Salesforce app to generate UML class & ER-diagrams from your org data. Leverages the PlantUML library.
Stars: ✭ 89 (+187.1%)
Mutual labels:  plantuml, uml-diagram
IPlantUML
A Python package which defines a PlantUML cell magic for IPython.
Stars: ✭ 85 (+174.19%)
Mutual labels:  plantuml, uml-diagram
swagger2puml
Generate Class Diagrams (UML) for Given Swagger Definition
Stars: ✭ 43 (+38.71%)
Mutual labels:  plantuml, uml-diagram
PlantUML-colors
This script is to show all named color suggested by PlantUML
Stars: ✭ 52 (+67.74%)
Mutual labels:  plantuml, uml-diagram
mkdocs-static-i18n
MkDocs i18n plugin using static translation markdown files
Stars: ✭ 78 (+151.61%)
Mutual labels:  mkdocs
DietPi-Docs
Source repository for the DietPi OS documentation
Stars: ✭ 74 (+138.71%)
Mutual labels:  mkdocs
papers reading sharing.github.io
Sites to share deep learning related papers and their digests
Stars: ✭ 32 (+3.23%)
Mutual labels:  mkdocs
mkdocs-git-revision-date-localized-plugin
MkDocs plugin to add a last updated date to your site pages
Stars: ✭ 73 (+135.48%)
Mutual labels:  mkdocs
mkdocs-exclude-search
🔎 A mkdocs plugin that lets you exclude selected chapters from the search index.
Stars: ✭ 16 (-48.39%)
Mutual labels:  mkdocs
uml-editor
Browser-based UML Editor
Stars: ✭ 34 (+9.68%)
Mutual labels:  uml-diagram
plant erd
ERD exporter with PlantUML and mermaid format
Stars: ✭ 126 (+306.45%)
Mutual labels:  plantuml
Documentation
Kodular Documentation
Stars: ✭ 41 (+32.26%)
Mutual labels:  mkdocs
docutools
Dev Centric Tools for Mkdocs Based Documentation
Stars: ✭ 13 (-58.06%)
Mutual labels:  mkdocs
thegreatmarkdown
《了不起的 Markdown》
Stars: ✭ 44 (+41.94%)
Mutual labels:  mkdocs
smeagol-galore
A git-based wiki featuring markdown, a WYSIWYG Editor, PlantUML, and much more
Stars: ✭ 21 (-32.26%)
Mutual labels:  plantuml
cheatsheets
John's Cheatsheets
Stars: ✭ 22 (-29.03%)
Mutual labels:  mkdocs
hexo-filter-plantuml
Using PlantUML to generate UML Diagram for hexo
Stars: ✭ 23 (-25.81%)
Mutual labels:  plantuml

PyPI - Downloads

MkDocs-Build-Plantuml-Plugin

This plugin builds your Plantuml image files with mkdocs serve automatically.

My intend was, that I do not like inline diagrams and stumbled upon issues like non-working !includes.

Note: if you want inline diagrams in your Markdown files like

```plantuml
Alice -> Bob
```

this is plugin is not the right one. Please check out plantuml-markdown which does exactly that.

Prerequesites

You need to have installed

  • Python3
  • MkDocs
  • Java for Plantuml (if running locally)
  • Plantuml (if running locally)
  • This plugin (needs httplib2 for server rendering)

On OSX you can install plantuml with homebrew which puts a plantuml executable in /usr/local/bin/plantuml.

Installation

pip3 install mkdocs-build-plantuml-plugin

Usage

Plugin Settings

In mkdocs.yml add this plugin section (depicted are the default values):

plugins:
  - search
  - build_plantuml:
      render: 'server' # or "local" for local rendering
      bin_path: '/usr/local/bin/plantuml' # ignored when render: server
      server: 'http://www.plantuml.com/plantuml' # offical plantuml server
      disable_ssl_certificate_validation: true # for self-signed and invalid certs
      output_format: 'svg' # or "png"
      diagram_root: 'docs/diagrams' # should reside under docs_dir
      output_folder: 'out'
      input_folder: 'src'
      input_extensions: '' # comma separated list of extensions to parse, by default every file is parsed

It is recommended to use the server option, which is much faster than local.

Example folder structure

This would result in this directory layout:

docs/                         # the default MkDocs docs_dir directory
  diagrams/
    include/                  # for include files like theme.puml etc (optional, won't be generated)
    out/                      # the generated images, which can be included in your md files
      subdir1/file1.svg       # you can organise your diagrams in subfolders, see below
      file.svg
    src/                      # the Plantuml sources
      subdir1/file1.puml
      subdir2/
      file.puml
mkdocs.yml                    # mkdocs configuration file

When starting with mkdocs serve, it will create all diagrams initially.

Afterwards, it checks if the *.puml (or other ending) file has a newer timestamp than the corresponding file in out. If so, it will generate a new image (works also with includes). This way, it won‘t take long until the site reloads and does not get into a loop.

Including generated images

Inside your index.md or any other Markdown file you can then reference any created image as usual:

# My MkDocs Document

## Example Plantuml Images

![file](diagrams/out/file.svg)

![file1](diagrams/out/subdir1/file1.svg)

Dark Mode Support with >=1.4 (prefers-color-scheme)

Since Version 1.4 this plugin can support dark mode when rendering with server.

Note: Not in local mode, only server rendering mode

  1. Grab a general (ie. for Material Theme) dark mode support css file (i.e. from henrywhitaker3/mkdocs-material-dark-theme) for your theme

  2. Enable theme support in this plugin:

    - build_plantuml:
        [...]
        theme_enabled: true
        theme_folder: "include/themes"
        theme_light: "light.puml"
        theme_dark: "dark.puml"
    
  3. You have to provide two puml theme files, ie mydarkmode.puml and mylightmode.puml

  4. In the out directory a <file>.<ext> will be created and additionally a <file>_dark.<ext>

  5. Insert your images in markdown with ![file](diagrams/out/file.svg#darkable) (this selector is then used in the JS file to know which images have to be exchanged)

  6. provide extra_javascript file which handles the switch

You can find an example in the example folder

Example Output

DarkMode

Known restrictions

  • If you use !includes and the render: "server" option, this plugin merges those files manually. If there are any issues or side effects because of that, please open a ticket.
  • Dark mode / theme support is currently only available in server rendering mode.
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].