Skip to content

Commit 0c44e6f

Browse files
agjohnsonhumitos
andauthored
Update env var docs (#9443)
Co-authored-by: Manuel Kaufmann <[email protected]>
1 parent a327be2 commit 0c44e6f

File tree

2 files changed

+40
-19
lines changed

2 files changed

+40
-19
lines changed

docs/user/environment-variables.rst

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,54 @@
11
Environment Variables
22
=====================
33

4-
Read the Docs supports environment variables when building your project.
5-
There are two types of them:
4+
Read the Docs supports two types of environment variables in project builds:
65

7-
* default environment variables
8-
* user-defined environment variables
6+
* `Default environment variables`_
7+
* `User-defined environment variables`_
98

10-
Both are merged together during the build process and exposed to all the commands executed when building the documentation.
9+
Both are merged together during the build process and are exposed to all of the executed commands. There are two exceptions for user-defined environment variables however:
1110

11+
* User-defined variables are not available during the checkout step of the :doc:`build process </builds>`
12+
* User-defined variables that are not marked as public will not be available in :doc:`pull request builds </pull-requests>`
1213

1314
Default environment variables
1415
-----------------------------
1516

16-
Read the Docs builder sets the following environment variables when building your documentation:
17+
Read the Docs builders set the following environment variables automatically for each documentation build:
1718

18-
.. csv-table:: Environment Variables
19-
:header: Environment variable, Description, Example value
20-
:widths: 15, 10, 30
19+
.. envvar:: READTHEDOCS
2120

22-
``READTHEDOCS``, Whether the build is running inside Read the Docs, ``True``
23-
``READTHEDOCS_VERSION``, The Read the Docs slug of the version which is being built, ``latest``
24-
``READTHEDOCS_VERSION_NAME``, Corresponding version name as displayed in Read the Docs' version switch menu, ``stable``
25-
``READTHEDOCS_VERSION_TYPE``, Type of the event triggering the build, ``branch`` | ``tag`` | ``external`` (for :doc:`pull request builds </pull-requests>`) | ``unknown``
26-
``READTHEDOCS_PROJECT``, The Read the Docs' slug of the project which is being built, ``my-example-project``
27-
``READTHEDOCS_LANGUAGE``, The Read the Docs' language slug of the project which is being built, ``en``
21+
Whether the build is running inside Read the Docs.
2822

29-
.. note::
23+
:Default: ``True``
24+
25+
.. envvar:: READTHEDOCS_VERSION
26+
27+
The :term:`slug` of the version being built, such as ``latest``, ``stable``,
28+
or a branch name like ``feature-1234``. For :doc:`pull request builds </pull-requests>`,
29+
the value will be the pull request number.
30+
31+
.. envvar:: READTHEDOCS_VERSION_NAME
32+
33+
The verbose name of the version being built, such as ``latest``, ``stable``,
34+
or a branch name like ``feature/1234``.
35+
36+
.. envvar:: READTHEDOCS_VERSION_TYPE
37+
38+
The type of the version being built.
39+
40+
:Values: ``branch``, ``tag``, ``external`` (for :doc:`pull request builds </pull-requests>`), or ``unknown``
41+
42+
.. envvar:: READTHEDOCS_PROJECT
43+
44+
The :term:`slug` of the project being built. For example, ``my-example-project``.
45+
46+
.. envvar:: READTHEDOCS_LANGUAGE
3047

31-
The term slug is used to refer to a unique string across projects/versions containing ASCII characters only.
32-
This value is used in the URLs of your documentation.
48+
The locale name, or the identifier for the locale, for the project being built.
49+
This value comes from the project's configured language.
3350

51+
:Examples: ``en``, ``it``, ``de_AT``, ``es``, ``pt_BR``
3452

3553
User-defined environment variables
3654
----------------------------------

docs/user/glossary.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ Glossary
2626
Another name for :term:`project home`.
2727

2828
slug
29-
The lower case & hyphenated name of your project that is used in URL's. You can find this on the project :guilabel:`Overview` section of your documentation under ``Project Slug``.
29+
A unique identifier for a project or version. This value comes from the
30+
project or version name, which is reduced to lowercase letters, numbers,
31+
and hypens. You can retreive your project or version slugs from
32+
:doc:`our API <api/v3>`.
3033

3134
root URL
3235
Home URL of your documentation without the ``/<lang>`` and ``/<version>`` segments.

0 commit comments

Comments
 (0)