Skip to main content

Sphinx Extension: Repository Manager

PyPI PyPI - License

About

This Sphinx extension by Xsolla Backend [XBE] automates the management of multiple documentation repositories as part of building a larger, unified documentation system. It facilitates multithreaded cloning and updating of external repositories specified in a YAML manifest file before Sphinx builds.

Demo (GIF)

📜 See the XBE docgen source code and demo doc production site heavily making use of this extension. Here, you may also find tips for how to utilize this extension to its greatest capabilities.

See how it works or quickstart below >>

Installation

This guide assumes you have a basic understanding of Sphinx and RST

Add to Existing Project

  1. Install the extension via pip:

     pip install sphinx-repo-manager
    
  2. Add extension to your project's docs/source/conf.py (example template):

    extensions = [ "sphinx_repo_manager" ] ,  # https://pypi.org/project/sphinx-repo-manager
    
  3. Ensure a docs/.env file exists next to your Makefile -> set REPO_AUTH_TOKEN=

  4. Create a docs/repo_manifest.yml (example template) next to your Makefile

    • 💡 Optionally, set the manifest max_workers_local to a higher number for faster local builds [even 30 is ok for high-end machines!]

Once setup, sphinx-build as normal (typically via make html next to your Makefile)!

Tips

  • Windows user? You may want to unlock your max char paths by running tools/admin-enable-long-file-paths.ps1 as admin
  • Editing the manifest?
    • Consider purging your docs/source/_repos-available and docs/source/content dirs
  • Want speedier build iterations?
    • Test bumping up your max_workers_local counts - even significantly higher - for high-end machines!

Demos

Minimal Demo

  1. Clone the source repo for a demo:
  • Minimal build architecture begins at at docs/
  • repo_manifest.yml contains a minimal sphinx_demo_doc repo to be cloned

Production Demo

Alternately, see sphinx_repo_manager used by Xsolla Backend at a production-grade level:


How it Works

  1. repo_manifest.yml lists repositories with their respective clone URLs [and optional rules].
  2. docs/source/ creates _repos-available (src repos) and content (symlinked) dirs.
  3. Upon running sphinx-build (commonly via make html), the extension either clones or updates each repo defined within the manifest.
  4. Source clones will sparse checkout and symlink to the content dir, allowing for flexibility such as custom entry points and custom names (such as for shorter url slugs).
  5. All repos in the manifest will be organized in a monolithic doc.

💡 If you want to store local content (eg, static .rst), add it to source/_source-docs/

💡 The only RST file expected for your monolithic repo is the index.rst file (next to your conf.py)

⌛ 5 local workers (default) will take only ~50s to process 30 repos with default manifest settings

Tests

Confirmed compatability with:

  • Windows 11 via PowerShell 7, WSL2 (bash)
  • Ubuntu 22.04 via ReadTheDocs (RTD) CI, Docker Desktop
  • Python 3.10, 3.12
  • Sphinx 7.3.7, 8.1.3

Questions?

Join the Xsolla Backend official Discord guild!

License

MIT

Metadata

Release files for sphinx-repo-manager 1.0.35

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

Source distribution (sdist)

Source distribution for sphinx-repo-manager 1.0.35
File Size Uploaded
sphinx_repo_manager-1.0.35.tar.gz 26.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-repo-manager 1.0.35
File Interpreter ABI Platform
sphinx_repo_manager-1.0.35-py3-none-any.whl Python 3 none any Details

Total release size: 52.7 kB

Release files / sphinx_repo_manager-1.0.35.tar.gz

Download URL sphinx_repo_manager-1.0.35.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0fe60809fdd7ca7bb5fd2047360ea282a059b6883d83fb0950ef19491eaf0528
BLAKE2b-256 checksum
How to use checksums
bc66a65ac828704e90ea0245e4cac5aa344e972358592d26f4a03b125e82b0d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / sphinx_repo_manager-1.0.35-py3-none-any.whl

Download URL sphinx_repo_manager-1.0.35-py3-none-any.whl
Size 26.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85f45c4aea3121288987585b32491afc3e5ab85258e5e68ee0419da5d7763fc1
BLAKE2b-256 checksum
How to use checksums
e80293b8b056ee4a54021df02184c1deba5ba22bb51873e54e3ef04c2c32f938
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

1.0.35 This release

2 release files

1.0.34

2 release files

1.0.33

2 release files

1.0.32

2 release files

1.0.27

2 release files

1.0.26

2 release files

1.0.25

2 release files

1.0.24

2 release files

1.0.23

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.20

2 release files

1.0.18

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

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