Skip to main content

Build infrastructure for Read the Docs

Project description

This module is the main building interface to Read the Docs. It has no explicit dependency on RTD code itself, and can be used outside of RTD to test your builds.

Install

Install with pip:

pip install readthedocs-build

CLI Use

Running a build is simple:

rtd-build

This will search for all readthedocs.yml (or .readthedocs.yml) files below your current directory and will build your documentation.

You can set a specific a directory where the built documentation should be stored:

rtd-build --outdir=out_dir

The documentation will then be placed in out_dir/<name>/html/. Where <name> is the name configured in your readthedocs.yml. The default for --outdir is _readthedocs_build.

Run rtd-build –help for more information.

The Build

Here is a list of steps that rtd-build performs to built your documentation. All these steps are performed for each individual section in your readthedocs.yml configs.

  • it creates a new virtual environment with virtualenv

  • it installs the builder’s dependencies into the virtualenv, for example Sphinx

  • it runs the build command (e.g. sphinx-build) on your documentation and puts the output into the directory specified with --outdir.

  • it removes the virtualenv

Library Use

An example use of this library is:

import os
from readthedocs_build.build import build

build([{
    'output_base': os.path.abspath('outdir'),
    'name': 'docs',
    'type': 'sphinx',
    'base': os.path.dirname(os.path.abspath(__file__)),
}])

Development

Just run:

pip install -e .

This will install the project into your environment, and have it pick up changes as you edit them in the code.

To run the tests:

tox

Build Process

Read the Docs creates a full environment for your build. In your local environment, you can choose what portions of this environment to re-create. You can either use your existing environment with our builder code installed, or allow our builder to create a fully isolated environment for itself. A fully isolated environment is much closer to our production build environment for testing purposes.

Project details


Download files

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

Source Distribution

readthedocs-build-2.0.6.tar.gz (15.7 kB view details)

Uploaded Source

Built Distributions

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

readthedocs_build-2.0.6-py2.py3-none-any.whl (24.9 kB view details)

Uploaded Python 2Python 3

readthedocs_build-2.0.6-py2-none-any.whl (24.9 kB view details)

Uploaded Python 2

File details

Details for the file readthedocs-build-2.0.6.tar.gz.

File metadata

File hashes

Hashes for readthedocs-build-2.0.6.tar.gz
Algorithm Hash digest
SHA256 c3c50423cdabbee71bdf3c07750f73df371e6cc24fb8663ba4d8d1642b7cb13f
MD5 944e5bbae4d9c0672f48488cc48c6990
BLAKE2b-256 29bb55a9ebaf746345a6e00401416e1f64751a1f0e33d7cac53c9ded7187e6e2

See more details on using hashes here.

File details

Details for the file readthedocs_build-2.0.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for readthedocs_build-2.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e6b3f13c99dff9d5b6077e31369b258fab6679712eee682dc8fa71fa206ce566
MD5 90a62d391fec5a4598eaa46fbfe10081
BLAKE2b-256 b1d935d006eefd788999b150c3a70e606c4a397b5f7b290453f3fde4f65ff8a8

See more details on using hashes here.

File details

Details for the file readthedocs_build-2.0.6-py2-none-any.whl.

File metadata

File hashes

Hashes for readthedocs_build-2.0.6-py2-none-any.whl
Algorithm Hash digest
SHA256 71c4f20eb3fc8c000816f3a13e7cacd885ff2b7bda88ac4349fc30a111c14953
MD5 876f4b780f493479ef6b172d0cfa1320
BLAKE2b-256 99755c343dad63b7c28fded503c35b80209b87f5039c4729cc8dca3c8cfaf21c

See more details on using hashes here.

Supported by

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