Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit b2d1a21

Browse files
committed
docs: Update conf to build again.
The conf was out of date on libraries including the version of sphinx. So in order to use the edx theme, I updated sphinx and then correct the conf.py to generate docs including configuring django sufficiently.
1 parent fc97ab8 commit b2d1a21

3 files changed

Lines changed: 69 additions & 21 deletions

File tree

docs/api/source/conf.py

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import os
22
import sys
3+
import django
34

4-
from path import path
5+
from path import Path
56

6-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
7-
8-
# sys.path.insert(0, os.path.abspath('..'))
7+
import edx_theme
98

109
# Add any paths that contain templates here, relative to this directory.
1110
# templates_path.append('source/_templates')
@@ -15,38 +14,48 @@
1514
# so a file named "default.css" will overwrite the builtin "default.css".
1615
# html_static_path.append('source/_static')
1716

18-
if not on_rtd: # only import and set the theme if we're building docs locally
19-
import sphinx_rtd_theme
20-
html_theme = 'sphinx_rtd_theme'
21-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
22-
2317
master_doc = 'index'
2418
# If extensions (or modules to document with autodoc) are in another directory,
2519
# add these directories to sys.path here. If the directory is relative to the
2620
# documentation root, use os.path.abspath to make it absolute, like shown here.
27-
root = path('../../..').abspath()
21+
root = Path('../../..').abspath()
2822
sys.path.insert(0, root)
2923
sys.path.append(root / "analytics_data_api/v0/views")
3024
sys.path.append('.')
3125

3226
# -- General configuration -----------------------------------------------------
3327

3428
# django configuration - careful here
35-
if on_rtd:
36-
os.environ['DJANGO_SETTINGS_MODULE'] = 'analyticsdataserver.settings.local'
37-
else:
38-
os.environ['DJANGO_SETTINGS_MODULE'] = 'analyticsdataserver.settings.local'
29+
os.environ['DJANGO_SETTINGS_MODULE'] = 'analyticsdataserver.settings.local'
30+
django.setup()
3931

4032
# Add any Sphinx extension module names here, as strings. They can be extensions
4133
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
4234
extensions = [
35+
'edx_theme',
4336
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx',
44-
'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath',
37+
'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.imgmath',
4538
'sphinx.ext.mathjax', 'sphinx.ext.viewcode']
4639

4740
# List of patterns, relative to source directory, that match files and
4841
# directories to ignore when looking for source files.
4942
exclude_patterns = ['build', 'links.rst']
5043

51-
project = 'Open edX Data Analytics API Version 0 Alpha'
52-
copyright = '2015, edX'
44+
project = 'Open edX Data Analytics API'
45+
copyright = '2021, edX'
46+
47+
# -- Options for HTML output ----------------------------------------------
48+
49+
# The theme to use for HTML and HTML Help pages. See the documentation for
50+
# a list of builtin themes.
51+
#
52+
html_theme = 'edx_theme'
53+
54+
# Theme options are theme-specific and customize the look and feel of a theme
55+
# further. For a list of options available for each theme, see the
56+
# documentation.
57+
#
58+
# html_theme_options = {}
59+
60+
# Add any paths that contain custom themes here, relative to this directory.
61+
html_theme_path = [edx_theme.get_html_theme_path()]

requirements/doc.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
-r base.in # Core dependencies of edx-analytics-data-api
44

5-
Sphinx==1.2.1 # Developer documentation builder
5+
Sphinx # Developer documentation builder
6+
path
7+
edx_sphinx_theme

requirements/doc.txt

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#
55
# make upgrade
66
#
7+
alabaster==0.7.12
8+
# via sphinx
9+
babel==2.9.1
10+
# via sphinx
711
boto==2.42.0
812
# via -r requirements/base.in
913
boto3==1.18.18
@@ -116,6 +120,8 @@ edx-rest-api-client==5.4.0
116120
# via
117121
# -r requirements/base.in
118122
# edx-enterprise-data
123+
edx-sphinx-theme==3.0.0
124+
# via -r requirements/doc.in
119125
elasticsearch==7.14.0
120126
# via elasticsearch-dsl
121127
elasticsearch-dsl==7.4.0
@@ -126,6 +132,8 @@ future==0.18.2
126132
# via pyjwkest
127133
idna==3.2
128134
# via requests
135+
imagesize==1.2.0
136+
# via sphinx
129137
itypes==1.2.0
130138
# via coreapi
131139
jinja2==3.0.1
@@ -148,6 +156,10 @@ ordered-set==3.1.1
148156
# via
149157
# -c requirements/constraints.txt
150158
# -r requirements/base.in
159+
packaging==21.0
160+
# via sphinx
161+
path==16.2.0
162+
# via -r requirements/doc.in
151163
pbr==5.6.0
152164
# via stevedore
153165
psutil==5.8.0
@@ -167,6 +179,8 @@ pyjwt[crypto]==2.1.0
167179
# edx-rest-api-client
168180
pymongo==3.12.0
169181
# via edx-opaque-keys
182+
pyparsing==2.4.7
183+
# via packaging
170184
python-dateutil==2.8.2
171185
# via
172186
# botocore
@@ -175,7 +189,9 @@ python-dateutil==2.8.2
175189
python-memcached==1.59
176190
# via -r requirements/base.in
177191
pytz==2021.1
178-
# via django
192+
# via
193+
# babel
194+
# django
179195
pyyaml==5.4.1
180196
# via edx-django-release-util
181197
requests==2.26.0
@@ -186,6 +202,7 @@ requests==2.26.0
186202
# edx-rest-api-client
187203
# pyjwkest
188204
# slumber
205+
# sphinx
189206
rest-condition==1.0.3
190207
# via edx-drf-extensions
191208
rules==3.0
@@ -203,14 +220,31 @@ six==1.16.0
203220
# edx-django-release-util
204221
# edx-drf-extensions
205222
# edx-rbac
223+
# edx-sphinx-theme
206224
# elasticsearch-dsl
207225
# pyjwkest
208226
# python-dateutil
209227
# python-memcached
210228
slumber==0.7.1
211229
# via edx-rest-api-client
212-
sphinx==1.2.1
213-
# via -r requirements/doc.in
230+
snowballstemmer==2.1.0
231+
# via sphinx
232+
sphinx==4.1.2
233+
# via
234+
# -r requirements/doc.in
235+
# edx-sphinx-theme
236+
sphinxcontrib-applehelp==1.0.2
237+
# via sphinx
238+
sphinxcontrib-devhelp==1.0.2
239+
# via sphinx
240+
sphinxcontrib-htmlhelp==2.0.0
241+
# via sphinx
242+
sphinxcontrib-jsmath==1.0.1
243+
# via sphinx
244+
sphinxcontrib-qthelp==1.0.3
245+
# via sphinx
246+
sphinxcontrib-serializinghtml==1.1.5
247+
# via sphinx
214248
sqlparse==0.4.1
215249
# via django
216250
stevedore==3.3.0
@@ -229,3 +263,6 @@ urllib3==1.26.6
229263
# botocore
230264
# elasticsearch
231265
# requests
266+
267+
# The following packages are considered to be unsafe in a requirements file:
268+
# setuptools

0 commit comments

Comments
 (0)