Comments (7)
Works like expected. Thank you @timvink , @tuunit !! ❤️
from mkdocs-print-site-plugin.
First of all: Cool plugin @timvink , I like it!
Thanks!
What needs to be done in order to see drawio content at /print_page/?
First of all, I noticed that mkdocs-drawio-file
is not maintained anymore, and there is a new version mkdocs-drawio
.
I had a quick look at the source code of mkdocs_drawio/
(https://github.com/tuunit/mkdocs-drawio/blob/main/mkdocs_drawio/plugin.py). The main hook is on_post_page()
.
This plugin saves the HTML before any template is applied, during the on_page_content
event. Then on the on_post_build
event, we combine the HTMLs of all the page and then apply the templating (template styling basically).
If you look at the mkdocs documentation for plugins, you can see the diagram for the order of plugins events
This should clarify it:
So the processing by the mkdocs_drawio
is skipped. The solution is to add the post processing to the HTML of the print-site page explicitly, like we do for some other plugins:
mkdocs-print-site-plugin/mkdocs_print_site_plugin/plugin.py
Lines 353 to 358 in a648cff
Would you be willing to look into making a PR?
Perhaps @tuunit can chip in also? Because it would help if the mkdocs-drawio
plugin would have a single function that is not dependent on self
. Something like replace_drawio(html: str, path: Path, viewer_js_url: str) -> str
. Then we can use that in this plugin
from mkdocs-print-site-plugin.
@timvink @hafeja I just released a new version 1.6.0 of mkdocs-drawio
and opened the PR #100 to introduce the rendering support of the diagrams on the /print_page/
endpoint
from mkdocs-print-site-plugin.
Thanks for the hint that https://pypi.org/project/mkdocs-drawio/ supersedes https://pypi.org/project/mkdocs-drawio-file/!
Would you be willing to look into making a PR?
If I was skilled enough, I would ;-) Therefore, I like your idea to kindly ask @tuunit for professional support.
from mkdocs-print-site-plugin.
Hi together,
sorry for the late reply. Unfortunately all notifications from this thread have been wrongly filtered away by a misconfigured email filter. Thats on me, I'll have a look at the proposed changes and compatibility in the upcoming days.
from mkdocs-print-site-plugin.
Should be fixed with #100
from mkdocs-print-site-plugin.
released v2.4.0 to pypi
from mkdocs-print-site-plugin.
Related Issues (20)
- Excluding directory does not exclude submenu
- Plugin breaks site base URL configuration with Material theme HOT 1
- Use the new plugin priority system to ensure this plugin is last
- How to set path_to_pdf as specified dir that not in docs HOT 6
- Please add support for Read the Docs theme HOT 1
- Sections with sub-sections not correctly rendered in sidebar TOC HOT 1
- Print_site_banner doesn't work when site has base url HOT 2
- :bug: MkDocs 1.5.1, Material 9.1.21, Python 3.11 and Extra JavaScript Traceback
- Missing left toc and search panel HOT 4
- Can not ignore title with print-site-plugin-ignore HOT 5
- Add support for tags HOT 2
- Fix deprecation warning on `warning_filter` HOT 1
- Use frontmatter `title` in place of level 1 heading for TOC and heading enumeration HOT 3
- Image/diagram exports or transformations made by other plugin(s) not included as expected (mkdocs-drawio-exporter) HOT 4
- Toc inclusion not fully documented HOT 3
- Option to add page numbers to footer and TOC HOT 2
- Print-site and privacy plugin HOT 2
- Does this plugin work with Python 3.12? HOT 7
- Plugin is not found after following installation instructions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs-print-site-plugin.