Skip to content

Commit d418306

Browse files
committed
Merge remote-tracking branch 'origin' into use-django-storages
2 parents d8f7b71 + 75b4a2e commit d418306

File tree

1,452 files changed

+8363
-8187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,452 files changed

+8363
-8187
lines changed

.circleci/config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
name: search
1111
environment:
1212
discovery.type: single-node
13+
ES_JAVA_OPTS: -Xms750m -Xmx750m
1314
steps:
1415
- checkout
1516
- run: git submodule sync
@@ -47,6 +48,7 @@ jobs:
4748
- run: tox -e lint
4849
- run: tox -e docs-lint
4950
- run: tox -e docs
51+
- run: tox -e docs-dev
5052
- run: tox -e eslint
5153

5254
workflows:

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
* @readthedocs/backend
22

3-
docs/* @readthedocs/advocacy
3+
/docs/ @readthedocs/advocacy

.github/ISSUE_TEMPLATE/bug.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ about: Report some incorrect or unexpected behavior
55

66
## Details
77

8-
* Read the Docs project URL:
9-
* Build URL (if applicable):
10-
* Read the Docs username (if applicable):
8+
* Read the Docs project URL: https://readthedocs.org/projects/{your_project_slug}/
9+
* Build URL (if applicable): https://readthedocs.org/projects/{your_project_slug}/builds/{build_id}/
10+
* Read the Docs username (if applicable): https://readthedocs.org/profiles/{your_rtd_username}/
1111

1212
## Expected Result
1313

.readthedocs.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,10 @@ build:
1616
python: "3.8"
1717

1818
search:
19-
ignore:
20-
# Internal documentation
21-
- development/design/*
22-
- search.html
23-
- 404.html
2419
ranking:
2520
# Deprecated content
2621
api/v1.html: -1
27-
config-file/v1.html: -1
22+
config-file/v1.html: -5
2823

2924
# Useful content, but not something we want most users finding
3025
changelog.html: -6

CHANGELOG.rst

+210
Large diffs are not rendered by default.

common

Submodule common updated 1 file

dockerfiles/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ RUN ln -s /usr/bin/python3 /usr/bin/python
5050
WORKDIR /tmp
5151

5252
COPY requirements/pip.txt pip.txt
53+
COPY requirements/debug.txt debug.txt
5354
COPY requirements/docker.txt docker.txt
5455
RUN pip3 install --no-cache-dir -r docker.txt
5556

docs/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
8-
BUILDDIR = _build
8+
BUILDDIR = _build/$(RTD_DOCSET)
99

1010
# Do not use local Django settings during the docs build
1111
export DJANGO_SETTINGS_SKIP_LOCAL = True

docs/_static/css/custom.css

+2-38
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,7 @@
55
}
66

77

8-
/* RTD docs ad placement in the lower right */
9-
#rtd-stickybox {
10-
z-index: 1000;
11-
position: fixed;
12-
bottom: 20px;
13-
right: 20px;
14-
}
15-
#rtd-stickybox .ea-content {
16-
background: rgba(230, 230, 230);
17-
}
18-
#rtd-stickybox .stickybox-hide {
19-
cursor: pointer;
20-
position: absolute;
21-
top: 0.5rem;
22-
right: 0.5rem;
23-
24-
background-color: #fefefe;
25-
border: 1px solid #088cdb;
26-
border-radius: 50%;
27-
color: #088cdb;
28-
font-size: 0.75rem;
8+
/* Center the RTD placement when not wide enough to float */
9+
#rtd-stickybox-container {
2910
text-align: center;
30-
height: 1rem;
31-
width: 1rem;
32-
}
33-
34-
/* Placement under content on smaller screens/tablets/mobile */
35-
@media (max-width: 1340px) {
36-
#rtd-stickybox {
37-
position: static;
38-
bottom: 0;
39-
right: 0;
40-
margin: auto;
41-
text-align: center;
42-
}
43-
44-
#rtd-stickybox .stickybox-hide {
45-
display: none;
46-
}
4711
}

docs/_templates/ethicalads.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<div id="rtd-stickybox">
2-
<div class="stickybox-hide" onclick="document.querySelector('#rtd-stickybox').remove();">&#215;</div>
3-
<div class="raised" data-ea-publisher="readthedocs" data-ea-type="image"></div>
1+
<div id="rtd-stickybox-container">
2+
<div class="raised" data-ea-publisher="readthedocs" data-ea-type="image" data-ea-style="stickybox"></div>
43
</div>

docs/choosing-a-site.rst

-47
This file was deleted.

docs/conf.py

