-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing tabbed-set label placement for cases where alternative renderers keep the HTML element order #2420
Conversation
This addition will break documentation for people, even MkDocs Material, without them adding some new CSS. Additionally, I don't think you've really made clear what you are "fixing" either. Can you demonstrate with some images or something showing what the change is? |
… second alternate style.
Noticing the extra space the hidden div adds. It shouldn't do that and I can't find a way to make it not add that space, so I added a |
Unfortunately, you are claiming that export to PDF messes up tabs when printing, but I am not finding that true. I exported a site to PDF with absolutely no issues here. Maybe you are claiming a specific PDF exporter is having trouble? But I'm not sure we should break documents because one exporter has trouble. |
What PDF export tools/plugins did you use for that? |
Browsers seem to print to PDF just fine. |
Right, that's the Print View. But that doesn't work well when you need to print multiple pages with a cover page and table of contents. That's what Weasyprint and RelaxedJS can do, but some things end up rendered differently even when using headless Chrome as a generator. |
Is that an "pymdownx" problem or a "Weasyprint" problem? This injects unnecessary HTML elements that will break other documentation. Yes, they can add additional CSS to hide them, but what you are suggesting is a hack for this specific PDF exporter. |
I will add, if there is a specific need for this, a workaround mkdocs plugin could be crafted to post process the content and add such elements. I would recommend going this route as a work around. If/when this is resolved in the exporter, the required mkdocs plugin could be retired. |
For anyone else who happens to needs this:
|
Adding hidden alt-style tabbed-set labels to the top of tabbed-blocks
.tabbed-labels
to make replicating that CSS easier.hidden
attribute on the new label's div wrapper because so it can easily be overridden by CSS and doesn't alter the existing appearance.aria-hidden: false
doesn't counteractdisplay: none
for AT, so I didn't add that. Such would likely need to be another, separate solution.Scenario:
I'm working with Material for MkDocs using the alternate tabbed style. I also use domWalter's continuation of the mkdocs-with-pdf plugin using RelaxedJS. When exporting to PDF, tabbed-sets would print all the tab labels at the top followed by the tabbed-contents, just like it is in HTML despite the web browser's print view showing differently. So this is my fix for this - essentially creating something closer to the standard tabbed style for use only with
@media print
.