Skip to content

Commit 557b06f

Browse files
committed
Docs: update tutorial with the latest required changes
- `.readthedocs.yaml` config file is now required - `sphinx-rtd-theme` is a required dependency and has to be installed via `python.install.requirements` - remove invalid options from "Import Project" page - comment out section about "Show warning banner" Related #10626 (comment)
1 parent a23bc26 commit 557b06f

File tree

1 file changed

+60
-43
lines changed

1 file changed

+60
-43
lines changed

docs/user/tutorial/index.rst

+60-43
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ which will generate a new repository on your personal account
3838
This is the repository you will import on Read the Docs,
3939
and it contains the following files:
4040

41+
``.readthedocs.yaml``
42+
Read the Docs configuration file.
43+
Required to setup the documentation build process.
44+
4145
``README.rst``
4246
Basic description of the repository, you will leave it untouched.
4347

@@ -53,6 +57,7 @@ and it contains the following files:
5357
including the Sphinx configuration ``docs/source/conf.py``
5458
and the root document ``docs/source/index.rst`` written in reStructuredText.
5559

60+
.. TODO: update this image once we have pushed the ``readthedocs.yaml`` to the repository
5661
.. figure:: /_static/images/tutorial/github-template.png
5762
:width: 80%
5863
:align: center
@@ -147,15 +152,9 @@ Name
147152
Repository URL
148153
The URL that contains the sources. Leave the automatically filled value.
149154

150-
Repository type
151-
Version control system used, leave it as "Git".
152-
153155
Default branch
154156
Name of the default branch of the project, leave it as ``main``.
155157

156-
Edit advanced project options
157-
Leave it unchecked, we will make some changes later.
158-
159158
After hitting the :guilabel:`Next` button, you will be redirected to the :term:`project home`.
160159
You just created your first project on Read the Docs! |:tada:|
161160

@@ -319,19 +318,24 @@ In this section, we will show you some examples of what a configuration file sho
319318
Upgrading the Python version
320319
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
321320

322-
For example, to explicitly use Python 3.8 to build your project,
323-
navigate to your GitHub repository, click on the :guilabel:`Add file` button,
324-
and add a ``.readthedocs.yaml`` file with these contents to the root of your project:
321+
For example, to explicitly use Python 3.11 to build your project,
322+
navigate to your GitHub repository, click on ``.readthedocs.yaml`` file and then in the pencil icon ✏️ to edit the file
323+
and change the Python version as follows:
325324

326325
.. code-block:: yaml
327326
:caption: .readthedocs.yaml
327+
:emphasize-lines: 6
328328
329329
version: 2
330330
331331
build:
332-
os: "ubuntu-20.04"
332+
os: "ubuntu-22.04"
333333
tools:
334-
python: "3.8"
334+
python: "3.11"
335+
336+
python:
337+
install:
338+
- requirements: docs/requirements.txt
335339
336340
The purpose of each key is:
337341

@@ -345,18 +349,22 @@ The purpose of each key is:
345349
``build.tools.python``
346350
Declares the Python version to be used.
347351

352+
``python.install.requirements``
353+
Specifies the Python dependencies to install required to build the documentation.
354+
348355
After you commit these changes, go back to your project home,
349356
navigate to the "Builds" page, and open the new build that just started.
350-
You will notice that one of the lines contains ``python3.8``:
357+
You will notice that one of the lines contains ``python -mvirtualenv``:
351358
if you click on it, you will see the full output of the corresponding command,
352359
stating that it used Python 3.8.6 to create the virtual environment.
353360

354-
.. figure:: /_static/images/tutorial/build-python3.8.png
361+
.. TODO: update this image with Python 3.11
362+
.. figure:: /_static/images/tutorial/build-python3.11.png
355363
:width: 80%
356364
:align: center
357-
:alt: Read the Docs build using Python 3.8
365+
:alt: Read the Docs build using Python 3.11
358366

359-
Read the Docs build using Python 3.8
367+
Read the Docs build using Python 3.11
360368

361369
Making warnings more visible
362370
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -387,14 +395,18 @@ click on the |:pencil2:| icon, and add these contents:
387395