+43-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
"""
2+
Shared Sphinx configuration.
3+
4+
Each docset corresponds to a directory containing several rst/md files,
5+
sharing this same conf.py file. To build a docset an environment variable
6+
is used, ``RTD_DOCSET``, values given in the settings are relative to this
7+
conf.py file, if you want to give a different value for a docset, use the
8+
``docsets`` dictionary, or if you want to extend the current value,
9+
use f'{docset}/setting' as value on the setting, for example::
10+
11+
html_static_path = ['_static', f'{docset}/_static']
12+
"""
13+
114
import os
215
import sys
316
from configparser import RawConfigParser
@@ -14,6 +27,24 @@
1427
django.setup()
1528

1629

30+
# Set here the variables you want for each docset.
31+
docsets = {
32+
'user': {
33+
'project': 'Read the Docs user documentation',
34+
},
35+
'dev': {
36+
'project': 'Read the Docs developer documentation',
37+
},
38+
}
39+
docset = os.environ.get('RTD_DOCSET', 'user')
40+
if docset not in docsets:
41+
print(f'Invalid RTD_DOCSET value: "{docset}"')
42+
exit(1)
43+
44+
for k, v in docsets[docset].items():
45+
locals()[k] = v
46+
47+
1748
def get_version():
1849
"""Return package version from setup.cfg."""
1950
config = RawConfigParser()
@@ -41,7 +72,6 @@ def get_version():
4172
templates_path = ['_templates']
4273

