Repository navigation
manuscrio-pdf: export a built Docusaurus site to PDF manuals, plus llms.txt #13101
I make this, so to be upfront: Manuscrio is commercial, self-hosted software. It runs without a licence in an evaluation mode that watermarks the PDFs, and the llms command described below is free. Following the suggestion on [#12643](#12643), I'm sharing it here.
manuscrio-pdf reads the build directory that docusaurus build produces and turns it into PDF manuals. It doesn't need a plugin in your site, access to your source, or a running server.
npx manuscrio-pdf inspect ./build # list the manuals this build contains npx manuscrio-pdf export ./build # one PDF per version and locale
It runs in a container, so you need Docker or Podman. The npm command just starts the container for you.
What it does with a Docusaurus build
- Versions, locales and plugin instances. Each combination becomes its own manual, so a site with two versions in three languages gives six PDFs and never mixes them.
- Navbar sections.
--scope sectiongives one PDF per documentation navbar entry, for example a short API volume separate from a long Docs one.--scope sidebar-rootsplits further, by sidebar. - Your logo. The navbar logo goes on the cover and in the running header of every page, with nothing to configure.
- Content. Tabs, admonitions,
<details>, code and math are all in the built HTML and come through.--hydrateruns the site's own scripts first, so@docusaurus/theme-mermaiddiagrams and<BrowserOnly>content reach the PDF too. - Checks. Content clipped off the page fails the export instead of shipping quietly.
- Navigation. The PDF has numbered chapters, a contents table and bookmarks.
llms.txt from the same build (free)
npx manuscrio-pdf llms ./build --edition default:en:current
This writes llms.txt in sidebar order, llms-full.txt, and a Markdown copy beside every page, ready to copy into build/ before you deploy. It reads the pages as built, so partials and generated index pages are included, and every tab is kept under its label. It also puts theme-mermaid diagrams back as mermaid code blocks, recovered from the compiled MDX. It needs no licence and adds no watermark or attribution.
Try it
- Runnable example project and GitHub Actions workflow: https://github.com/manuscrio/docusaurus-pdf-export
- Docusaurus guide: https://manuscrio.com/docs/frameworks/docusaurus/
- llms.txt guide: https://manuscrio.com/docs/llms-txt/
- Sample: a 594-page PDF exported from the Docusaurus docs themselves: https://manuscrio.com/#sample
Licensing
Evaluation mode needs no account and has no page limit; the PDFs carry a watermark and a footer line. An organization licence removes both. Licences are checked offline, so nothing calls home, and CI works without network access. Projects that are public under an OSI-approved licence, documentation included, can get an Open Source License at no cost.
Questions and bug reports welcome here.