A MkDocs plugin that generates a obsidian like interactive graph
Project description
Interactive Graph for Material for MkDocs
Plugin for Material for MkDocs to draw an interactive graph like Obsidian. The graph inside the sidebar is just available for non-mobile website. The modal view via the button next to the light/dark mode switch shall work on all devices.
Refer Github Pages for a demonstration of the interactive graph in Material for MkDocs.
Installation
Available on PyPI.
Install via pip install mkdocs-obsidian-interactive-graph-plugin or add it to your requirements.txt.
Usage
Setup in MkDocs
Activate the plugin in mkdocs.yml, but note that this plugin has to be located before plugins, that replace wikilinks by markdown links. Currently just wikilinks like [[Link#Anchor|Custom Text]] are supported.
plugins:
- obsidian-interactive-graph
extra_javascript:
- https://fastly.jsdelivr.net/npm/jquery/dist/jquery.min.js
- https://fastly.jsdelivr.net/npm/echarts/dist/echarts.min.js
- assets/javascripts/interactive_graph.js
extra_css:
- assets/stylesheets/interactive_graph.css
Graph Javascript by Apache ECharts
A interactive_graph.js example can be downloaded from here and must be located into the docs directory under docs/YourSiteName/assets/javascripts/interactive_graph.js.
Beginning from version 0.3.0 the default graph inside the sidebar was minimized to edges related to the current page only. The previous behavior can be restored by setting global to true at line draw_graph_sidebar(myChart, global=false) at top of javascript file.
Docker
Adapt the .env and mkdocs.yml files to your needs. DEV=ON will rebuild the mkdocs-obsidian-interactive-graph-plugin from local files. If DEV != ON the upstream packages of PyPI will be used. Build and start the Docker container via docker compose up --build [-d].
Limitations
There is a bug in ECharts library in pinch to zoom feature (https://github.com/apache/echarts/pull/21068), but it seems like they will not fix it. Anybody can fix it by its own, by downloading the current version of the javascript library and patching via diff of the pull-request and use this in the mkdocs configuration. May another good idea could be, to not use the ECharts library... There is another project like this, that uses D3 library instead of ECharts: https://github.com/develmusa/mkdocs-network-graph-plugin including some more improvements.
References
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 mkdocs_obsidian_interactive_graph_plugin-0.3.2.tar.gz.
File metadata
- Download URL: mkdocs_obsidian_interactive_graph_plugin-0.3.2.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86b1874df9b207d04cf66d61e2519a68c53adf1a53c89b6c8d1ee11283c121f0
|
|
| MD5 |
40fc7be295c675646abcc89b096fe7bf
|
|
| BLAKE2b-256 |
a7f53c8b23adf13c84221f29a0fe80c29bca0056713fb086b729eb366cd30e9e
|
Provenance
The following attestation bundles were made for mkdocs_obsidian_interactive_graph_plugin-0.3.2.tar.gz:
Publisher:
ci.yml on daxcore/mkdocs-obsidian-interactive-graph-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_obsidian_interactive_graph_plugin-0.3.2.tar.gz -
Subject digest:
86b1874df9b207d04cf66d61e2519a68c53adf1a53c89b6c8d1ee11283c121f0 - Sigstore transparency entry: 936628227
- Sigstore integration time:
-
Permalink:
daxcore/mkdocs-obsidian-interactive-graph-plugin@a55894ce859fc1670975bc5a84b6d1bac2b4f093 -
Branch / Tag:
refs/tags/0.3.2 - Owner: https://github.com/daxcore
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@a55894ce859fc1670975bc5a84b6d1bac2b4f093 -
Trigger Event:
push
-
Statement type: