Skip to content

Commit fc312a8

Browse files
committed
Add docs for building docs
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
1 parent c7b867c commit fc312a8

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

docs/documentation.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Documentation Development
2+
3+
- [Documentation Development](#documentation-development)
4+
- [Build the Documentation](#build-the-documentation)
5+
- [Live Building](#live-building)
6+
7+
8+
## Build the Documentation
9+
10+
The following sections describe how to set up and build the NeMo RL documentation.
11+
12+
Switch to the documentation source folder and generate HTML output.
13+
14+
```sh
15+
cd docs/
16+
uv run --only-group docs sphinx-build . _build/html
17+
```
18+
19+
* The resulting HTML files are generated in a `_build/html` folder that is created under the project `docs/` folder.
20+
* The generated python API docs are placed in `apidocs` under the `docs/` folder.
21+
22+
## Checking for Broken Links
23+
24+
To check for broken http links in the docs, run this command:
25+
26+
```sh
27+
cd docs/
28+
uv run --only-group docs sphinx-build --builder linkcheck . _build/linkcheck
29+
```
30+
31+
It will output a JSON file at `_build/linkcheck/output.json` with links it found while building the
32+
docs. Records will have a status of `broken` if the link is not reachable. The `docs/conf.py` file is
33+
configured to ignore github links because the CI test will often experience rate limit errors.
34+
Comment out the `linkcheck_ignore` variable there to check all the links.
35+
36+
## Live Building
37+
38+
When writing documentation, it can be helpful to serve the documentation and have it update live while you edit.
39+
40+
To do so, run:
41+
42+
```sh
43+
cd docs/
44+
uv run --only-group docs sphinx-autobuild . _build/html --port 12345 --host 0.0.0.0
45+
```
46+
47+
Open a web browser and go to `http://${HOST_WHERE_SPHINX_COMMAND_RUN}:12345` to view the output.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
:caption: Development
77
:hidden:
88
9+
documentation.md
910
apidocs/index.rst
1011
```

0 commit comments

Comments
 (0)