Environment variablesο
All build processes have the following environment variables automatically defined and available for each build step:
- READTHEDOCSο
Whether the build is running inside Read the Docs.
- Default:
True
- READTHEDOCS_LANGUAGEο
The locale name, or the identifier for the locale, for the project being built. This value comes from the projectβs configured language.
- Examples:
en
,it
,de_AT
,es
,pt_BR
- READTHEDOCS_VERSIONο
The slug of the version being built, such as
latest
,stable
, or a branch name likefeature-1234
. For pull request builds, the value will be the pull request number.
- READTHEDOCS_VERSION_NAMEο
The verbose name of the version being built, such as
latest
,stable
, or a branch name likefeature/1234
.
- READTHEDOCS_VERSION_TYPEο
The type of the version being built.
- Values:
branch
,tag
,external
(for pull request builds), orunknown
- READTHEDOCS_VIRTUALENV_PATHο
Path for the virtualenv that was created for this build. Only exists for builds using Virtualenv and not Conda.
- Example:
/home/docs/checkouts/readthedocs.org/user_builds/project/envs/version
- READTHEDOCS_CANONICAL_URLο
Canonical base URL for the version that is built. If the project has configured a custom domain (e.g.
docs.example.com
) it will be used in the resulting canonical URL. Otherwise, your projectβs default subdomain will be used.The path for the language and version is appended to the domain, so the final canonical base URLs can look like the following examples:
- Example:
https://docs.example.com/en/latest/
- Example:
https://docs.readthedocs.io/ja/stable/
- Example:
https://example--17.org.readthedocs.build/fr/17/
See also
- Understanding environment variables
General information about how environment variables are used in the build process.
- How to use custom environment variables
Learn how to define your own custom environment variables, in addition to the pre-defined ones.