Skip to content

Commit cf38507

Browse files
authored
Merge pull request #8751 from readthedocs/separate-dev-docs
Docs: split user and dev docs
2 parents 4a19a9e + 5af0de3 commit cf38507

File tree

1,203 files changed

+143
-77
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,203 files changed

+143
-77
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
- run: tox -e lint
4848
- run: tox -e docs-lint
4949
- run: tox -e docs
50+
- run: tox -e docs-dev
5051
- run: tox -e eslint
5152

5253
workflows:

.readthedocs.yml

-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ 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

docs/conf.py

+37-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/stable/', None),
69101
}
70102
myst_enable_extensions = [
71103
"deflist",
@@ -95,13 +127,13 @@ 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'
@@ -162,4 +194,4 @@ def get_version():
162194

163195

164196
def setup(app):
165-
app.add_css_file('css/sphinx_prompt_css.css')
197+
app.srcdir += '/' + docset

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

+5-4

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

+1-1

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

+1-1

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

+2-2

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

+1-1

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

+11-1

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

+1-1
File renamed without changes.
File renamed without changes.

docs/dev/index.rst

+30

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

+4-4

docs/development/search-integration.rst renamed to docs/dev/search-integration.rst

+2-2

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

+1-1

docs/development/index.rst

-22
This file was deleted.
File renamed without changes.

docs/about.rst renamed to docs/user/about.rst

+1-1

docs/changelog.rst renamed to docs/user/changelog.rst

+1-1

docs/features.rst renamed to docs/user/features.rst

+1-1

docs/gsoc.rst renamed to docs/user/gsoc.rst

+2-2

docs/guides/advanced-search.rst renamed to docs/user/guides/advanced-search.rst

-3
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)