|
1 | 1 | # Macaron documentation |
2 | | -This directory contains the Sphinx documentation for Macaron. |
| 2 | +This directory contains the source for the documentation of Macaron hosted [here](https://oracle-samples.github.io/macaron/). |
3 | 3 |
|
4 | | -## Generating the HTML documentation from source |
5 | | -**Note**: We only include the API documentation at the moment. Other sections in the documentation will be migrated in the future. |
6 | | - |
7 | | -First, make sure you have all the dependencies required to build the documentation (Assume we run the following commands in the root directory of this repo). |
8 | | - |
9 | | -**TODO**: Add docs dependencies to `pyproject.toml`. |
10 | | - |
11 | | -``` |
12 | | -python -m pip install --editable . |
13 | | -``` |
14 | | - |
15 | | -To generate documentation in html form: |
| 4 | +## Build the documentation |
16 | 5 |
|
| 6 | +To build the documentation, please follow these steps: |
| 7 | +1. Setup the dev environment for Macaron using the instructions [here](../README.md#getting-started). |
| 8 | +2. Build the documentation by running this command from the root directory of Macaron: |
17 | 9 | ``` |
18 | | -sphinx-build -b html docs/source docs/build -E |
| 10 | +make docs |
19 | 11 | ``` |
20 | 12 |
|
21 | | -Or within the [docs](./) folder, run: |
22 | | -``` |
23 | | -make html |
24 | | -``` |
25 | | - |
26 | | -To view the html documentation on localhost: |
| 13 | +This command will build and generate the documentation into `docs/_build/html`. To view it locally, run (with the dev environment activated): |
27 | 14 |
|
28 | 15 | ``` |
29 | 16 | python3 -m http.server -d docs/_build/html |
30 | 17 | ``` |
31 | 18 |
|
32 | | -## For developers: Generating the API docs. |
33 | | -The Sphinx API docs for Macaron can be generated using the [sphinx-apidoc](https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html) tool that comes with `sphinx`. |
| 19 | +## Extend the API reference. |
| 20 | + |
| 21 | +If you add a new module, make sure that it is added to the API reference. The API reference is generated using the [sphinx-apidoc](https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html) tool. |
34 | 22 |
|
35 | | -From within the root directory of Macaron, run: |
| 23 | +From within the root directory of Macaron, run (with the dev environment activated): |
36 | 24 | ``` |
37 | 25 | sphinx-apidoc --no-toc --module-first --force --maxdepth 1 --output-dir docs/source/pages/apidoc/ src/ |
38 | 26 | ``` |
39 | 27 |
|
40 | | -The output RST files will be generated into [pages/apidoc/](./source/pages/apidoc/) where it will be picked up when we build the documentation. |
| 28 | +This command will generate the API reference RST files into `docs/source/pages/apidoc/`. Make sure to check in the changed source files to the repository. |
0 commit comments