I recently started converting a set of messy .HTML files to MarkDown and am using MkDocs to build the web pages. Works great. I just tried using mkdocs-to-pdf to convert everything to .pdf and that is also just amazing too, but not without some glitches. The first of these is pretty serious to me, as there is math content that if not included leaves the text pretty useless. The remaining two I can live with, but mention in case they are easily addressed.
-
I can't get any of my MathJax content to be rendered. I have attached my .yml file here and the output from mkdocs (I'm running this on GitHub actions) is below. There is an error that appears to be from the equation rendering process, but I can't make any sense of it. The MD content is all at https://github.com/AdvancedPhotonSource/GSAS-II-tutorials/tree/main/MDhelp, FWIW.
-
The pagination is a bit weird. I expect to see a new page for every web page, but the placement of page breaks seems pretty random. There are a number of places where page breaks are inserted in the .pdf that leave only a few lines of text on the page. In the worst case, a single .html file that should probably fit on <1.5 pages, is spread out over 4 pages: 4 lines of text on the 1st, 1 line on the 2nd, 7 lines on the 3rd and the remainder on the 4th.
-
I'm not getting exclude_pages to work. The page I want to exclude is still included.
mkdocs.yml.txt
GitHub Actions output:
Run cd MDhelp
cd MDhelp
mv mkdocs.yml_pdf mkdocs.yml
#mkdocs build
ENABLE_PDF_EXPORT=1 mkdocs build
# mv site/GSASII-help.pdf ...
#cp -vr site ../help_test
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.13.5/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.5/x64/lib
INFO - mkdocs_static_i18n: Building 'en' documentation to directory: /home/runner/work/GSAS-II-tutorials/GSAS-II-tutorials/MDhelp/site
INFO - Cleaning site directory
INFO - Building documentation to directory: /home/runner/work/GSAS-II-tutorials/GSAS-II-tutorials/MDhelp/site
INFO - Number headings up to level 3.
INFO - Generate a table of contents up to heading level 2.
INFO - Generate a cover page with "default_cover.html.j2".
INFO - Converting <img> alignment(workaround).
INFO - Rendering on `Headless Chrome`(execute JS).
[2173:2200:0721/161553.553233:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2200:0721/161553.553520:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2200:0721/161553.553541:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2200:0721/161553.553555:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2200:0721/161554.842724:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2200:0721/161557.370788:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2173:0721/161600.947918:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2173:0721/161601.010987:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2200:0721/161601.011075:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2200:0721/161601.011094:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2173:0721/161601.012108:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2173:0721/161601.123756:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2173:0721/161601.123866:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2200:0721/161601.123902:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2269:0721/161601.125126:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2173:2269:0721/161601.125358:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2173:2269:0721/161601.125624:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2173:2173:0721/161601.151551:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2190:0721/161605.850681:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2173:0721/161606.043339:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2190:0721/161606.043448:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2173:0721/161606.051466:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2190:0721/161606.051540:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2173:0721/161606.053478:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2190:0721/161606.053594:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2173:0721/161606.060279:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2190:0721/161606.060357:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2173:2173:0721/161606.106212:ERROR:dbus/object_proxy.cc:590] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type:
[2173:2200:0721/161608.831921:ERROR:google_apis/gcm/engine/mcs_client.cc:700] Error code: 401 Error message: Authentication Failed: wrong_secret
[2173:2200:0721/161608.831942:ERROR:google_apis/gcm/engine/mcs_client.cc:702] Failed to log in to GCM, resetting connection.
[2173:2200:0721/161608.835549:ERROR:google_apis/gcm/engine/registration_request.cc:291] Registration response error message: DEPRECATED_ENDPOINT
INFO - Rendering for PDF.
INFO - Output a PDF to "/home/runner/work/GSAS-II-tutorials/GSAS-II-tutorials/MDhelp/site/GSASII-help.pdf".
INFO - Converting 41 articles to PDF took 43.6s
INFO - Documentation built in 44.27 seconds
I recently started converting a set of messy .HTML files to MarkDown and am using MkDocs to build the web pages. Works great. I just tried using mkdocs-to-pdf to convert everything to .pdf and that is also just amazing too, but not without some glitches. The first of these is pretty serious to me, as there is math content that if not included leaves the text pretty useless. The remaining two I can live with, but mention in case they are easily addressed.
I can't get any of my MathJax content to be rendered. I have attached my .yml file here and the output from mkdocs (I'm running this on GitHub actions) is below. There is an error that appears to be from the equation rendering process, but I can't make any sense of it. The MD content is all at https://github.com/AdvancedPhotonSource/GSAS-II-tutorials/tree/main/MDhelp, FWIW.
The pagination is a bit weird. I expect to see a new page for every web page, but the placement of page breaks seems pretty random. There are a number of places where page breaks are inserted in the .pdf that leave only a few lines of text on the page. In the worst case, a single .html file that should probably fit on <1.5 pages, is spread out over 4 pages: 4 lines of text on the 1st, 1 line on the 2nd, 7 lines on the 3rd and the remainder on the 4th.
I'm not getting exclude_pages to work. The page I want to exclude is still included.
mkdocs.yml.txt
GitHub Actions output: