-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Docs: Refactor and simplify our docs #7052
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
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
728da03
Use theme release 0.5.0rc1 for docs
agjohnson 55d6a0d
Try bumping to Sphinx 3.0.3
agjohnson 488792d
Docs: document server side search
stsewd 60ad8e3
Add note about falling back to the original search engine
stsewd ba0be97
Docs: Refactor and simplify our docs
ericholscher 2b18cb5
Fix header
ericholscher 114432c
Fix table
ericholscher 045b3cd
Flesh out support page
ericholscher 1366980
Clean up support page
ericholscher 22f976a
Refactor guides a bit more to make them a first-level concept
ericholscher 3253440
Orphan old guide index
ericholscher e351cb6
Update docs/features.rst
ericholscher c831161
Update docs/features.rst
ericholscher ea7a8f6
Apply suggestions from code review
ericholscher a7cd0b1
A few more small edits
ericholscher 02ff288
Remove right align
ericholscher 1cc9e54
Add a page on the hosting features that we support.
ericholscher 90753dc
Cleanup local toc
ericholscher a32cc90
A few small refactors
ericholscher 877309f
Rework our FAQ
davidfischer e1bd61e
Fix lint
ericholscher 81b8be8
Don't right-align iamges
ericholscher 43351bb
Merge remote-tracking branch 'origin/agj/theme-0.5.0rc1' into docs-re…
ericholscher 435f4ec
Clean up errors and linking fails
ericholscher 16159aa
Merge remote-tracking branch 'origin/davidfischer/minor-faq-rework' i…
ericholscher 7809329
Apply suggestions from code review
ericholscher 9d2daf3
Lots of feedback from review
ericholscher 5c8d7d0
Fix doclint
ericholscher 283466b
Revert "Merge remote-tracking branch 'origin/agj/theme-0.5.0rc1' into…
ericholscher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule common
updated
3 files
+9 −2 | dockerfiles/entrypoints/build.sh | |
+9 −2 | dockerfiles/entrypoints/celery.sh | |
+0 −2 | dockerfiles/entrypoints/common.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[rstcheck] | ||
ignore_directives=automodule,http:get,tabs,tab,prompt,http:patch,http:post,http:put,http:delete | ||
ignore_roles=djangosetting,setting,featureflags,buildpyversions | ||
ignore_substitutions=org_brand,com_brand | ||
# This error needs to be ignored for now | ||
# See: https://github.com/myint/rstcheck/issues/19 | ||
ignore_messages=(Hyperlink target ".*" is not referenced) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
About Read the Docs | ||
=================== | ||
|
||
Read the Docs is a C Corporation registered in Oregon. | ||
Our bootstrapped company is owned and fully controlled by the founders, | ||
and fully funded by our customers and advertisers. | ||
This allows us to **focus 100% on our users**. | ||
|
||
We have two main sources of revenue: | ||
|
||
* |com_brand| - where we `provide <https://readthedocs.com>`__ a valuable paid service to companies. | ||
* |org_brand| - where we provide a free service to the open source community, funded via :doc:`/advertising/ethical-advertising`. | ||
|
||
We believe that having both paying customers and ethical advertising is the best way to create a sustainable platform for our users. | ||
We have built something that we expect to last a long time, | ||
and we are able to make decisions based only on the best interest of our community and customers. | ||
|
||
All of the source code for Read the Docs is open source. | ||
You are welcome to :doc:`contribute </contribute>` the features you want or run your own instance. | ||
We should note that we generally only support our hosted versions as a matter of :doc:`our philosophy </open-source-philosophy>`. | ||
|
||
We owe a great deal to the open source community that we are a part of, | ||
so we provide free ads via our :ref:`community ads <advertising/ethical-advertising:Community Ads>` program. | ||
This allows us to give back to the communities and projects that we support and depend on. | ||
|
||
We are proud about the way we manage our company and products, | ||
and are glad to have you on board with us in this :doc:`great documentation journey </story>`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,62 +4,29 @@ Build Process | |
Every documentation build has limited resources. | ||
Our current build limits are: | ||
|
||
* 15 minutes of CPU | ||
* 3GB of RAM memory | ||
* 2 concurrent builds | ||
.. tabs:: | ||
|
||
We can increase build limits on a per-project basis, | ||
sending an email to [email protected] providing a good reason why your documentation needs more resources. | ||
If your business is hitting build limits hosting documentation on Read the Docs, | ||
please consider :doc:`Read the Docs for Business </commercial/index>` | ||
which has much higher build resources. | ||
.. tab:: |org_brand| | ||
|
||
You can see the current Docker build images that we use in our `docker repository <https://github.com/readthedocs/readthedocs-docker-images>`_. | ||
`Docker Hub <https://hub.docker.com/r/readthedocs/build/>`_ also shows the latest set of images that have been built. | ||
|
||
Currently in production we're using the ``readthedocs/build:latest`` docker image as our default image. | ||
|
||
How we build documentation | ||
-------------------------- | ||
|
||
When we import your documentation, we look at two things first: your *Repository URL* and the *Documentation Type*. | ||
We will clone your repository, | ||
and then build your documentation using the *Documentation Type* specified. | ||
|
||
Sphinx | ||
~~~~~~ | ||
* 15 minutes build time | ||
* 3GB of memory | ||
* 2 concurrent builds | ||
|
||
When you choose *Sphinx* as your *Documentation Type*, | ||
we will first look for a ``conf.py`` file in your repository. | ||
If we don't find one, | ||
we will generate one for you. | ||
We will look inside a ``doc`` or ``docs`` directory first, | ||
and then look within your entire project. | ||
We can increase build limits on a per-project basis. | ||
Send an email to [email protected] providing a good reason why your documentation needs more resources. | ||
|
||
Then Sphinx will build any files with an ``.rst`` extension. | ||
If your business is hitting build limits hosting documentation on Read the Docs, | ||
please consider :doc:`Read the Docs for Business </commercial/index>` | ||
which has much higher build resources. | ||
|
||
MkDocs | ||
~~~~~~ | ||
.. tab:: |com_brand| | ||
|
||
When you choose *Mkdocs* as your *Documentation Type*, | ||
we will first look for a ``mkdocs.yml`` file in the root of your repository. | ||
If we don't find one, | ||
we will generate one for you. | ||
|
||
Then MkDocs will build any files with a ``.md`` extension within the directory specified as ``docs_dir`` in the ``mkdocs.yml``. | ||
|
||
If no ``mkdocs.yml`` was found in the root of your repository and we generated one for you, | ||
Read the Docs will attempt to set ``docs_dir`` by sequentially searching for a ``docs``, ``doc``, ``Doc``, or ``book`` directory. | ||
The first of these directories that exists and contains files with a ``.md`` extension will be set to ``docs_dir`` within ``mkdocs.yml``, | ||
and MkDocs will build the ``.md`` files in that directory. | ||
As MkDocs doesn't support automatic PDF generation, | ||
Read the Docs cannot create a PDF version of your documentation with the *Mkdocs* option. | ||
|
||
.. warning:: | ||
|
||
We strongly recommend to :ref:`pin the MkDocs version <guides/specifying-dependencies:Specifying Dependencies>` | ||
used for your project to build the docs to avoid potential future incompatibilities. | ||
* 30 minutes build time | ||
* 7GB of memory | ||
* 4 concurrent builds | ||
|
||
If you are having trouble with your documentation builds, | ||
you can reach our support at [email protected]. | ||
|
||
Understanding what's going on | ||
----------------------------- | ||
|
@@ -70,35 +37,32 @@ It should also allow you to take advantage of certain things that happen during | |
The first step of the process is that we check out your code from the repository you have given us. | ||
If the code is already checked out, we update the copy to the branch that you have specified in your project's configuration. | ||
|
||
Then we build the proper backend code for the type of documentation you've selected. | ||
Then we build the proper backend code for the type of documentation you've selected, | ||
this is done inside a :ref:`Docker container <builds:Docker images>`. | ||
|
||
At this point, if you need extra requirements, | ||
or even install your own package in the virtual environment to build your documentation, | ||
you can use a :doc:`config-file/index`. | ||
|
||
When we build your Sphinx documentation, we run ``sphinx-build -b html . _build/html``, | ||
where ``html`` would be replaced with the correct backend. | ||
When we build your Sphinx documentation, we run ``sphinx-build -b <format> . _build/<format>`` | ||
We also create pdf's and ePub's automatically based on your project. | ||
For MkDocs, we run ``mkdocs build``. | ||
|
||
Then these files are copied across to our application servers from the build server. | ||
Once on the application servers, they are served from nginx. | ||
Once these files are built, | ||
they are deployed to our file hosting backend and will be visible to users. | ||
|
||
An example in code: | ||
|
||
.. code-block:: python | ||
|
||
update_docs_from_vcs(version) | ||
config = get_config(project) | ||
if config.python.install.method.setuptools: | ||
run('python setup.py install') | ||
if config.python.install.method.pip: | ||
run('pip install .') | ||
if config.python.install.requirement: | ||
run('pip install -r %s' % config.python.install.requirement) | ||
build_docs(version=version) | ||
copy_files(artifact_dir) | ||
|
||
build_docs(version) | ||
deploy_docs(version) | ||
|
||
.. note:: | ||
|
||
|
@@ -108,79 +72,36 @@ An example in code: | |
:doc:`dependencies are specified <guides/specifying-dependencies>`. | ||
Some examples of pinning versions might be ``sphinx<2.0`` or ``mkdocs>=1.0``. | ||
|
||
Builder responsibility | ||
---------------------- | ||
|
||
Builders have a very specific job. | ||
They take the updated source code and generate the correct artifacts. | ||
The code lives in ``self.version.project.checkout_path(self.version.slug)``. | ||
The artifacts should end up in ``self.version.project.artifact_path(version=self.version.slug, type=self.type)`` | ||
Where ``type`` is the name of your builder. | ||
All files that end up in the artifact directory should be in their final form. | ||
|
||
The build environment | ||
--------------------- | ||
|
||
The build process is executed inside Docker containers, | ||
by default the image used is ``readthedocs/build:latest``, | ||
but you can change that using a :doc:`config-file/index`. | ||
|
||
.. note:: | ||
|
||
The Docker images have a select number of C libraries installed, | ||
because they are used across a wide array of python projects. | ||
We can't install every C library out there, | ||
but we try and support the major ones. | ||
|
||
.. tip:: | ||
|
||
If you want to know the specific version of a package that is installed in the image | ||
you can check the `Ubuntu package search page <https://packages.ubuntu.com/>`__. | ||
|
||
More details on software installed in images could be found by browsing specific branch in `rtfd/readthedocs-docker-images <https://github.com/readthedocs/readthedocs-docker-images>`__ repository. | ||
|
||
Writing your own builder | ||
------------------------ | ||
|
||
.. note:: Builds happen on a server using only the RTD Public API. There is no reason that you couldn't build your own independent builder that wrote into the RTD namespace. The only thing that is currently unsupported there is a saner way than uploading the processed files as a zip. | ||
|
||
The documentation build system in RTD is made pluggable, so that you can build out your own backend. If you have a documentation format that isn't currently supported, you can add support by contributing a backend. | ||
|
||
`The builder backends`_ detail the higher level parts of the API that you need to implement. A basic run goes something like this: | ||
|
||
.. sourcecode:: python | ||
|
||
backend = get_backend(project.documentation_type) | ||
if force: | ||
backend.force(version) | ||
backend.clean(version) | ||
backend.build(version) | ||
if success: | ||
backend.move(version) | ||
|
||
.. _The builder backends: https://github.com/readthedocs/readthedocs.org/tree/master/readthedocs/doc_builder/backends | ||
|
||
Deleting a stale or broken build environment | ||
-------------------------------------------- | ||
|
||
If you're having trouble getting your version to build, try wiping out the existing build/environment files. On your version list page ``/projects/[project]/versions`` there is a "Wipe" button that will remove all of the files associated with your documentation build, but not the documentation itself. | ||
|
||
Build environment | ||
----------------- | ||
|
||
The *Sphinx* and *Mkdocs* builders set the following RTD-specific environment variables when building your documentation: | ||
|
||
.. csv-table:: | ||
:header-rows: 1 | ||
.. csv-table:: Environment Variables | ||
:header: Environment variable, Description, Example value | ||
:widths: 15, 10, 30 | ||
|
||
``READTHEDOCS``, Whether the build is running inside RTD, ``True`` | ||
``READTHEDOCS_VERSION``, The RTD name of the version which is being built, ``latest`` | ||
``READTHEDOCS_PROJECT``, The RTD slug of the project which is being built, ``my-example-project`` | ||
``READTHEDOCS_LANGUAGE``, The RTD language slug of the project which is being built, ``en`` | ||
ericholscher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Environment variable, Description, Example value | ||
``READTHEDOCS``, Whether the build is running inside RTD, ``True`` | ||
``READTHEDOCS_VERSION``, The RTD name of the version which is being built, ``latest`` | ||
``READTHEDOCS_PROJECT``, The RTD slug of the project which is being built, ``my-example-project`` | ||
``READTHEDOCS_LANGUAGE``, The RTD language slug of the project which is being built, ``en`` | ||
If you want to learn more about how the build environment works as a low level, | ||
you can read about it in our :doc:`/development/buildenvironments` docs. | ||
|
||
.. tip:: | ||
|
||
In case extra environment variables are needed to the build process (like secrets, tokens, etc), | ||
you can add them going to :guilabel:`Admin` > :guilabel:`Environment Variables` in your project. | ||
See :doc:`guides/environment-variables`. | ||
|
||
|
||
Docker images | ||
------------- | ||
|
||
The build process is executed inside Docker containers, | ||
by default the image used is ``readthedocs/build:latest``, | ||
but you can change that using a :doc:`/config-file/index`. | ||
|
||
You can see the current Docker build images that we use in our `docker repository <https://github.com/readthedocs/readthedocs-docker-images>`_. | ||
`Docker Hub <https://hub.docker.com/r/readthedocs/build/>`_ also shows the latest set of images that have been built. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