Skip to content

Commit 82c8d96

Browse files
Sphinx config fix excludes privates plus documentation.md edits (#1180)
1 parent 30c13ec commit 82c8d96

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

docs-api/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
numpydoc_show_class_members = False
4242
napoleon_use_param = False
4343
napoleon_numpy_docstring = True
44-
napoleon_include_private_with_doc = True
44+
napoleon_include_private_with_doc = False
4545
napoleon_include_init_with_doc = True
4646

4747
# Add any paths that contain templates here, relative to this directory.

docs-api/documentation.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ The following are the specific steps in git corresponding to the first part of g
8181
git checkout newfeature
8282
```
8383

84+
#### Install Sphinx and theme
85+
86+
In the `coremltools` clone root directory, install or upgrade Sphinx, the theme, and numpydoc for this environment if you haven’t already done so:
87+
88+
```shell
89+
conda install sphinx
90+
conda install numpydoc
91+
conda install sphinx_rtd_theme
92+
```
93+
94+
8495
#### Edit the content as usual
8596

8697
The following are the specific steps in git corresponding to the last part of general step 1:
@@ -106,10 +117,10 @@ The following are the specific steps in git corresponding to general steps 2-4:
106117
1. From the root folder (`coremltools/`), run the following script:
107118

108119
```shell
109-
zsh -i scripts/build_docs-api.sh
120+
zsh -i scripts/build_docs.sh
110121
```
111122

112-
The HTML files appear in the `docs-api/_build/html/` folder.
123+
The HTML files appear in the `docs/_build/html/` folder.
113124

114125
2. Copy the `html/` folder to a temporarily location on your computer (outside of the `coremltools` clone controlled by git).
115126

@@ -182,19 +193,19 @@ You need to do this only once.
182193
conda install sphinx_rtd_theme
183194
```
184195
185-
4. Create a new `docs-api/` folder in the root folder:
196+
4. Create a new `docs/` folder in the root folder:
186197
187198
```shell
188-
mkdir docs-api
199+
mkdir docs
189200
```
190201
191202
192203
### Set the Sphinx options
193204
194-
1. Change to the `docs-api/` folder and start `sphinx-quickstart`:
205+
1. Change to the `docs/` folder and start `sphinx-quickstart`:
195206
196207
```shell
197-
cd docs-api
208+
cd docs
198209
sphinx-quickstart
199210
```
200211
@@ -205,7 +216,7 @@ You need to do this only once.
205216
> Author name(s): Apple Inc
206217
```
207218
208-
This finishes by adding the following to the `docs-api/` folder (including the hidden `.gitignore`, still there from before):
219+
This finishes by adding the following to the `docs/` folder (including the hidden `.gitignore`, still there from before):
209220
210221
```
211222
_build
@@ -217,7 +228,7 @@ You need to do this only once.
217228
Makefile
218229
```
219230
220-
3. Set the Sphinx configuration by editing the `docs-api/conf.py` file:
231+
3. Set the Sphinx configuration by editing the `docs/conf.py` file:
221232
222233
```python
223234
...
@@ -239,13 +250,13 @@ You need to do this only once.
239250
numpydoc_show_class_members = False
240251
napoleon_use_param = False
241252
napoleon_numpy_docstring = True
242-
napoleon_include_private_with_doc = True
253+
napoleon_include_private_with_doc = False
243254
napoleon_include_init_with_doc = True
244255
...
245256
html_theme = 'sphinx_rtd_theme'
246257
```
247258
248-
4. From the `docs-api/` folder, run `sphinx-apidoc` to create the `source/` folder with the `.rst` files for Sphinx doc generation:
259+
4. From the `docs/` folder, run `sphinx-apidoc` to create the `source/` folder with the `.rst` files for Sphinx doc generation:
249260
250261
```shell
251262
sphinx-apidoc -o source/ ../coremltools
@@ -271,7 +282,7 @@ You need to do this only once.
271282
272283
Make editing changes to the above files as needed to change navigation and content.
273284
274-
2. Create `coremltools.converters.mil.input_types.rst` in the `source/` folder with the [existing version in the repo](https://github.com/apple/coremltools/tree/master/docs-api/source/coremltools.converters.mil.input_types_newest_.rst).
285+
2. Create `coremltools.converters.mil.input_types.rst` in the `source/` folder with the [existing version in the repo](https://github.com/apple/coremltools/tree/master/docs-api/source/coremltools.converters.mil.input_types.rst).
275286
276287
3. Delete all other `.rst` files in your local `source/` folder. You should now have the following files in your local `source/` folder:
277288
@@ -291,7 +302,7 @@ You need to do this only once.
291302
modules.rst
292303
```
293304
294-
4. Switch back to the `docs-api/` folder, and edit the `index.rst` file as follows (or make changes as needed):
305+
4. Switch back to the `docs/` folder, and edit the `index.rst` file as follows (or make changes as needed):
295306
296307
```
297308
coremltools API
@@ -326,10 +337,10 @@ You need to do this only once.
326337
1. From the root folder (`coremltools/`), run the following script:
327338
328339
```shell
329-
zsh -i scripts/build_docs-api.sh
340+
zsh -i scripts/build_docs.sh
330341
```
331342
332-
The HTML files appear in the `docs-api/_build/html/` folder.
343+
The HTML files appear in the `docs/_build/html/` folder.
333344
334345
2. Copy the `html/` folder to a temporarily location on your computer (outside of the `coremltools` clone controlled by git).
335346
@@ -338,10 +349,10 @@ You need to do this only once.
338349
339350
### Iterate on this process
340351
341-
To iterate on this process, switch to the `docs-api/` folder, run `make clean` to delete the old HTML files, and change back to the `coremltools/` root folder:
352+
To iterate on this process, switch to the `docs/` folder, run `make clean` to delete the old HTML files, and change back to the `coremltools/` root folder:
342353
343354
```shell
344-
cd docs-api
355+
cd docs
345356
make clean
346357
cd ..
347358
```

0 commit comments

Comments
 (0)