@@ -38,6 +38,10 @@ which will generate a new repository on your personal account
38
38
This is the repository you will import on Read the Docs,
39
39
and it contains the following files:
40
40
41
+ ``.readthedocs.yaml ``
42
+ Read the Docs configuration file.
43
+ Required to setup the documentation build process.
44
+
41
45
``README.rst ``
42
46
Basic description of the repository, you will leave it untouched.
43
47
@@ -53,6 +57,7 @@ and it contains the following files:
53
57
including the Sphinx configuration ``docs/source/conf.py ``
54
58
and the root document ``docs/source/index.rst `` written in reStructuredText.
55
59
60
+ .. TODO: update this image once we have pushed the ``readthedocs.yaml`` to the repository
56
61
.. figure :: /_static/images/tutorial/github-template.png
57
62
:width: 80%
58
63
:align: center
@@ -147,15 +152,9 @@ Name
147
152
Repository URL
148
153
The URL that contains the sources. Leave the automatically filled value.
149
154
150
- Repository type
151
- Version control system used, leave it as "Git".
152
-
153
155
Default branch
154
156
Name of the default branch of the project, leave it as ``main ``.
155
157
156
- Edit advanced project options
157
- Leave it unchecked, we will make some changes later.
158
-
159
158
After hitting the :guilabel: `Next ` button, you will be redirected to the :term: `project home `.
160
159
You just created your first project on Read the Docs! |:tada: |
161
160
@@ -319,19 +318,24 @@ In this section, we will show you some examples of what a configuration file sho
319
318
Upgrading the Python version
320
319
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
321
320
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 :
325
324
326
325
.. code-block :: yaml
327
326
:caption : .readthedocs.yaml
327
+ :emphasize-lines : 6
328
328
329
329
version : 2
330
330
331
331
build :
332
- os : " ubuntu-20 .04"
332
+ os : " ubuntu-22 .04"
333
333
tools :
334
- python : " 3.8"
334
+ python : " 3.11"
335
+
336
+ python :
337
+ install :
338
+ - requirements : docs/requirements.txt
335
339
336
340
The purpose of each key is:
337
341
@@ -345,18 +349,22 @@ The purpose of each key is:
345
349
``build.tools.python ``
346
350
Declares the Python version to be used.
347
351
352
+ ``python.install.requirements ``
353
+ Specifies the Python dependencies to install required to build the documentation.
354
+
348
355
After you commit these changes, go back to your project home,
349
356
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 ``:
351
358
if you click on it, you will see the full output of the corresponding command,
352
359
stating that it used Python 3.8.6 to create the virtual environment.
353
360
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
355
363
:width: 80%
356
364
:align: center
357
- :alt: Read the Docs build using Python 3.8
365
+ :alt: Read the Docs build using Python 3.11
358
366
359
- Read the Docs build using Python 3.8
367
+ Read the Docs build using Python 3.11
360
368
361
369
Making warnings more visible
362
370
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -387,14 +395,18 @@ click on the |:pencil2:| icon, and add these contents:
387
395
388
396
.. code-block :: yaml
389
397
:caption : .readthedocs.yaml
390
- :emphasize-lines : 8-9
398
+ :emphasize-lines : 12-13
391
399
392
400
version : 2
393
401
394
402
build :
395
- os : " ubuntu-20 .04"
403
+ os : " ubuntu-22 .04"
396
404
tools :
397
- python : " 3.8"
405
+ python : " 3.11"
406
+
407
+ python :
408
+ install :
409
+ - requirements : docs/requirements.txt
398
410
399
411
sphinx :
400
412
fail_on_warning : true
@@ -414,11 +426,12 @@ go back to editing ``.readthedocs.yaml`` on GitHub and modify it as follows:
414
426
415
427
.. code-block :: yaml
416
428
:caption : .readthedocs.yaml
417
- :emphasize-lines : 2-4
429
+ :emphasize-lines : 4-7
418
430
419
431
python :
420
- # Install our python package before building the docs
421
432
install :
433
+ - requirements : docs/requirements.txt
434
+ # Install our python package before building the docs
422
435
- method : pip
423
436
path : .
424
437
@@ -547,36 +560,40 @@ and a new build will be triggered for it.
547
560
You can read more about :ref: `hidden versions <versions:hidden >`
548
561
in our documentation.
549
562
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.
552
565
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.
556
566
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
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
561
569
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 .
565
573
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:
570
578
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.
573
582
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
578
595
579
- Warning for old versions
596
+ Warning for old versions
580
597
581
598
Getting insights from your projects
582
599
-----------------------------------
0 commit comments