Skip to content

Docusaurus to PDF

Manuscrio reads a finished Docusaurus build directory and exports it to publication-ready PDF manuals. It needs no source access, no plugin in your site, and no running server:

Terminal window
manuscrio-pdf inspect ./build # what manuals does this site contain?
manuscrio-pdf export ./build # one manual per documentation edition

Both commands run end to end in a public example repository: Working Docusaurus integration on GitHub — manuscrio/docusaurus-pdf-export.

Any theme built on the standard theme-doc-* markup works — that is Docusaurus’s published theming contract, not a heuristic. The framework is detected from the built pages, so the command names no framework at all; --framework docusaurus skips detection when you are diagnosing an unusual build.

Docusaurus is the framework Manuscrio reads most deeply. It is the only one of the three that describes versions, plugin instances and navbar sections in its output, so it is the only one where all three manual scopes apply.

Three steps after the step that already builds your site. Docusaurus writes ./build:

- run: npm ci && npm run build
- name: Export the docs to PDF
run: npx --yes [email protected] export build --output-dir manuscrio-output
- uses: actions/upload-artifact@v7
with:
name: manual
path: manuscrio-output/*.pdf

Pin the version, as above: one manuscrio version resolves to exactly one image, so re-running an old pipeline renders what it rendered the first time. There is nothing to install in your site and no GitHub Action to add.

The complete workflow is in manuscrio/docusaurus-pdf-export, and Run in CI has the docker run form for runners without Node.

Editions: versions, locales and plugin instances

Section titled “Editions: versions, locales and plugin instances”

An edition is one plugin instance, one locale, and one version. Docusaurus has all three concepts, so a site with two versions in three languages offers six editions, and Manuscrio exports each as its own manual rather than merging them:

default:en:current
default:en:3.1.1
default:fr:current
...

Manual scopes never combine editions implicitly. A versioned site therefore produces a manual per version, which is usually what a documentation team delivering releases actually wants.

Sections: the navbar level only Docusaurus has

Section titled “Sections: the navbar level only Docusaurus has”

A documentation section is a documentation-bearing navbar entry — Docs and API, say. Docusaurus is the only supported framework with that level, so it is the only one where --scope section works:

ScopeProduces
--scope editionone manual per edition, sections as top-level chapters
--scope sectionone manual per navbar section
--scope sidebar-rootone manual per sidebar root
Terminal window
manuscrio-pdf export ./build --scope section

One Docusaurus edition can genuinely produce three different sets of manuals from the same build, which is the mechanism behind shipping a short API volume separately from a long Docs one.

A sidebar belonging to no navbar section is refused at edition and section scope and exports at --scope sidebar-root; see UNASSIGNED_DOCUMENTATION_SET.

Manuscrio reads the site’s own logo from the Docusaurus navbar and puts it on the cover and in the running header of every interior page. Nothing to configure — a Docusaurus export carries the customer’s brand by default, where Starlight and MkDocs currently need --logo.

A chapter opening in a manual exported from a Docusaurus build
DocusaurusPlaywright docs, Getting Started · garnet · 51 pages

Some content is drawn by JavaScript after the page loads, so it is not in your build’s HTML and does not reach the manual. In Docusaurus that means @docusaurus/theme-mermaid diagrams and anything inside <BrowserOnly>.

Add --hydrate:

Terminal window
manuscrio-pdf export ./build --hydrate --output-dir ./manuscrio-output

It is off by default because it runs your site’s own scripts, adds about a second per page, and does not produce byte-identical output between runs. Pages whose scripts fail to load are reported rather than exported without them.

Everything else needs nothing: tabs, admonitions, <details>, code and math are all in your build already, as are diagrams rendered at build time.

A non-root baseUrl is detected automatically. Pass --base-path /docs only if that detection is ever wrong.

A Docusaurus sidebar root is identified by the route it points at, so its ID survives edits above it in the sidebar. That makes a Docusaurus ID safe to name in a pipeline in a way the other two frameworks’ positional IDs are not — though re-reading them from inspect is still the habit worth having. See manual IDs and output file names.

Run the two commands at the top of this page against your own ./build. Nothing is uploaded and there is no account: without a licence the export is still the complete manual at production rendering quality, with no page limit, carrying an evaluation watermark until a licence removes it.