Skip to main content

PyPI - Version PyPI - Python Version PyPI - Downloads

sphinxpress

sphinxpress publishes multiple independent Sphinx documentation projects as one documentation product: generated Jekyll/GitHub Pages pages, a combined EPUB, and a combined PDF.

It stays Sphinx-first. Each source project keeps its own conf.py and documentation tree. sphinxpress runs Sphinx builders, reads their output, and writes deterministic site and book artifacts for a larger publishing pipeline.

Release status: early alpha. Pin versions and validate generated output before using in production documentation pipelines.

Features

  • Build Jekyll pages from Sphinx JSON output.
  • Build one logical project as both latest release docs and committed main docs.
  • Preserve readable Sphinx autodoc/API presentation in generated Jekyll pages with scoped, self-contained styling.
  • Write per-project navigation data for site layouts.
  • Protect generated pages from Jekyll 3 Liquid parsing without an external wrapper step.
  • Build aggregate EPUB and PDF projects from selected Sphinx docs projects.
  • Resolve release metadata from manual tags, git tags, or project metadata.
  • Optionally create a shared managed virtual environment for Sphinx and documentation dependencies.

Install

python -m pip install sphinxpress

For local development and documentation builds:

python -m pip install -e ".[dev,docs,pdf]"
python -m pytest -q

Minimal configuration

Create sphinxpress.toml at the repository root:

[site]
root = "site"
base_url = "https://docs.example.com"
tools_dir = "tools"
nav_data_dir = "_data/tool_nav"
layout = "tool-doc"
title = "Example Docs"
protect_liquid = true

[site.versioning]
enabled = true
default = "release"

[[site.versioning.variants]]
name = "release"
label = "Latest release"
source = "release"
url_segment = ""

[[site.versioning.variants]]
name = "main"
label = "Current main"
source = "git_ref"
ref = "main"
url_segment = "main"

[build]
work_dir = ".sphinxpress"
sphinx_build = "sphinx-build"
fail_on_warning = true
keep_build_dir = false
parallel = "auto"

[book]
title = "Example Documentation"
author = "Example Team"
language = "en"
version = "0.1.0"
copyright = "2026, Example Team"
project_order = ["tool-a"]
docs_variant = "release"

[pdf]
builder = "weasyprint"
output = "dist/example-documentation.pdf"

[epub]
builder = "epub"
output = "dist/example-documentation.epub"

[release]
tag_prefix = "v"
release_url_template = "{repo_url}/releases/tag/{tag}"

[[projects]]
name = "tool-a"
title = "Tool A"
docs_root = "../tool-a/docs"
conf_dir = "../tool-a/docs"
root_doc = "index"
repo_url = "https://github.com/example/tool-a"
release_strategy = "manual"
release_tag = "v0.1.0"
site_variants = ["release", "main"]
version_refs = { main = "main" }

Commands

sphinxpress check
sphinxpress list
sphinxpress build-site --all
sphinxpress build-site --all --variant release
sphinxpress build-epub --all
sphinxpress build-pdf --all
sphinxpress validate

With the versioning block above, build-site --all writes:

  • /tools/tool-a/ for the resolved release target
  • /tools/tool-a/main/ for the resolved main target
  • _data/tool_nav/tool-a.yml and _data/tool_nav/tool-a-main.yml with a version switcher payload

sphinxpress does not fetch refs or tags automatically. If a configured release tag or Git ref is missing locally, fetch it before building.

build-pdf uses sphinxpress's internal WeasyPrint backend by default. It builds the aggregate docs as single HTML and renders that HTML to PDF, so LaTeX is not required for the default path. Install the optional pdf extra or include weasyprint>=67 in the managed build environment. The legacy latexpdf builder remains available when [pdf].builder = "latexpdf" is set explicitly.

build-pdf preflights the configured WeasyPrint executable before the aggregate singlehtml build and reports the actionable sphinxpress[pdf] or weasyprint>=67 guidance if it is missing, avoiding a wasted singlehtml run.

Build diagnostics

Every Sphinx, WeasyPrint, and managed-environment pip run writes a log file under [build].log_dir (default <work_dir>/logs). The latest run for each stage is mirrored to latest-<stem>.log, and failure messages include the relevant Log: path. Use [build].log_dir = "custom-logs" in sphinxpress.toml to override the default location.

Managed build environment

sphinxpress can create one shared virtual environment for Sphinx and documentation dependencies:

[build.env]
enabled = true
scope = "shared"
python = "python3"
path = ".sphinxpress/venv"
upgrade_pip = true
packages = [
  "sphinx>=7",
  "myst-parser",
  "sphinx-rtd-theme",
  "weasyprint>=67",
  "tool-a==0.1.0",
]

For v0.1, only scope = "shared" is supported. scope = "project" is reserved for a future release and is rejected with a configuration error.

Use exact package requirements for project packages, for example tool-a==0.1.0. Legacy editable entries that match a configured project path are converted to project-name==release-version using the project release tag with [release].tag_prefix stripped. Unmatched editable paths are rejected. Package path arguments after -r, --requirement, -c, and --constraint are resolved relative to sphinxpress.toml.

When site versioning is enabled, the shared environment can keep exact released package pins while main docs still import the resolved checkout. sphinxpress prepends the resolved source root and its src/ directory to PYTHONPATH for each Sphinx subprocess instead of using editable installs.

Documentation

Build the project documentation with:

python -m pip install -e ".[dev,docs,pdf]"
python -m sphinx -b html docs docs/_build/html

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinxpress-0.1.3.tar.gz (79.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinxpress-0.1.3-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file sphinxpress-0.1.3.tar.gz.

File metadata

  • Download URL: sphinxpress-0.1.3.tar.gz
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sphinxpress-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f1dea745dfbf7e5783a2c1550f73008afd15a0b4be34acedb80dab560745517c
MD5 55b12fe57650590648bd956d5c5791aa
BLAKE2b-256 e12513eb440e34b136cf3851afc1189398e7373aead90d4669fcee0728fcd8a1

See more details on using hashes here.

File details

Details for the file sphinxpress-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: sphinxpress-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sphinxpress-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d010cdb42bd975ed52b80b256475dbfbc0ef9d0863a568a8e2961ba6d09ba595
MD5 7162de83ea7fa4a992648002fd7b0f46
BLAKE2b-256 631d6f118559370c249449bba8c5eed5169b07900a27b71308d2660c1d69495d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page