Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Sergey (onixpro) is the original creator of this plugin. Repo can be found here.
This plugin enables you to embed interactive drawio diagrams in your documentation. Simply add your diagrams like you would any other image:
You can either use diagrams hosted within your own docs. Absolute as well as relative paths are allowed:
Absolute path:
![](/assets/my-diagram.drawio)
Same directory as the markdown file:
![](my-diagram.drawio)
Relative directory to the markdown file:
![](../my-diagram.drawio)
Or you can use external urls:
![](https://example.com/diagram.drawio)
Additionally this plugin supports multi page diagrams by using the alt
text to select the pages by name:
![Page-2](my-diagram.drawio)
![my-custom-page-name](my-diagram.drawio)
Install plugin using pip:
pip install mkdocs-drawio
Add the plugin to your mkdocs.yml
plugins:
- drawio
By default the plugin uses the official url for the minified drawio javascript library. To use a custom source for the drawio viewer you can overwritte the url. This might be useful in airlocked environments.
If you want to use a self-hosted JavaScript viewer file. You should download the latest version from the official drawio repo.
plugins:
- drawio:
viewer_js: "https://viewer.diagrams.net/js/viewer-static.min.js"
Further options are:
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)
border: 10 # increase or decrease the border / margin around your diagrams (default: 5)
If you are using the Material Theme and want to use the instant-loading feature. You will have to configure the following:
In your mkdocs.yaml
:
theme:
name: material
features:
- navigation.instant
plugins:
- drawio
extra_javascript:
- https://viewer.diagrams.net/js/viewer-static.min.js
- javascripts/drawio-reload.js
Add docs/javascripts/drawio-reload.js
to your project:
document$.subscribe(({ body }) => {
GraphViewer.processElements()
})
mkdocs-drawio
attaches to the on_post_page
event. For more details, please have a look at the event lifecycle documentationimg
tags that have a source of type .drawio
img
tags with mxgraph
html blocks (actual drawio diagram content). For more details, please have a look at the official drawio.com documentation.pip install -e .
example
directorymkdocs serve
in the example
directorypyproject.toml
FAQs
MkDocs plugin for embedding Drawio files
We found that mkdocs-drawio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.