Skip to main content

DocBuildr

Build beautiful PDF books from online documentation.

DocBuildr is a command-line tool that crawls documentation websites, merges pages into a single book, and generates professional-quality Markdown, HTML, and PDF outputs.

Designed for developers, researchers, engineers, and scientists who want offline documentation with clean typography, mathematical rendering, and print-friendly layouts.


Features

  • 📖 Crawl documentation websites automatically
  • 📚 Merge multiple pages into a single book
  • 📝 Generate clean Markdown output
  • 🌐 Export standalone HTML
  • 📄 Export print-ready PDF
  • 🎨 Professional book layout
  • 🖼 Responsive images
  • 📊 Smart table formatting
  • 💻 Optimized code blocks
  • 📑 Automatic table of contents
  • ➗ Offline KaTeX math rendering
  • ✅ Unit-tested core components
  • 🔄 GitHub Actions continuous integration
  • ⚡ Simple command-line interface

Installation

Clone the repository

git clone https://github.com/<YOUR_USERNAME>/docbuildr.git

cd docbuildr

Create a virtual environment

python -m venv .venv

source .venv/bin/activate

Install

pip install -e ".[dev]"

Requirements

  • Python 3.11+
  • Playwright
  • Chromium browser

Install Chromium

playwright install chromium

Quick Start

Generate a book

docbuildr https://gthlab.au/panaroo

Examples

Run the bundled KaTeX demo

python examples/math_demo.py

The example generates a standalone HTML document demonstrating inline and display mathematics rendered entirely offline.


Command Line Options

Specify a custom title

docbuildr URL \
    --title "Panaroo User Guide"

Generate HTML only

docbuildr URL \
    --html-only

Specify output directory

docbuildr URL \
    --output-dir build

Specify output filename

docbuildr URL \
    --output-name panaroo

Verbose mode

docbuildr URL \
    --verbose

Output

output/

├── book.md
├── book.html
├── book.pdf
└── viewer.html

Project Structure

docbuildr/

├── src/
├── templates/
├── tests/
├── examples/
├── .github/
├── LICENSE
├── README.md
├── RELEASE.md
└── pyproject.toml

Build Pipeline

Documentation Website

        │

        ▼

Site Adapter

        │

        ▼

MarkdownCrawler

        │

        ▼

MarkdownPreprocessor

        │

        ▼

BookBuilder

        │

        ▼

MarkdownRenderer

        │
        ├── HTML
        ├── Viewer
        └── Vendor Assets

        ▼

PDFExporter

Current Features

Feature Status
Documentation crawler ✅
Markdown export ✅
HTML export ✅
PDF export ✅
Table of contents ✅
Cover page ✅
Smart tables ✅
Print layout ✅
Viewer ✅
Professional CLI ✅
Offline KaTeX rendering ✅
Unit tests ✅
GitHub Actions CI ✅
Syntax highlighting 🚧
Theme engine 🚧
EPUB export 🚧

Roadmap

Alpha

  • Professional CLI
  • Professional print layout
  • Offline KaTeX
  • Mermaid diagrams
  • Syntax highlighting

Beta

  • Theme engine
  • EPUB export
  • Search index
  • Plugin system

Version 1.0

  • Stable API
  • Multiple documentation platforms
  • Production-ready release

Development

Install development dependencies

pip install -e ".[dev]"

Compile source

python -m compileall src

Run tests

python -m pytest

Run coverage

python -m pytest --cov=docbuildr

Run DocBuildr

docbuildr https://gthlab.au/panaroo

Contributing

Contributions are welcome.

Please read CONTRIBUTING.md before submitting a pull request.


License

MIT License


Author

Developed by Moss.kw

Built with Python, Playwright, and modern web technologies.

Metadata

Release files for docbuildr 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docbuildr 1.0.0
File Size Uploaded
docbuildr-1.0.0.tar.gz 2.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for docbuildr 1.0.0
File Interpreter ABI Platform
docbuildr-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.7 MB

Release files / docbuildr-1.0.0.tar.gz

Download URL docbuildr-1.0.0.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
cd89c42a41f93a1699b563d0f7dc9a8ea9458b5d9cc38e32d717f81046a611e9
BLAKE2b-256 checksum
How to use checksums
f71b678ce1c5a398c13085c5dc7301e1ec50e2ed5c1611f8c8f3842c2461a49d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.8

Release files / docbuildr-1.0.0-py3-none-any.whl

Download URL docbuildr-1.0.0-py3-none-any.whl
Size 2.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
88740aa3550224a8ddf6ebe47ecc16091f90ae0d781dfab81ebe3d602533257e
BLAKE2b-256 checksum
How to use checksums
63e1d82f49c85fa9bc8bd27da03f3c3c4c7252fe2910c67c7939bcf61df99521
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.8

Release history Release notifications | RSS feed

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page