Skip to content

Commit 31f0da5

Browse files
authored
Docs: review and update the whole FAQ page. (#10732)
* Docs: remove old question from FAQ We are not failing builds that don't ouput an `index.html` on the root. Due to that, this question is not valid anymore. * guilabel * Update question about `sphinx.` and `mkdocs.` configuration * Remove feature flags question We removed 99% of them and we don't want to expose them anymore. * RTD -> Read the Docs * URL update * Fusion two theme questions * Update image scaling question * Update install a Python package question * Update reference * We are not using always-eager anymore These dependencies are not upgraded automatically. * Remove question about Anaconda project YAML This is a pretty old project that's not used anymore. * Sphinx issues fixed
1 parent 53e21bb commit 31f0da5

File tree

1 file changed

+35
-113
lines changed

1 file changed

+35
-113
lines changed

docs/user/faq.rst

+35-113
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This can be because the project is not correctly configured,
2525
because the contents of the Git repository cannot be built,
2626
or in the most rare cases because a system that Read the Docs connects to is not working.
2727

28-
First, you should check out the Builds tab of your project.
28+
First, you should check out the :guilabel:`Builds` tab of your project.
2929
By clicking on the failing step,
3030
you will be able to see details that can lead to resolutions to your build error.
3131

@@ -42,25 +42,6 @@ you can use an important word or message from the error to search for a solution
4242
* :ref:`faq:why do i get import errors from libraries depending on c modules?`
4343

4444

45-
.. Old reference
46-
.. _Help, my build passed but my documentation page is 404 Not Found!:
47-
48-
Why does my project have status "passed" but I get a 404 page?
49-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50-
51-
This often happens because you don't have an `index.html` file being generated.
52-
53-
Make sure you have one of the following files at the top level of your documentation source:
54-
55-
* `index.rst` (Sphinx)
56-
* `index.md` (MkDocs or Sphinx with MyST)
57-
58-
.. tip::
59-
60-
To test if your docs actually built correctly,
61-
you can navigate to a specific page that you know is part of the documentation build,
62-
for example `/en/latest/README.html`.
63-
6445
Why do I get import errors from libraries depending on C modules?
6546
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6647

@@ -76,18 +57,21 @@ successfully build the documentation despite missing dependencies.
7657

7758
With Sphinx you can use the built-in `autodoc_mock_imports`_ for mocking. If
7859
such libraries are installed via ``setup.py``, you also will need to remove all
79-
the C-dependent libraries from your ``install_requires`` in the RTD environment.
60+
the C-dependent libraries from your ``install_requires`` in the Read the Docs environment.
8061

8162
.. _autodoc_mock_imports: http://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports
8263

83-
Where do I need to put my docs for RTD to find it?
84-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8564

86-
Read the Docs will crawl your project looking for a ``conf.py``. Where it finds the ``conf.py``,
87-
it will run ``sphinx-build`` in that directory.
88-
So as long as you only have one set of sphinx documentation in your project, it should Just Work.
65+
Where do I need to put my docs for Read the Docs to find it?
66+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67+
68+
You can put your docs wherever your want on your repository.
69+
However, you will need to tell Read the Docs where your Sphinx's (i.e. ``conf.py``)
70+
or MkDocs' (i.e. ``mkdocs.yml``) configuration file lives in order to build your documentation.
71+
72+
This is done by using ``sphinx.configuration`` or ``mkdocs.configuration`` config key in your Read the Docs configuration file.
73+
Read :doc:`config-file/index` to know more about this.
8974

90-
You can specify an exact path to your documentation using a Read the Docs :doc:`config-file/index`.
9175

9276
How can I avoid search results having a deprecated version of my docs?
9377
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -153,26 +137,10 @@ You can also set your project documentation to install your Python project itsel
153137
* :ref:`faq:Why do I get import errors from libraries depending on C modules?`
154138

155139

156-
Can I have access to additional features or settings?
157-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158-
159-
If this is just a dependency issue,
160-
see :ref:`faq:How do I add additional software dependencies for my documentation?`.
161-
162-
Read the Docs offers some settings (feature flags) which can be used for a variety of purposes.
163-
To enable these settings,
164-
please send an email to [email protected] and we will change the settings for the project.
165-
166-
.. seealso::
167-
168-
:doc:`/feature-flags`
169-
Reference of all Feature Flags that can be requested.
170-
171-
172140
How do I change behavior when building with Read the Docs?
173141
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174142

175-
When RTD builds your project, it sets the :envvar:`READTHEDOCS` environment
143+
When Read the Docs builds your project, it sets the :envvar:`READTHEDOCS` environment
176144
variable to the string ``'True'``. So within your Sphinx :file:`conf.py` file, you
177145
can vary the behavior based on this. For example:
178146

@@ -187,7 +155,7 @@ can vary the behavior based on this. For example:
187155
html_theme = "nature"
188156
189157
The :envvar:`READTHEDOCS` variable is also available in the Sphinx build
190-
environment, and will be set to ``True`` when building on RTD:
158+
environment, and will be set to ``True`` when building on Read the Docs:
191159

192160

193161
.. code-block:: jinja
@@ -200,8 +168,8 @@ environment, and will be set to ``True`` when building on RTD:
200168
I want comments in my docs
201169
~~~~~~~~~~~~~~~~~~~~~~~~~~
202170

203-
RTD doesn't have explicit support for this.
204-
That said, a tool like `Disqus`_ (and the `sphinxcontrib-disqus`_ plugin) can be used for this purpose on RTD.
171+
Read the Docs doesn't have explicit support for this.
172+
That said, a tool like `Disqus`_ (and the `sphinxcontrib-disqus`_ plugin) can be used for this purpose on Read the Docs.
205173

206174
.. _Disqus: https://disqus.com/
207175
.. _sphinxcontrib-disqus: https://pypi.python.org/pypi/sphinxcontrib-disqus
@@ -245,7 +213,7 @@ https://celery.readthedocs.io/projects/kombu/en/latest/
245213

246214
This also works the same for custom domains:
247215

248-
http://docs..org/projects/kombu/en/latest/
216+
http://docs.celeryq.dev/projects/kombu/en/latest/
249217

250218
You can add subprojects in the project admin dashboard.
251219

@@ -262,36 +230,28 @@ See the section on :doc:`localization`.
262230
Sphinx
263231
------
264232

265-
I want to use the Blue/Default Sphinx theme
266-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267-
268-
We think that our theme is badass,
269-
and better than the default for many reasons.
270-
Some people don't like change though |:smile:|,
271-
so there is a hack that will let you keep using the default theme.
272-
If you set the ``html_style`` variable in your ``conf.py``,
273-
it should default to using the default theme.
274-
The value of this doesn't matter, and can be set to ``/default.css`` for default behavior.
275233

234+
.. Old references
235+
.. _I want to use the Blue/Default Sphinx theme:
236+
.. _I want to use the Read the Docs theme locally:
276237

277-
I want to use the Read the Docs theme locally
278-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238+
I want to use the Read the Docs theme
239+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
279240

280-
Read the Docs automatically applies the sphinx-rtd-theme to projects that do not have a defined theme.
281-
If you build a Sphinx project locally,
282-
you should specify that you are using sphinx-rtd-theme.
241+
To use the Read the Docs theme,
242+
you have to specify that in your Sphinx's ``conf.py`` file.
283243

284-
.. seealso::
285-
286-
`sphinx-rtd-theme documentation <https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html>`_
287-
See the official documentation for instructions to enable it in your Sphinx theme.
244+
Read the `sphinx-rtd-theme documentation <https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html>`_
245+
for instructions to enable it in your Sphinx project.
288246

289247

290248
Image scaling doesn't work in my documentation
291249
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
292250

293-
Image scaling in docutils depends on PIL. PIL is installed in the system that RTD runs on. However, if you are using the virtualenv building option, you will likely need to include PIL in your requirements for your project.
294-
251+
Image scaling in ``docutils`` depends on ``Pillow``.
252+
If you notice that image scaling is not working properly on your Sphinx project,
253+
you may need to add ``Pillow`` to your requirements to fix this issue.
254+
Read more about :doc:`guides/reproducible-builds` to define your dependencies in a ``requirements.txt`` file.
295255

296256
Python
297257
------
@@ -300,30 +260,12 @@ Can I document a Python package that is not at the root of my repository?
300260
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
301261

302262
Yes. The most convenient way to access a Python package for example via
303-
`Sphinx's autoapi`_ in your documentation is to use the *Install your project
304-
inside a virtualenv using setup.py install* option in the admin panel of
305-
your project. However this assumes that your ``setup.py`` is in the root of
306-
your repository.
263+
`Sphinx's autoapi`_ in your documentation is to use the
264+
``python.install.method: pip`` (:ref:`config-file/v2:python.install`) configuration key.
307265

308-
If you want to place your package in a different directory or have multiple
309-
Python packages in the same project, then create a pip requirements file. You
310-
can specify the relative path to your package inside the file.
311-
For example you want to keep your Python package in the ``src/python``
312-
directory, then create a ``requirements.txt`` file with the
313-
following contents::
266+
This configuration will tell Read the Docs to install your package in
267+
the virtual environment used to build your documentation so your documentation tool can access to it.
314268

315-
src/python/
316-
317-
Please note that the path must be relative to the working directory where ``pip`` is launched,
318-
rather than the directory where the requirements file is located.
319-
Therefore, even if you want to move the requirements file to a ``requirements/`` directory,
320-
the example path above would work.
321-
322-
You can customize the path to your requirements file and any other installed dependency
323-
using a Read the Docs :doc:`config-file/index`.
324-
325-
.. _Sphinx's autoapi: http://sphinx-doc.org/ext/autodoc.html
326-
.. _pip requirements file: https://pip.pypa.io/en/stable/user_guide.html#requirements-files
327269

328270
Does Read the Docs work well with "legible" docstrings?
329271
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -354,8 +296,8 @@ and as a result, it tends to look a bit better with the default theme.
354296
I need to install a package in a environment with pinned versions
355297
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
356298

357-
To ensure proper installation of a Python package, the ``pip`` :ref:`install method <config-file/v2:python.install>` will automatically upgrade every dependency to its most recent version in case they aren't:term:`pinned <pinning>` by the package definition.
358-
If instead you'd like to pin your dependencies outside the package, you can add this line to your requirements or environment file (if you are using Conda).
299+
If you'd like to pin your dependencies outside the package,
300+
you can add this line to your requirements or environment file (if you are using Conda).
359301

360302
In your ``requirements.txt`` file::
361303

@@ -368,26 +310,6 @@ In your Conda environment file (``environment.yml``)::
368310
-e ..
369311

370312

371-
Can I use Anaconda Project and ``anaconda-project.yml``?
372-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
373-
374-
Yes. With ``anaconda-project>=0.8.4`` you can use the `Anaconda Project`_ configuration
375-
file ``anaconda-project.yaml`` (or ``anaconda-project.yml``) directly in place of a
376-
Conda environment file by using ``dependencies:`` as an alias for ``packages:``.
377-
378-
I.e., your ``anaconda-project.yaml`` file can be used as a ``conda.environment`` config
379-
in the ``.readthedocs.yaml`` config file if it contains::
380-
381-
dependencies:
382-
- python=3.9
383-
- scipy
384-
...
385-
386-
.. _Anaconda Project: https://anaconda-project.readthedocs.io/en/latest/
387-
388-
389-
390-
391313
Other documentation frameworks
392314
------------------------------
393315

0 commit comments

Comments
 (0)