question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Printing with `pymdownx.details` enabled breaks page margins

See original GitHub issue

Printing with

markdown_extensions:
  - pymdownx.details

image

and without:

image

Steps to reproduce the bug

# mkdocs.yml
site_name: My Docs

theme:
  name: material

markdown_extensions:
  - pymdownx.details

docs/index.md

# Welcome to MkDocs

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent rutrum erat quis odio rhoncus, eget tempus odio iaculis. Donec id ante metus. Maecenas bibendum, nibh vitae malesuada sollicitudin, urna quam bibendum dolor, non convallis lectus est non dui. Duis tristique quam tellus, eu sagittis turpis finibus vel. Donec id aliquam sem, nec feugiat mauris. Nullam at lacinia nisi. Sed ac risus ultricies, tempor ligula in, varius lacus. Praesent tortor metus, placerat in tortor eu, lacinia cursus elit. Vivamus gravida velit et velit mollis cursus. Quisque fermentum iaculis diam eu viverra. Nulla tincidunt imperdiet tellus, ut fringilla enim congue ut. Ut sed nisi sollicitudin, gravida massa id, placerat mi. Morbi vel mauris magna. Etiam cursus ut lectus nec faucibus. Nulla elementum quam vitae mi aliquam, vel ornare ipsum euismod. In hac habitasse platea dictumst.

??? success
    Content.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent rutrum erat quis odio rhoncus, eget tempus odio iaculis. Donec id ante metus. Maecenas bibendum, nibh vitae malesuada sollicitudin, urna quam bibendum dolor, non convallis lectus est non dui. Duis tristique quam tellus, eu sagittis turpis finibus vel. Donec id aliquam sem, nec feugiat mauris. Nullam at lacinia nisi. Sed ac risus ultricies, tempor ligula in, varius lacus. Praesent tortor metus, placerat in tortor eu, lacinia cursus elit. Vivamus gravida velit et velit mollis cursus. Quisque fermentum iaculis diam eu viverra. Nulla tincidunt imperdiet tellus, ut fringilla enim congue ut. Ut sed nisi sollicitudin, gravida massa id, placerat mi. Morbi vel mauris magna. Etiam cursus ut lectus nec faucibus. Nulla elementum quam vitae mi aliquam, vel ornare ipsum euismod. In hac habitasse platea dictumst.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent rutrum erat quis odio rhoncus, eget tempus odio iaculis. Donec id ante metus. Maecenas bibendum, nibh vitae malesuada sollicitudin, urna quam bibendum dolor, non convallis lectus est non dui. Duis tristique quam tellus, eu sagittis turpis finibus vel. Donec id aliquam sem, nec feugiat mauris. Nullam at lacinia nisi. Sed ac risus ultricies, tempor ligula in, varius lacus. Praesent tortor metus, placerat in tortor eu, lacinia cursus elit. Vivamus gravida velit et velit mollis cursus. Quisque fermentum iaculis diam eu viverra. Nulla tincidunt imperdiet tellus, ut fringilla enim congue ut. Ut sed nisi sollicitudin, gravida massa id, placerat mi. Morbi vel mauris magna. Etiam cursus ut lectus nec faucibus. Nulla elementum quam vitae mi aliquam, vel ornare ipsum euismod. In hac habitasse platea dictumst.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent rutrum erat quis odio rhoncus, eget tempus odio iaculis. Donec id ante metus. Maecenas bibendum, nibh vitae malesuada sollicitudin, urna quam bibendum dolor, non convallis lectus est non dui. Duis tristique quam tellus, eu sagittis turpis finibus vel. Donec id aliquam sem, nec feugiat mauris. Nullam at lacinia nisi. Sed ac risus ultricies, tempor ligula in, varius lacus. Praesent tortor metus, placerat in tortor eu, lacinia cursus elit. Vivamus gravida velit et velit mollis cursus. Quisque fermentum iaculis diam eu viverra. Nulla tincidunt imperdiet tellus, ut fringilla enim congue ut. Ut sed nisi sollicitudin, gravida massa id, placerat mi. Morbi vel mauris magna. Etiam cursus ut lectus nec faucibus. Nulla elementum quam vitae mi aliquam, vel ornare ipsum euismod. In hac habitasse platea dictumst.

Local

  • Python: Python 3.8.5

  • MkDocs: version 1.1.2

  • Material: 7.1.3

  • MacOS

  • Chrome

Details

  • I checked & this bug does not occur in the base mkdocs theme
  • For printing, all detail / admonitions need to be uncollapsed in order to show the contents.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
squidfunkcommented, May 15, 2021

Potential fix in 920f11cf6. I had to look into it again and realized that when we remove the print media query from the events triggering the expansion, the error goes away. I hope that this still satisfies all browsers, and I’ve tested it with success in Chrome and Safari so maybe it was fixed in newer versions.

1reaction
timvinkcommented, May 10, 2021

Possibly related to an update in material v7, a user figured out this one: https://github.com/timvink/mkdocs-print-site-plugin/issues/47:

  • last v6 (6.2.8) works
  • version 7.0.0 is the first one showing the problem and it is there in all subsequent versions.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Margins Incorrect when Printing - Word Ribbon Tips
Although the page setup reflects the appropriate margins, the margins are greater when printed. They also appear irregular and greater in the print...
Read more >
how to fix margin printing error on letter when preceding ...
I'm using MS Word 2010. My #10 envelope prints correctly. The connected/following letter only prints the left half of the page. The margins...
Read more >
Material for MkDocs - GitHub
Fixed broken page title when h1 contained HTML tags. Improved accessibility for IE users ... Fixed #869: Automatically expand details before printing.
Read more >
{pagedown} Page Size & Margins - datawookie
The {pagedown} package has become invaluable. This is a short note showing how we tweak the page size and margins for PDF documents....
Read more >
mkdocs-print-site-plugin: Versions - Openbase
Reverts: Raise error when pymdownx.details markdown extension is enabled in ... pymdownx.details from documentation website as it will break the printing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found