Comments (5)
I'm not sure I understand why you didn't have it.. print-site should add the CSS by default for you.
Because I have include_css: false
. I have it because I needed this:
@media print {
#print-site-banner {
display: none;
}
}
.nav-section-title-end,
.nav-section-title,
.toc-nav-section-title-level-2,
.toc-nav-section-title-level-3,
.toc-nav-section-title-level-4 {
display: none;
}
add_print_site_banner
for some reason didn't work for me back when I used this, and other things are just something I needed for my particular case.
You can't return early
I suspected that, but wanted to ask anyway in case I missed something.
Thanks a lot for the answers. Everything is working perfectly now.
from mkdocs-print-site-plugin.
Indeed, that should work. Here's the CSS that should be injected:
mkdocs-print-site-plugin/mkdocs_print_site_plugin/css/print-site.css
Lines 136 to 160 in f99ea63
The class should make sure the content is not displayed on the HTML print page, and not displayed when you print a page.
Some things I should investigate:
It might be that the CSS hierarchy is not working in this bit:
mkdocs-print-site-plugin/mkdocs_print_site_plugin/css/print-site.css
Lines 136 to 137 in f99ea63
Could also be that the CSS injection is not working properly.
Lastly, there could be conflicting HTML. Perhaps I should add !important
to the CSS classes to make sure they override other styling.
from mkdocs-print-site-plugin.
I tested locally and can exclude the first two, seems to be working alright.
Do you have a live example I can see?
from mkdocs-print-site-plugin.
Yeah, it works with this CSS you provided. I didn't have it. Thank you.
Regarding the other question, do you have a comment on it ?
BTW, I want to ignore generated parts of the page which I inject via python function via plugin macros. I am having this function call in footer of page:
{{ include( page, 'txt', 'Primer podataka', '.print-site-plugin-ignore') }}
As an alternative to adding the class, is there any way I can return from this function early if I detect the page is being rendered by the print site ?
from mkdocs-print-site-plugin.
Yeah, it works with this CSS you provided. I didn't have it. Thank you.
I'm not sure I understand why you didn't have it.. print-site should add the CSS by default for you. Perhaps that was not working for you, could be because of a path issue from the plugin..
As an alternative to adding the class, is there any way I can return from this function early if I detect the page is being rendered by the print site ?
You can't return early. the print site is mostly an on_post_build
step, that needs all the completed pages and then combines them into an additional, separate single page. The function from mkdocs-macros would still only be called once.
from mkdocs-print-site-plugin.
Related Issues (20)
- Print-site and privacy plugin HOT 2
- Exporting to HTML question HOT 4
- If print-site step takes >10s raise a warning
- 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
- 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
- Drawio content is missing in printed export HOT 7
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.