Skip to content
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

Docs: Configuration file pages as explanation and reference (Diátaxis) #9921

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
a0bb694
WIP: Splitting up configuration file pages
benjaoming Jan 19, 2023
b1966ab
Merge branch 'main' of github.com:readthedocs/readthedocs.org into di…
benjaoming Feb 16, 2023
f42ed12
More sketching
benjaoming Feb 16, 2023
f784be2
Write a very bad introduction to structuring docs
ericholscher Feb 22, 2023
74300b6
Refactor Explanation navigation for new sub-levels
benjaoming Feb 24, 2023
743095b
Merge branch 'diataxis-guide' of github.com:readthedocs/readthedocs.o…
benjaoming Feb 24, 2023
2016b79
Add new topics
benjaoming Feb 24, 2023
4119923
Add suggestions from previous PR
benjaoming Feb 24, 2023
ee2be1a
Rename to "Continuous Documentation", it fits in one line and is a mo…
benjaoming Feb 24, 2023
d51c79a
First quick take at introducing a dedicated documentation platform, s…
benjaoming Feb 24, 2023
8add1b5
WIP: marking an idea of a short and long version of process (needs po…
benjaoming Feb 24, 2023
051a425
Merge branch 'main' of github.com:readthedocs/readthedocs.org into di…
benjaoming Mar 27, 2023
33533fb
Add a better outline of what the article should contain
benjaoming Mar 27, 2023
ef49cc6
Merge branch 'diataxis/explanation-refactor' of github.com:benjaoming…
benjaoming Mar 27, 2023
17d5ba8
Add a bit more copy
benjaoming Mar 27, 2023
f08d6cf
Merge branch 'main' of github.com:readthedocs/readthedocs.org into di…
benjaoming Mar 28, 2023
99fd304
WIP: Removes a lot of intentions and finishes first-draft of remainin…
benjaoming Mar 28, 2023
5b4faf4
Lots of changes, including removal of /choosing-a-site and /integrations
benjaoming Mar 28, 2023
8626053
We should also say "Read the Docs"
benjaoming Mar 28, 2023
4b4c2a7
Improve the examples in Features for the lifecycle of a documentation…
benjaoming Mar 28, 2023
ef44e25
Remove a dangling sentence
benjaoming Mar 28, 2023
f83abb8
Add term reference
benjaoming Mar 28, 2023
2c45f4c
Some texts dangling in Continuous Documentation
benjaoming Mar 28, 2023
0605a44
Big TODO here
benjaoming Mar 28, 2023
8b42967
Merge branch 'main' of github.com:readthedocs/readthedocs.org into di…
benjaoming Apr 6, 2023
5d3d4c5
Add quick intros to "Deep Dive into Read the Docs"
benjaoming Apr 6, 2023
7e462bb
Merge branch 'diataxis/explanation-refactor' of github.com:benjaoming…
benjaoming Apr 6, 2023
6b597ad
Split out methodology section to separate PR
benjaoming Apr 6, 2023
bf1eb49
Remove intro sentence that probably begs for a reference to a mission…
benjaoming Apr 6, 2023
e7982bb
Improve language, added new section "batteries included", diagram abo…
benjaoming Apr 11, 2023
705623d
Add note about "Reader features" rename, update SVG
benjaoming Apr 11, 2023
d1be69b
Additional seealso:: for feature reference (TODO: include:: it)
benjaoming Apr 11, 2023
7c66c54
Merge branch 'main' of github.com:readthedocs/readthedocs.org into di…
benjaoming Apr 11, 2023
c3c7de0
Reference the config file v2 reference directly
benjaoming Apr 11, 2023
2c0dc3f
Merge branch 'diataxis/explanation-refactor' into diataxis/split-conf…
benjaoming Apr 11, 2023
90e18a7
Add configuration file in "Deep dive into Read the Docs"
benjaoming Apr 11, 2023
2964fff
Apply suggestions from @humitos code review
benjaoming Apr 11, 2023
19c6422
A couple of quick updates from @humitos' review
benjaoming Apr 12, 2023
53edc83
Delete commented out feature list
benjaoming Apr 12, 2023
109abd3
Update definitions - define first, then examples
benjaoming Apr 12, 2023
38ad40f
Add some more notes, ideas, polish introduction a bit
benjaoming Apr 12, 2023
f5e0c09
Try and initial restructuring...
ericholscher Apr 14, 2023
ae4e1ae
Merge branch 'main' of github.com:readthedocs/readthedocs.org into di…
benjaoming Apr 17, 2023
5a23748
Add CDN, mention scaling from small project to enterprise, link to ve…
benjaoming Apr 18, 2023
ada4d44
Lifecycle not life-cycle
benjaoming Apr 18, 2023
a2144a7
Merge branch 'main' of github.com:readthedocs/readthedocs.org into di…
benjaoming Apr 18, 2023
a1ec693
Merge branch 'diataxis/explanation-refactor' into diataxis/split-conf…
benjaoming Apr 18, 2023
9cda9c6
Merge branch 'main' of github.com:readthedocs/readthedocs.org into di…
benjaoming Apr 18, 2023
30be3ef
Merge branch 'diataxis/explanation-refactor' of github.com:benjaoming…
benjaoming Apr 18, 2023
05a9998
Merge branch 'diataxis/explanation-refactor' into diataxis/split-conf…
benjaoming Apr 18, 2023
3a69985
Mention .readthedocs.yaml in name of reference, add section about cus…
benjaoming Apr 18, 2023
0e6e31f
quick cleanup
benjaoming Apr 18, 2023
8b98a9b
Add seealso
benjaoming Apr 18, 2023
601b049
Merge branch 'main' of github.com:readthedocs/readthedocs.org into di…
benjaoming Apr 19, 2023
c8439dc
Merge branch 'diataxis/explanation-refactor' of github.com:benjaoming…
benjaoming Apr 19, 2023
3cd6413
Update term ref
benjaoming Apr 20, 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
53 changes: 0 additions & 53 deletions docs/user/choosing-a-site.rst

This file was deleted.

67 changes: 53 additions & 14 deletions docs/user/config-file/index.rst
Original file line number Diff line number Diff line change
@@ -1,27 +1,66 @@
Configuration file
==================
.. TODO: Use new glossary terms added in another PR

In addition to using the admin panel of your project to configure your project,
you can use a configuration file in the root of your project.
The configuration file should be named ``.readthedocs.yaml``.
Versioning your configuration
=============================

.. note::
The lifecycle of a documentation project changes the content and the structure of the documentation.
In addition to this,
**the whole configuration of a project also changes**.

Some other variants like ``readthedocs.yaml``, ``.readthedocs.yml``, etc
are deprecated.
But changing your configuration for your documentation's version 2.x should not make it impossible to keep maintaining the documentation for version 1.x using a previous configuration.

.. seealso::

:doc:`/config-file/v2`
Reference of all the settings offered in the build configuration file.

Consider the following aspects of a documentation project:

:Build environment:
You may depend on a number of packages but your method for installing them changes.
What is installed, how it's installed and what installs it can change.

For instance,
you might change between Pip, Pipenv, Conda etc.

You might also jump between Python 2 and 3 or Python 3.8 and Python 3.10.

:Documentation tools:
Using Sphinx? Using MkDocs? Or some other tool?
All these tools have their own configuration files and special ways to invoke them.

Changing the documentation tool should also be possible in the lifecycle of your documentation.
Read the Docs understands outputs from several different documentation tools and therefore,
it's possible to change documentation tools between different versions of documentation.


You can configure your Read the Docs project by adding a special file ``.readthedocs.yaml`` [1]_ to your Git repository.

Because the file is stored in Git,
the configuration will apply to the exact version that is being built.
This allows you to store different configurations for different versions of your documentation.

The main advantages of using a configuration file over the web interface are:

- Settings are per version rather than per project.
- Settings live in your VCS.
- Settings live in your Git repository.
- They enable reproducible build environments over time.
- Some settings are only available using a configuration file

.. tip::
.. [1] Other variants of the configuration file name like ``readthedocs.yaml``, ``.readthedocs.yml``, etc. are deprecated.

Configuration as Code
---------------------

"Configuration as Code" is a concept whereby the configuration or settings of software is maintained in a Git repository as *code*.
Alternatively, configurations are often added and managed inside the software's own UI,
making it hard to track changes, and reproduce and copy behavior to other projects.

Using a configuration file is the recommended way of using Read the Docs.
Because of its fragility and uniqueness,
the alternative to "Configuration as Code" is also often referred to as snowflake ❄️ configuration.

.. toctree::
:maxdepth: 3
.. seealso::

Version 2 <v2>
:doc:`/guides/reproducible-builds`
In addition to storing your configuration in Git,
we also recommend special practices for making your builds resilient to changes in your software dependencies.
34 changes: 29 additions & 5 deletions docs/user/config-file/v2.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Configuration file v2
=====================
Configuration file .readthedocs.yaml
====================================

Read the Docs supports configuring your documentation builds with a YAML file.
The :doc:`configuration file <index>` must be in the root directory of your project
and be named ``.readthedocs.yaml``.
It's required to be named ``.readthedocs.yaml`` and be placed in the root of your Git repository.

The file can contain a number of settings that are not accessible through the Read the Docs website.

Because the file is stored in Git,
the configuration will apply to the exact version that is being built.
This allows you to store different configurations for different versions of your documentation.

All options are applied to the version containing this file.
Below is an example YAML file which shows the most common configuration options:

.. tabs::
Expand Down Expand Up @@ -942,3 +946,23 @@ These settings aren't supported via the configuration file.
* ``Show versions warning``
* ``Privacy level``
* ``Analytics code``

Custom sub-folder for .readthedocs.yaml
---------------------------------------

In order to support *monorepo* layouts,
it's possible to configure the sub-folder where your ``.readthedocs.yaml`` is found.

Using this configuration makes it possible to create several Read the Docs projects pointing at the same Git repository.
This is recommended for monorepo layouts that host several documentation projects in the same repository.

.. seealso::

:doc:`/guides/setup/monorepo`
This guide explains how to use the configuration.

Previous version: v1
--------------------

Version 1 is deprecated and using it is discouraged,
view its reference here :doc:`/config-file/v2`.
6 changes: 3 additions & 3 deletions docs/user/connected-accounts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ we recommend that you connect your Read the Docs account to your Git provider.
Connecting your account allows for:

* Easy import of your repositories.
* Automatic configuration of your repository :doc:`/integrations`.
which allow Read the Docs to build your docs on every change to your repository
* Automatic configuration of your repository's :term:`webhooks <webhook>`.
which allows Read the Docs to build your docs on every change to your repository.
* Logging into Read the Docs with your |git_providers_or| credentials.


Expand Down Expand Up @@ -71,7 +71,7 @@ Read the Docs does not generally ask for *write* permission to your repository c
and since we only connect to public repositories we don't need special permissions to read them.
However, we do need permissions for authorizing your account
so that you can login to Read the Docs with your connected account credentials
and to setup :doc:`/integrations`
and to setup :term:`webhooks <webhook>`
which allow us to build your documentation on every change to your repository.


Expand Down
4 changes: 2 additions & 2 deletions docs/user/environment-variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Understanding environment variables
===================================

Read the Docs allows you to define your own environment variables to be used in the build process.
It also defines a set of :doc:`default environment variables </reference/environment-variables>` with information about your build.
It also defines a set of :doc:`pre-defined environment variables </reference/environment-variables>` with information about your build.
These are useful for different purposes:

* Custom environment variables are useful for adding build secrets such as API tokens.
* Default environment variables are useful for varying your build specifically for Read the Docs or specific types of builds on Read the Docs.
* Pre-defined environment variables are useful for varying your build specifically for Read the Docs or specific types of builds on Read the Docs.

.. The following introduction is difficult to balance.
.. We should ideally support environment variables in the Config File,
Expand Down
35 changes: 35 additions & 0 deletions docs/user/explanation/advanced.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Deep dive into Read the Docs
============================

In this section,
we explain some of the more specific or advanced concepts of writing documentation on Read the Docs.

⏩️ :doc:`/config-file/index`
Configure your documentation build in a configuration file stored in Git:
The lifecycle of a documentation project changes the content and the structure of the documentation.
In addition to this, **the whole configuration of a project also changes**.

⏩️ :doc:`/subprojects`
Thinking about gathering several documentation projects under the same umbrella?
This is a common need, and using *subprojects* is a flexible option that is recommended for most cases.

⏩️ :doc:`/localization`
Learn more about multilingual documentation projects and how translation workflows are supported.

⏩️ :doc:`/downloadable-documentation`
An introduction to adding downloadable files that can be read offline to your documentation and keep them versioned.

⏩️ :doc:`/environment-variables`
Environment variables can be used to make your documentation builds flexible and easy to customize.
This is a general introduction to environment variables on our platform, both pre-defined and custom environment variables.


.. toctree::
:maxdepth: 2
:hidden:

/config-file/index
/subprojects
/localization
/downloadable-documentation
/environment-variables
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,50 @@



Continuous Documentation Deployment
===================================
Continuous Documentation
========================

Read the Docs is a *Continuous Documentation Deployment* platform for your software project.
Every time you change something in your documentation, Read the Docs will detect your change and build your documentation.
Read the Docs is a *Continuous Documentation* platform for your software project.
Every time you change something in your documentation, Read the Docs will automatically detect your changes,
*build* your documentation,
and finally *deploy* your documentation for readers to see.

The Continuous Integration and Continuous Deployment (CI/CD) features are configured with your repository provider,
such as GitHub, Bitbucket or GitLab.
With each change committed to your repository, we are notified by the configured *webhook*.
The Continuous Integration and Continuous Deployment (:term:`CI/CD`) features are configured with your repository provider,
such as |git_providers_or|.
With each change committed to your repository, we are notified by the configured :term:`webhook`.

When a receive a *webhook* notification, we match it to a project's *Integration*.
When a webhook is received, the matching project will then:
When a receive a *webhook* notification, we match it to a Read the Docs project.
The matching project will then process your build and publish the documentation.

* :doc:`Build </builds>` the latest commit.
* Synchronize your versions based on the latest tag and branch data in Git.
* Run your :doc:`automation rules</automation-rules>`.
* Auto-cancel any currently running builds of the same version.
* Add a log entry to the integration's :guilabel:`Recent Activity`.
.. seealso::

:doc:`/builds`
Read more about the technical specification of the Build process and how you configure it.

.. The short version
.. -----------------

.. If you follow for instance the tutorial,
.. a simple setup will use our builders and deploy everything in the following way:

.. 1. ...
.. 2. ...
.. 3. ...

.. The long version
.. ----------------

.. * :doc:`Build </builds>` the latest commit.
.. * Synchronize your versions based on the latest tag and branch data in Git.
.. * Run your :doc:`automation rules</automation-rules>`.
.. * Auto-cancel any currently running builds of the same version.
.. * Add a log entry to the integration's :guilabel:`Recent Activity`.

Continuous Documentation for software projects
----------------------------------------------

.. TODO: This should be improved

Documentation fits into any CI/CD pipeline by following a process known as *Documentation as Code (Docs as code)*.
The primary method of doing this is by maintaining documentation alongside the source code,
meaning that the documentation's life cycle is the same as your software project.
Expand All @@ -43,6 +65,11 @@ and increases overall value from the documentation you write.
As part of this quick feedback loop,
You can preview documentation changes immediately using :doc:`pull request previews </pull-requests>`.

.. Continuous Documentation for scientific projects
.. ------------------------------------------------

.. We should perhaps write a short introduction here and reference the science page.

Automated versioning
--------------------

Expand Down
Loading