Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Hugo theme for building document site that can output typeset PDFs using Vivliostyle CLI.
hugo-theme-vivliocli is an open-source Hugo theme that turns a Markdown-based documentation site into a site that can also output any section as a typeset PDF using Vivliostyle CLI.
hugo-theme-vivliocli is a Hugo theme for building document websites that can also output any section containing an _pdf.md file as a typeset PDF with cover, table of contents, bookmarks, chapter numbers, and page numbers. The theme runs on Hugo v0.163.1 or later and uses Vivliostyle CLI v8.6.0 or later as the PDF rendering engine. It is maintained by mochimochiki and released under the Apache License 2.0, with files in assets/js and static/css licensed under CC0-1.0 unless noted.
_pdf.md file are rendered as PDFs with cover, TOC, bookmarks, chapter numbers, and page numbers via Vivliostyle CLI.include shortcode imports a CSV file to draw tables with vertical || and horizontal -> cell merging, supports Markdown syntax inside cells, and lets you set column width and text alignment.ShowIf and HideIf shortcodes include or exclude blocks or files for specific editions, so you can produce PDF sets with different levels of detail.Technical writers who need both a web-hosted manual and a print-ready PDF from the same Markdown source will find this theme direct to use. Documentation maintainers can rely on Hugo's content structure plus the _pdf.md convention to keep outputs in sync. Open-source project teams benefit from the included GitHub Actions workflow that builds and uploads PDFs as an artifact, making release documentation reproducible.
ShowIf and HideIf to create differently detailed PDF editions, such as a quick-start guide and a full reference manual.You start by creating a Hugo site and adding the theme as a git submodule with hugo new site MySite followed by the submodule add command. Then you write content in Markdown, placing an _pdf.md file in any section you want to render as a PDF. Finally you run Vivliostyle CLI directly or use the provided docker compose run --rm pdf command to generate the PDFs; a GitHub Actions workflow in the repo also builds and uploads them as the vivliocli-pdf artifact.
The theme is free and open source under the Apache License 2.0. No separate pricing tiers exist; you may use, modify, and redistribute it under the license terms.
You need Hugo v0.163.1 or later and Vivliostyle CLI v8.6.0 or later. If you prefer not to install these locally, you can use the included Docker image, which bundles Hugo extended, Node.js, Chromium, Ghostscript, poppler, and Noto CJK fonts.
Yes, when your pages use Mermaid or MathJax, Chromium pre-renders them by fetching the libraries from a CDN, so an internet connection is required during the PDF build. The Docker-based build has the same requirement.
Yes. Any section that contains an _pdf.md file can be output as a PDF. Other sections are not rendered, giving you fine-grained control over what appears in the PDF.
You can select a book style with distinct left and right pages or a simple style where every page is the same. Chapter numbers are automatically assigned from the Markdown hierarchy, and you can tune their output level and the top-level format.
The theme itself is Apache License 2.0. Files in assets/js and static/css are licensed under CC0-1.0 unless otherwise noted, so you can adapt the JavaScript and CSS freely.