388396
.. code-block:: yaml
389397
:caption: .readthedocs.yaml
390-
:emphasize-lines: 8-9
398+
:emphasize-lines: 12-13
391399
392400
version: 2
393401
394402
build:
395-
os: "ubuntu-20.04"
403+
os: "ubuntu-22.04"
396404
tools:
397-
python: "3.8"
405+
python: "3.11"
406+
407+
python:
408+
install:
409+
- requirements: docs/requirements.txt
398410
399411
sphinx:
400412
fail_on_warning: true
@@ -414,11 +426,12 @@ go back to editing ``.readthedocs.yaml`` on GitHub and modify it as follows:
414426

415427
.. code-block:: yaml
416428
:caption: .readthedocs.yaml
417-
:emphasize-lines: 2-4
429+
:emphasize-lines: 4-7
418430
419431
python:
420-
# Install our python package before building the docs
421432
install:
433+
- requirements: docs/requirements.txt
434+
# Install our python package before building the docs
422435
- method: pip
423436
path: .
424437
@@ -547,36 +560,40 @@ and a new build will be triggered for it.
547560
You can read more about :ref:`hidden versions <versions:hidden>`
548561
in our documentation.
549562

550-
Show a warning for old versions
551-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
563+
.. "Show a warning for old versions" feature is not available anymore.
564+
We should re-write this section once we have the notification addons rolled out.
552565
553-
When your project matures, the number of versions might increase.
554-
Sometimes you will want to warn your readers
555-
when they are browsing an old or outdated version of your documentation.
556566
557-
To showcase how to do that, let's create a ``2.0`` version of the code:
558-
navigate to your GitHub repository, click on the branch selector,
559-
type ``2.0.x``, and click on "Create branch: 2.0.x from 'main'".
560-
This will trigger two things:
567+
Show a warning for old versions
568+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
561569
562-
- Since ``2.0.x`` is your newest branch, ``stable`` will switch to tracking it.
563-
- A new ``2.0.x`` version will be created on your Read the Docs project.
564-
- Since you already have an active ``stable`` version, ``2.0.x`` will be activated.
570+
When your project matures, the number of versions might increase.
571+
Sometimes you will want to warn your readers
572+
when they are browsing an old or outdated version of your documentation.
565573
566-
From this point, ``1.0.x`` version is no longer the most up to date one.
567-
To display a warning to your readers, go to the :guilabel:`⚙ Admin` menu of your project home,
568-
click on the :guilabel:`Advanced Settings` link on the left,
569-
enable the "Show version warning" checkbox, and click the :guilabel:`Save` button.
574+
To showcase how to do that, let's create a ``2.0`` version of the code:
575+
navigate to your GitHub repository, click on the branch selector,
576+
type ``2.0.x``, and click on "Create branch: 2.0.x from 'main'".
577+
This will trigger two things:
570578
571-
If you now browse the ``1.0.x`` documentation, you will see a warning on top
572-
encouraging you to browse the latest version instead. Neat!
579+
- Since ``2.0.x`` is your newest branch, ``stable`` will switch to tracking it.
580+
- A new ``2.0.x`` version will be created on your Read the Docs project.
581+
- Since you already have an active ``stable`` version, ``2.0.x`` will be activated.
573582
574-
.. figure:: /_static/images/tutorial/old-version-warning.png
575-
:width: 80%
576-
:align: center
577-
:alt: Warning for old versions
583+
From this point, ``1.0.x`` version is no longer the most up to date one.
584+
To display a warning to your readers, go to the :guilabel:`⚙ Admin` menu of your project home,
585+
click on the :guilabel:`Advanced Settings` link on the left,
586+
enable the "Show version warning" checkbox, and click the :guilabel:`Save` button.
587+
588+
If you now browse the ``1.0.x`` documentation, you will see a warning on top
589+
encouraging you to browse the latest version instead. Neat!
590+
591+
.. figure:: /_static/images/tutorial/old-version-warning.png
592+
:width: 80%
593+
:align: center
594+
:alt: Warning for old versions
578595
579-
Warning for old versions
596+
Warning for old versions
580597
581598
Getting insights from your projects
582599
-----------------------------------

0 commit comments

Comments
 (0)