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

Commit 97684ef

Browse files
author
You-Cyuan Jhang
authored
Fix Sphinx-Click Issues on Readthedocs.org (#85)
* Fix sphinx click extension * test trigger read the docs * Fix missing click doc * update readathedocs to use requirements.txt file * add dins dep
1 parent 839286c commit 97684ef

9 files changed

+271
-62
lines changed

.readthedocs.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# .readthedocs.yml
22
version: 2
3-
sphinx:
4-
configuration: docs/source/conf.py
3+
formats: all
54
python:
65
version: 3.7
76
install:
7+
- requirements: docs/requirements.txt
88
- method: pip
99
path: .
10-
extra_requirements:
11-
- docs
10+
sphinx:
11+
builder: html
12+
configuration: docs/source/conf.py

docs/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ help:
1212

1313
clean:
1414
rm -rf $(BUILDDIR)
15-
find $(SOURCEDIR) -name "*.rst" | grep -v index | xargs rm -f
1615

1716
apidoc:
18-
sphinx-apidoc -f --templatedir=$(TEMPLATEDIR) -o $(SOURCEDIR) -d 2 ../datasetinsights/ ../datasetinsights/stats/visualization ../datasetinsights/dashboard.py ../datasetinsights/datasets/protos
19-
html: apidoc
17+
sphinx-apidoc --templatedir=$(TEMPLATEDIR) -o $(SOURCEDIR) -d 2 ../datasetinsights/ ../datasetinsights/stats/visualization ../datasetinsights/dashboard.py ../datasetinsights/datasets/protos
18+
19+
html:
2020
sphinx-build -b html $(SOURCEDIR) $(BUILDDIR)/html
2121
@echo
2222
@echo "Build finished. The HTML doumentation pages are in $(BUILDDIR)/html."

docs/README.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,34 @@ Building documentation
44
Run the following commands from `docs` directory.
55

66
Automatic generate of Sphinx sources using [sphinx-apidoc](https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html)
7+
78
```bash
89
make apidoc
910
```
1011

11-
Build html files
12+
This command only applies to newly created modules. It will not update modules that already exist. You will have to modify `docs/datasetinsighs.module_name` manually.
13+
14+
To build html files, run
1215

1316
```bash
1417
make html
1518
```
1619

1720
You can browse the documentation by opening `build/html/index.html` file directly in any web browser.
1821

19-
Cleanup build files
22+
Cleanup build html files
23+
2024
```bash
2125
make clean
2226
```
2327

24-
2528
Known issues
2629
------------
2730

28-
When using commonmark to convert markdown files to rst files, links to headers cannot have `_` or `.`.
29-
If the header has either of those characters, they should be replaced by dashes `-`.
30-
e.g. if you have a header `#### annotation_definitions.json` in the markdown file, to link to that header the markdown needs to be `[click link](#annotation-definitions-json)`
31+
1. Some of the documents are written in markdown format. We use [recommonmark](https://github.com/readthedocs/recommonmark) to generate documentations. It uses [CommonMark](http://commonmark.org/) to convert markdown files to rst files. Due to it's limitation, links to headers cannot have `_` or `.`. If the header has either of those characters, they should be replaced by dashes `-`. e.g. if you have a header `#### annotation_definitions.json` in the markdown file, to link to that header the markdown needs to be `[click link](#annotation-definitions-json)`
32+
33+
2. `Readthedocs.org` does not currently support [poetry](https://python-poetry.org/) officially. Until then, we have to manually generated a `docs/requirements.txt` file when new requirements is added to the repo. This file can be generated using command:
34+
35+
```bash
36+
poetry export --dev --without-hashes -f requirements.txt > docs/requirements.txt
37+
```

docs/requirements.txt

+190
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
absl-py==0.10.0
2+
alabaster==0.7.12
3+
appdirs==1.4.4
4+
appnope==0.1.0; python_version >= "3.3" and sys_platform == "darwin" or platform_system == "Darwin"
5+
argon2-cffi==20.1.0
6+
astunparse==1.6.3
7+
atomicwrites==1.4.0; sys_platform == "win32"
8+
attrs==20.2.0
9+
babel==2.8.0
10+
backcall==0.2.0; python_version >= "3.3"
11+
black==19.10b0
12+
bleach==3.1.5
13+
bokeh==2.2.1
14+
brotli==1.0.9
15+
cachetools==4.1.1
16+
certifi==2020.6.20
17+
cffi==1.14.2
18+
chardet==3.0.4
19+
click==7.1.2
20+
cloudpickle==1.6.0
21+
codetiming==1.2.0
22+
colorama==0.4.3; python_version >= "3.3" and sys_platform == "win32" or sys_platform == "win32"
23+
commonmark==0.9.1
24+
coverage==5.2.1
25+
cycler==0.10.0
26+
cython==0.29.21
27+
dash==1.12.0
28+
dash-core-components==1.10.0
29+
dash-html-components==1.0.3
30+
dash-renderer==1.4.1
31+
dash-table==4.7.0
32+
dask==2.25.0
33+
decorator==4.4.2; python_version >= "3.3"
34+
defusedxml==0.6.0
35+
deprecated==1.2.10
36+
descartes==1.1.0
37+
distributed==2.25.0
38+
docutils==0.16
39+
entrypoints==0.3
40+
flake8==3.8.3
41+
flask==1.1.2
42+
flask-compress==1.5.0
43+
fsspec==0.8.0
44+
future==0.18.2
45+
gast==0.3.3
46+
google-api-core==1.22.2
47+
google-auth==1.21.1
48+
google-auth-oauthlib==0.4.1
49+
google-cloud-core==1.4.1
50+
google-cloud-storage==1.28.1
51+
google-pasta==0.2.0
52+
google-resumable-media==0.5.1
53+
googleapis-common-protos==1.52.0
54+
grpcio==1.31.0
55+
h5py==2.10.0
56+
heapdict==1.0.1
57+
idna==2.10
58+
imagesize==1.2.0
59+
importlib-metadata==1.7.0; python_version < "3.8"
60+
ipykernel==5.3.4
61+
ipython==7.18.1
62+
ipython-genutils==0.2.0
63+
ipywidgets==7.5.1
64+
isort==4.3.21
65+
itsdangerous==1.1.0
66+
jedi==0.17.2; python_version >= "3.3"
67+
jinja2==2.11.2
68+
joblib==0.16.0
69+
jsonschema==3.2.0
70+
jupyter==1.0.0
71+
jupyter-client==6.1.7
72+
jupyter-console==6.2.0
73+
jupyter-core==4.6.3
74+
keras-preprocessing==1.1.2
75+
kfp==1.0.0
76+
kfp-server-api==1.0.0
77+
kiwisolver==1.2.0
78+
kornia==0.1.4.post2
79+
kubernetes==11.0.0
80+
locket==0.2.0
81+
markdown==3.2.2
82+
markupsafe==1.1.1
83+
matplotlib==3.3.1
84+
mccabe==0.6.1
85+
mistune==0.8.4
86+
more-itertools==8.5.0
87+
msgpack==1.0.0
88+
nbconvert==5.6.1
89+
nbformat==5.0.7
90+
notebook==6.1.4
91+
numpy==1.17.5
92+
nuscenes-devkit==1.0.2
93+
oauthlib==3.1.0
94+
opencv-python==4.4.0.42
95+
opt-einsum==3.3.0
96+
packaging==20.4
97+
pandas==1.1.2
98+
pandocfilters==1.4.2
99+
parso==0.7.1; python_version >= "3.3"
100+
partd==1.1.0
101+
pathspec==0.8.0
102+
pbr==5.5.0
103+
pexpect==4.8.0; python_version >= "3.3" and sys_platform != "win32"
104+
pickleshare==0.7.5; python_version >= "3.3"
105+
pillow==7.2.0
106+
plotly==4.9.0
107+
pluggy==0.13.1
108+
prometheus-client==0.8.0
109+
prompt-toolkit==3.0.7
110+
protobuf==3.13.0
111+
psutil==5.7.2
112+
ptyprocess==0.6.0; python_version >= "3.3" and sys_platform != "win32" or os_name != "nt"
113+
py==1.9.0
114+
pyasn1==0.4.8
115+
pyasn1-modules==0.2.8
116+
pycocotools==2.0.2
117+
pycodestyle==2.6.0
118+
pycparser==2.20
119+
pyflakes==2.2.0
120+
pygments==2.6.1
121+
pyparsing==2.4.7
122+
pyquaternion==0.9.5
123+
pyrsistent==0.17.0
124+
pytest==5.4.3
125+
pytest-cov==2.10.1
126+
python-dateutil==2.8.1
127+
pytorch-ignite==0.3.0
128+
pytz==2020.1
129+
pywin32==228; sys_platform == "win32"
130+
pywinpty==0.5.7; os_name == "nt"
131+
pyyaml==5.3.1
132+
pyzmq==19.0.2
133+
qtconsole==4.7.7
134+
qtpy==1.9.0
135+
recommonmark==0.6.0
136+
regex==2020.7.14
137+
requests==2.24.0
138+
requests-oauthlib==1.3.0
139+
requests-toolbelt==0.9.1
140+
responses==0.10.16
141+
retrying==1.3.3
142+
rsa==4.6; python_version >= "3.5"
143+
scikit-learn==0.23.2
144+
scipy==1.4.1
145+
send2trash==1.5.0
146+
shapely==1.7.1
147+
six==1.15.0
148+
snowballstemmer==2.0.0
149+
sortedcontainers==2.2.2
150+
sphinx==3.2.1
151+
sphinx-click==2.5.0
152+
sphinx-rtd-theme==0.5.0
153+
sphinxcontrib-applehelp==1.0.2
154+
sphinxcontrib-devhelp==1.0.2
155+
sphinxcontrib-htmlhelp==1.0.3
156+
sphinxcontrib-jsmath==1.0.1
157+
sphinxcontrib-qthelp==1.0.3
158+
sphinxcontrib-serializinghtml==1.1.4
159+
strip-hints==0.1.9
160+
tabulate==0.8.7
161+
tblib==1.7.0
162+
tensorboard==2.3.0
163+
tensorboard-plugin-wit==1.7.0
164+
tensorboardx==2.1
165+
tensorflow==2.3.0
166+
tensorflow-estimator==2.3.0
167+
termcolor==1.1.0
168+
terminado==0.8.3
169+
testpath==0.4.4
170+
threadpoolctl==2.1.0
171+
toml==0.10.1
172+
toolz==0.10.0
173+
torch==1.4.0
174+
torchvision==0.5.0
175+
tornado==6.0.4
176+
tqdm==4.48.2
177+
traitlets==5.0.4
178+
typed-ast==1.4.1
179+
typing-extensions==3.7.4.3
180+
urllib3==1.25.10
181+
wcwidth==0.2.5
182+
webencodings==0.5.1
183+
websocket-client==0.57.0
184+
werkzeug==1.0.1
185+
wheel==0.35.1
186+
widgetsnbextension==3.5.1
187+
wrapt==1.12.1
188+
yacs==0.1.8
189+
zict==2.0.0
190+
zipp==3.1.0; python_version < "3.8"

docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"sphinx.ext.autosectionlabel",
3535
"sphinx_rtd_theme",
3636
"sphinx.ext.napoleon",
37-
"sphinx_click.ext",
37+
"sphinx_click",
3838
]
3939

4040
source_suffix = {

docs/source/datasetinsights.commands.rst

+18
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ datasetinsights.commands
55
datasetinsights.commands.download
66
---------------------------------
77

8+
9+
.. click:: datasetinsights.commands.download:cli
10+
:prog: datasetinsights download
11+
:show-nested:
12+
13+
814
.. automodule:: datasetinsights.commands.download
915
:members:
1016
:undoc-members:
@@ -13,6 +19,12 @@ datasetinsights.commands.download
1319
datasetinsights.commands.evaluate
1420
---------------------------------
1521

22+
23+
.. click:: datasetinsights.commands.evaluate:cli
24+
:prog: datasetinsights evaluate
25+
:show-nested:
26+
27+
1628
.. automodule:: datasetinsights.commands.evaluate
1729
:members:
1830
:undoc-members:
@@ -21,6 +33,12 @@ datasetinsights.commands.evaluate
2133
datasetinsights.commands.train
2234
------------------------------
2335

36+
37+
.. click:: datasetinsights.commands.train:cli
38+
:prog: datasetinsights train
39+
:show-nested:
40+
41+
2442
.. automodule:: datasetinsights.commands.train
2543
:members:
2644
:undoc-members:

docs/source/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Contents
9292

9393
Synthetic_Dataset_Schema
9494

95+
9596
Indices and tables
9697
==================
9798

0 commit comments

Comments
 (0)