-
Notifications
You must be signed in to change notification settings - Fork 178
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
Disable undesired plugins for Athena pdf print #467
Comments
All HTML plugins are activated using Pandoc's rootstock/build/pandoc/defaults/html.yaml Lines 8 to 26 in 9a22fab
So no HTML plugins are applied to DOCX or LaTeX outputs. Whether they're included in PDF exports depends, since we have two methods for creating PDF: Athena & Weasyprint.
For Athena, all the HTML-activated plugins are activate at print time. For Weasyprint, since we have a separate Pandoc command, none of the HTML plugins are injected.
Printing the webpage directly seems like a somewhat common user flow, so isn't that something we should continue to support? Or perhaps just support when possible unless there is a hard-to-debug issue like greenelab/covid19-review#1133. Also might we want some plugins to be included in the PDF output. For example the scite badges of citation counts might be nice to show in the references section? If we want to disable HTML plugins for PDF generation, we'd want to adopt a separate pandoc workflow (like we have with weasyprint). I think this issue is largely dependent on whether we continue to use Athena for PDF generation. When we first adopted Athena, it solved a lot of issues. However, it is no longer maintained. We've considered switching to paged-js #394 which has some unfixed blockers. Here's the full list of what Pandoc currently supports for pdf-engine: pdflatex, lualatex, xelatex, latexmk, tectonic, wkhtmltopdf, weasyprint, pagedjs-cli, prince, context, and pdfroff. And only a subset go through HTML: wkhtmltopdf, weasyprint, pagedjs-cli, prince (not open source). The pandoc docs mention https://print-css.rocks/. Summary:
|
You're right, we cannot get rid of the print media querying in the CSS. I forgot that people will likely want to be able to print from the HTML manuscript. I wasn't thinking that through. Regarding the plugins enabled for Athena and Weasy, to me these seem to be the only ones a user could potentially want:
I guess the decision of whether to make a new workflow for Athena or drop it completely is up to you guys. It does make me wary that it's unmaintained, but I'm also not sure paged-js is a good enough alternative yet (it's a very complex problem to solve). But if the source of greenelab/covid19-review#1133 ends up being an Athena bug, then I'd have a stronger recommendation. |
Currently, I have a significant amount of CSS, and I believe a few lines of JS, to disable the functionality and appearance of plugins when printing a manuscript. Instead of managing all of these custom styles and such, it seems better to cut things off at the source:
Simply disable all (or almost all? maybe leave mathjax?) plugins by default in the PDF and DOCX config. The plugins are meant for interactive functionality and don't belong there anyway. Then I could get rid of a lot of these unneeded lines, making things easier to maintain. There would also be no question whether the plugins are being disabled/hidden properly; they're not even included at all.
I'm not sure why I didn't do this in the first place. Maybe at first we didn't have separate configs for each output format? If I'm misremembering something that makes this not viable let me know.
Related to: greenelab/covid19-review#1133
The text was updated successfully, but these errors were encountered: