You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-api/documentation.md
+27-16Lines changed: 27 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,17 @@ The following are the specific steps in git corresponding to the first part of g
81
81
git checkout newfeature
82
82
```
83
83
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
+
84
95
#### Edit the content as usual
85
96
86
97
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:
106
117
1. From the root folder (`coremltools/`), run the following script:
107
118
108
119
```shell
109
-
zsh -i scripts/build_docs-api.sh
120
+
zsh -i scripts/build_docs.sh
110
121
```
111
122
112
-
The HTML files appear in the `docs-api/_build/html/` folder.
123
+
The HTML files appear in the `docs/_build/html/` folder.
113
124
114
125
2. Copy the `html/` folder to a temporarily location on your computer (outside of the `coremltools` clone controlled by git).
115
126
@@ -182,19 +193,19 @@ You need to do this only once.
182
193
conda install sphinx_rtd_theme
183
194
```
184
195
185
-
4. Create a new `docs-api/` folder in the root folder:
196
+
4. Create a new `docs/` folder in the root folder:
186
197
187
198
```shell
188
-
mkdir docs-api
199
+
mkdir docs
189
200
```
190
201
191
202
192
203
### Set the Sphinx options
193
204
194
-
1. Change to the `docs-api/` folder and start `sphinx-quickstart`:
205
+
1. Change to the `docs/` folder and start `sphinx-quickstart`:
195
206
196
207
```shell
197
-
cd docs-api
208
+
cd docs
198
209
sphinx-quickstart
199
210
```
200
211
@@ -205,7 +216,7 @@ You need to do this only once.
205
216
> Author name(s): Apple Inc
206
217
```
207
218
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):
209
220
210
221
```
211
222
_build
@@ -217,7 +228,7 @@ You need to do this only once.
217
228
Makefile
218
229
```
219
230
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:
221
232
222
233
```python
223
234
...
@@ -239,13 +250,13 @@ You need to do this only once.
239
250
numpydoc_show_class_members = False
240
251
napoleon_use_param = False
241
252
napoleon_numpy_docstring = True
242
-
napoleon_include_private_with_doc = True
253
+
napoleon_include_private_with_doc = False
243
254
napoleon_include_init_with_doc = True
244
255
...
245
256
html_theme = 'sphinx_rtd_theme'
246
257
```
247
258
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:
249
260
250
261
```shell
251
262
sphinx-apidoc -o source/ ../coremltools
@@ -271,7 +282,7 @@ You need to do this only once.
271
282
272
283
Make editing changes to the above files as needed to change navigation and content.
273
284
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).
275
286
276
287
3. Delete all other `.rst` files in your local `source/` folder. You should now have the following files in your local `source/` folder:
277
288
@@ -291,7 +302,7 @@ You need to do this only once.
291
302
modules.rst
292
303
```
293
304
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):
295
306
296
307
```
297
308
coremltools API
@@ -326,10 +337,10 @@ You need to do this only once.
326
337
1. From the root folder (`coremltools/`), run the following script:
327
338
328
339
```shell
329
-
zsh -i scripts/build_docs-api.sh
340
+
zsh -i scripts/build_docs.sh
330
341
```
331
342
332
-
The HTML files appear in the `docs-api/_build/html/` folder.
343
+
The HTML files appear in the `docs/_build/html/` folder.
333
344
334
345
2. Copy the `html/` folder to a temporarily location on your computer (outside of the `coremltools` clone controlled by git).
335
346
@@ -338,10 +349,10 @@ You need to do this only once.
338
349
339
350
### Iterate on this process
340
351
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:
0 commit comments