Skip to content

Docs: Configuration file how-to guide #10301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Jun 9, 2023
Merged
Changes from 3 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1b3e201
WIP. Completed introduction and file location sections.
nikblanchet May 7, 2023
063ad2a
WIP. Converted note admonition to a section.
nikblanchet May 7, 2023
04ce49b
WIP. Began config file requirements.
nikblanchet May 7, 2023
70ac7e4
Apply suggestions from code review by @benjaoming and @agjohnson
benjaoming Jun 7, 2023
0ec9ef1
Merge branch 'main' of github.com:readthedocs/readthedocs.org into do…
benjaoming Jun 7, 2023
dae85dc
Make it build
benjaoming Jun 7, 2023
fcccd92
rtd's rst header coventions
benjaoming Jun 7, 2023
580fe2b
Header as how-to + shorten intro a bit more
benjaoming Jun 7, 2023
b1b9bb9
YAML: Reference Wikipedia
benjaoming Jun 7, 2023
ff26253
Use sphinx-copybutton
benjaoming Jun 7, 2023
1cc548a
Start managing use of example configuration files
benjaoming Jun 7, 2023
69e4fb6
Turn tip into seealso
benjaoming Jun 7, 2023
715fba5
Updates the how-to with more content editing, aligning more with a st…
benjaoming Jun 7, 2023
9145cfe
Fix a syntax err
benjaoming Jun 7, 2023
0c09e13
Add some more fluffy text to bind the flow together
benjaoming Jun 7, 2023
9818ac1
Remove redundant sentence
benjaoming Jun 7, 2023
fde407c
Further refinements to the step-by-step structure
benjaoming Jun 7, 2023
61a5322
Add Next Steps section
benjaoming Jun 7, 2023
0907b67
More step-by-step flow and copy editing
benjaoming Jun 8, 2023
0d51abb
Adds a tip (inspired by possible Configuration File howto UX)
benjaoming Jun 8, 2023
4098d85
More content for build.commands
benjaoming Jun 8, 2023
4eb0ba3
Apply suggestions from @agjohnson code review with some additional su…
benjaoming Jun 9, 2023
811f118
Trim the weird .readthedocs.yaml comment
benjaoming Jun 9, 2023
166549b
Refactor: Remove the "bare" echo example and use Docusaurus instead. …
benjaoming Jun 9, 2023
a9b7c53
Merge branch 'main' of github.com:readthedocs/readthedocs.org into do…
benjaoming Jun 9, 2023
8501d88
Fix some references
benjaoming Jun 9, 2023
a2de19b
Fix a crashed sentence
benjaoming Jun 9, 2023
92b1fc9
Eliminate seealso from Docusaurus section (an almost identical one is…
benjaoming Jun 9, 2023
7c3632c
Remove Docusaurus template
benjaoming Jun 9, 2023
2aecfbd
Remove section on adjusting for Docusaurus support
agjohnson Jun 9, 2023
46fa1af
Point to the YAML site and simplify copy on our YAML note
agjohnson Jun 9, 2023
18b209f
Change note on Ubuntu image and package versions
agjohnson Jun 9, 2023
01db977
Doc lint
agjohnson Jun 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions docs/user/guides/creating-config-file.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
================================
Creating your configuration file
================================

As part of the initial setup for your Read the Docs site, you need to create a
**configuration file** called ``.readthedocs.yaml``.

The configuration file like a personalized guidebook that tells the platform
what specific settings for your project. Every project is unique, and by using
a configuration file, you can tailor the behavior of Read the Docs to match
your specific needs.

This how-to guide covers
#. Where to put your configuration file
#. The required parts of your configuration file

This should be enough to get you started!

.. tip::

The complete list of all possible ``.readthedocs.yaml`` settings, including
the optional settings not covered in on this page, is found on
:doc:`the configuration file reference page </docs/user/config-file/index.rst>`.

####################################
Where to put your configuration file
####################################

The ``.readthedocs.yaml`` file should be placed in the **root directory**. The
root directory is the top-most location of your repository.

To make the file, navigate to your root directory and create a new
file with the name ``.readthedocs.yaml``.

*************************
The config file is hidden
*************************

The ``.`` at the beginning of the file indicates that the file is hidden. If
the file browser you are using is not configured to show hidden files, you may
not be able to see the file after you create it!

If you cannot see ``.readthedocs.yaml`` after creating it, use your favorite
search engine to find instructions on showing hidden files for your specific
operating system.

#############################################
The required parts of your configuration file
#############################################

The configuration file is a YAML file. YAML files are a "map": a collection of
key-value pairs that can be nested. This is not unlike a JSON file or ``dict``
object in Python.

This page won't explain the structure of YAML files, but many resources exist
online.

***********
File header
***********

As a best practice, begin your file by providing the following.

#. The name of the file
#. A quick explanation of what the file is
#. A link to
:doc:`the configuration file reference page </docs/user/config-file/index.rst>`.

.. code-block:: yaml
:linenos:

# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# <--Remove this comment and leave this line blank-->

************************************
Version of configuration file schema
************************************

The version key tells the system how to read the rest of the configuration
file. The current and only supported version is **version 2**.

.. code-block:: yaml
:linenos:
:lineno-start: 5

version: 2
# <--Remove this comment and leave this line blank-->

*******************
Python requirements
*******************

The ``python`` key contains several sub-keys, but only one sub-key is required:
``requirements``. However, since ``requirements`` is required, ``python`` is
too.

The ``requirements`` key is a file path that points to a text (``.txt``) file
that lists the Python packages you want Read the Docs to install.