tact-docs
tact-docs copied to clipboard
CI: Auto-export docs to PDF
And provide links to the resulting files from the index page and from the sidebar.
Links to explore:
- https://github.com/jean-humann/docs-to-pdf
- https://github.com/simonhaenisch/md-to-pdf
- https://github.com/withastro/starlight/discussions/964
- https://www.npmjs.com/package/html-export-pdf-cli
- https://wkhtmltopdf.org/
- https://pandoc.org/
Rough implementation pipeline (steps 4-6 may be delegated to an existing solution, if any):
- A secondary build, which would change all the pages to have
template: splashin the frontmatter (via a small remark plugin) - Get a list and names of html pages from the
sidebarproperty inastro.config.mjs - Strip each .html file of the top bar and table of contents on the right
- Convert each .html file to .pdf individually, obtaining the number of pages occupied
- Then, construct table of contents using data from steps 3 and 4
- Finally, combine all individual .pdf pages into one big .pdf and place it into
public/ - In the primary build, add the links to it onto the index page and from the sidebar (alternative solution would be to put them in the footer or top bar)