Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ plugins:
- drawio:
toolbar: true # control if hovering on a diagram shows a toolbar for zooming or not (default: true)
tooltips: true # control if tooltips will be shown (default: true)
edit: true # control if edit button will be shown in the lightbox view (default: true)
border: 10 # increase or decrease the border / margin around your diagrams (default: 5)
```

Expand Down
3 changes: 3 additions & 0 deletions example/docs/tests/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ You should be able to use the `tooltips: true|false` config flag in your `mkdocs

You should be able to see a mathematical expressions properly rendered:
![](math.drawio)


You should be able to use the `edit: true|false` config flag in your 'mkdocs.yml' to control if the edit button will be shown in the lightbox view of your diagrams.
1 change: 1 addition & 0 deletions example/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ plugins:
- drawio:
toolbar: true
tooltips: true
edit: true
border: 20
- print-site

Expand Down
3 changes: 2 additions & 1 deletion mkdocs_drawio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class DrawioPlugin(BasePlugin):
("toolbar",mkdocs.config.config_options.Type(bool, default=True)),
("tooltips",mkdocs.config.config_options.Type(bool, default=True)),
("border",mkdocs.config.config_options.Type(int, default=0)),
("edit", mkdocs.config.config_options.Type(bool, default=True)),
)

def on_post_page(self, output_content, config, page, **kwargs):
Expand All @@ -50,7 +51,7 @@ def render_drawio_diagrams(self, output_content, page):
"tooltips": "1" if plugin_config["tooltips"] else "0",
"border": plugin_config["border"] + 5,
"resize": "1",
"edit": "_blank",
"edit": "_blank" if plugin_config["edit"] else None,
}

# search for images using drawio extension
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mkdocs-drawio"
version = "1.7.0"
version = "1.8.0"
description = "MkDocs plugin for embedding Drawio files"
authors = [
"Jan Larwig <jan@larwig.com>",
Expand Down
Loading