4374
master_doc = 'index'
44-
project = 'Read the Docs'
4575
copyright = '2010-{}, Read the Docs, Inc & contributors'.format(
4676
timezone.now().year
4777
)
@@ -66,6 +96,8 @@ def get_version():
6696
'jupyterbook': ('https://jupyterbook.org/', None),
6797
'myst-parser': ('https://myst-parser.readthedocs.io/en/v0.15.1/', None),
6898
'rst-to-myst': ('https://rst-to-myst.readthedocs.io/en/stable/', None),
99+
'rtd': ('https://docs.readthedocs.io/en/stable/', None),
100+
'rtd-dev': ('https://dev.readthedocs.io/en/latest/', None),
69101
}
70102
myst_enable_extensions = [
71103
"deflist",
@@ -95,20 +127,26 @@ def get_version():
95127
language = 'en'
96128

97129
locale_dirs = [
98-
'locale/',
130+
f'{docset}/locale/',
99131
]
100132
gettext_compact = False
101133

102134
html_theme = 'sphinx_rtd_theme'
103-
html_static_path = ['_static']
104-
html_css_files = ['css/custom.css']
135+
html_static_path = ['_static', f'{docset}/_static']
136+
html_css_files = ['css/custom.css', 'css/sphinx_prompt_css.css']
105137
html_js_files = ['js/expand_tabs.js']
106138
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
107139
html_logo = 'img/logo.svg'
108140
html_theme_options = {
109141
'logo_only': True,
110142
'display_version': False,
111143
}
144+
html_context = {
145+
# Fix the "edit on" links.
146+
# TODO: remove once we support different rtd config
147+
# files per project.
148+
'conf_py_path': f'/docs/{docset}/',
149+
}
112150

113151
hoverxref_auto_ref = True
114152
hoverxref_domains = ['py']
@@ -162,4 +200,4 @@ def get_version():
162200

163201

164202
def setup(app):
165-
app.add_css_file('css/sphinx_prompt_css.css')
203+
app.srcdir += '/' + docset
File renamed without changes.
File renamed without changes.

docs/contribute.rst renamed to docs/dev/contribute.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Contributing to development
2323

2424
If you want to deep dive and help out with development on Read the Docs, then
2525
first get the project installed locally according to the
26-
:doc:`installation guide </development/install>`. After that is done we
26+
:doc:`installation guide </install>`. After that is done we
2727
suggest you have a look at tickets in our issue tracker that are labelled `Good
2828
First Issue`_. These are meant to be a great way to get a smooth start and
2929
won't put you in front of the most complex parts of the system.
@@ -38,7 +38,8 @@ They are simply things that are explained.
3838
If you still didn't find something to work on, search for the `Sprintable`_ label.
3939
Those tickets are meant to be standalone and can be worked on ad-hoc.
4040

41-
You can read all of our :doc:`/development/index` to understand more the development of Read the Docs. When contributing code, then please follow the standard Contribution Guidelines set forth at `contribution-guide.org`_.
41+
You can read all of our :doc:`/index` to understand more the development of Read the Docs.
42+
When contributing code, then please follow the standard Contribution Guidelines set forth at `contribution-guide.org`_.
4243

4344
.. _Feature: https://github.com/readthedocs/readthedocs.org/issues?direction=desc&labels=Feature&page=1&sort=updated&state=open
4445
.. _Improvement: https://github.com/readthedocs/readthedocs.org/issues?q=is%3Aopen+is%3Aissue+label%3AImprovement
@@ -54,7 +55,7 @@ Contributing to documentation
5455
Documentation for Read the Docs itself is hosted by Read the Docs at https://docs.readthedocs.io (likely the website you are currently reading).
5556

5657
There are guidelines around writing and formatting documentation for the project.
57-
For full details, including how to build it, see :doc:`/development/docs`.
58+
For full details, including how to build it, see :doc:`/docs`.
5859

5960

6061
Triaging tickets
@@ -196,7 +197,7 @@ few more at hand to further categorize issues.
196197
handled during a sprint. They are very focused and encapsulated.
197198

198199
For a full list of available labels and their meanings, see
199-
:doc:`/development/issue-labels`.
200+
:doc:`/issue-labels`.
200201

201202
Helpful links for triaging
202203
~~~~~~~~~~~~~~~~~~~~~~~~~~

docs/development/design.rst renamed to docs/dev/design.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ time and design skills to Read the Docs? That's
77
a few features available to ease the process of
88
working with Read the Doc's CSS and static assets.
99

10-
To start, you should follow the :doc:`/development/install` instructions
10+
To start, you should follow the :doc:`/install` instructions
1111
to get a working copy of the Read the Docs repository locally.
1212

1313
.. TODO: update to match the new ext-theme
File renamed without changes.

docs/development/design/embed-api.rst renamed to docs/dev/design/embed-api.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ and remove some quirkiness that makes it hard to maintain and difficult to use.
2323
Current implementation
2424
----------------------
2525

26-
The current implementation of the API is partially documented in :doc:`/guides/embedding-content`.
26+
The current implementation of the API is partially documented in :doc:`rtd:guides/embedding-content`.
2727
It has some known problems:
2828

2929
* There are different ways of querying the API: ``?url=`` (generic) and ``?doc=`` (relies on Sphinx's specific concept)

docs/development/design/in-doc-search-ui.rst renamed to docs/dev/design/in-doc-search-ui.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ This is a GSoC'19 project.
1818

1919
The final result may look something like this:
2020

21-
.. figure:: ../../_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif
21+
.. figure:: /_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif
2222
:align: center
23-
:target: ../../_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif
23+
:target: /_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif
2424

2525
Short demo
2626

@@ -49,7 +49,7 @@ Existing Search Implementation
4949

5050
We have a detailed documentation explaining the underlying architecture of our search backend
5151
and how we index documents to our Elasticsearch index.
52-
You can read about it :doc:`here <../search>`.
52+
You can read about it :doc:`here </server-side-search>`.
5353

5454

5555
Proposed Architecture for In-Doc Search UI
File renamed without changes.

docs/development/design/theme-context.rst renamed to docs/dev/design/theme-context.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Note that this dictionary is injected under the main key `readthedocs`:
112112
so it's your responsibility to use this context in a proper way.
113113

114114
In case you want *fresh data* at the moment of reading your documentation,
115-
you should consider using the :doc:`Read the Docs Public API </api/index>` via Javascript.
115+
you should consider using the :doc:`Read the Docs Public API <rtd:api/index>` via Javascript.
116116

117117

118118
Using Read the Docs context in your theme
File renamed without changes.

docs/development/docs.rst renamed to docs/dev/docs.rst

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Building and Contributing to Documentation
33

44
As one might expect,
55
the documentation for Read the Docs is built using Sphinx and hosted on Read the Docs.
6-
The docs are kept in the ``docs/`` directory at the top of the source tree.
6+
The docs are kept in the ``docs/`` directory at the top of the source tree,
7+
and are divided into developer and user-facing documentation.
78

89
Contributing through the Github UI
910
----------------------------------
@@ -51,11 +52,20 @@ you may want to verify those changes locally before pushing upstream.
5152
5253
#. build the documents
5354

55+
To build the user-facing documentation:
56+
5457
.. code-block:: console
5558
5659
(.venv) $ cd docs
5760
(.venv) $ make livehtml
5861
62+
To build the developer documentation:
63+
64+
.. code-block:: console
65+
66+
(.venv) $ cd docs
67+
(.venv) $ RTD_DOCSET=dev make livehtml
68+
5969
#. the documents will be available at http://127.0.0.1:4444/ and will rebuild each time you edit and save a file.
6070

6171
Guidelines

docs/development/front-end.rst renamed to docs/dev/front-end.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ in.
5555
Getting Started
5656
---------------
5757

58-
You will need to follow our :doc:`guide to install a development Read the Docs instance </development/install>` first.
58+
You will need to follow our :doc:`guide to install a development Read the Docs instance </install>` first.
5959

6060
The sources for our bundles are found in the per-application path
6161
``static-src``, which has the same directory structure as ``static``. Files in

0 commit comments

Comments
 (0)