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.1

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.1
File Size Uploaded
docbuildr-1.0.1.tar.gz 2.3 MB Details

Built distribution (wheel)

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

Total release size: 4.7 MB

Release files / docbuildr-1.0.1.tar.gz

Download URL docbuildr-1.0.1.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
0b0fcce653b52d54a71e42442f2d491a194d78a9a12761d0c1c0157745f4fbbd
BLAKE2b-256 checksum
How to use checksums
4e59d03d5e7fe0a554bb62e27015a48e36990e268c5978f583e12c0fcbcdedcd
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.1-py3-none-any.whl

Download URL docbuildr-1.0.1-py3-none-any.whl
Size 2.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
aa8617153ba53f4215be563cf4097360cc1f2608271a27925031372153de1b23
BLAKE2b-256 checksum
How to use checksums
ab9a603cd470c2cfd4f1fcc23774e3498212db029ca56be7eb30b0f4e153b966
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

This release

1.0.1 This release

2 release files

1.0.0

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