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
# After these checks pass, push your changes and open a PR on your branch
46
46
pre-commit run --all-files
47
47
```
48
-
---
49
48
50
49
## Documentation Style Guidelines
51
50
@@ -55,3 +54,71 @@ pre-commit run --all-files
55
54
- Reuse the launched server as much as possible to reduce server launch time.
56
55
- Do not use absolute links (e.g., `https://docs.sglang.io/get_started/install.html`). Always prefer relative links (e.g., `../get_started/install.md`).
57
56
- Follow the existing examples to learn how to launch a server, send a query and other common styles.
57
+
58
+
## Documentation Build, Deployment, and CI
59
+
60
+
The SGLang documentation pipeline is based on **Sphinx** and supports rendering Jupyter notebooks (`.ipynb`) into HTML/Markdown for web display. Detailed logits can be found in the [Makefile](./Makefile).
61
+
62
+
### Notebook Execution (`make compile`)
63
+
64
+
The `make compile` target is responsible for executing notebooks before rendering:
65
+
66
+
* Finds all `.ipynb` files under `docs/` (excluding `_build/`)
67
+
* Executes notebooks in parallel using GNU Parallel, with a relatively small `--mem-fraction-static`
68
+
* Wraps execution with `retry` to reduce flaky failures
69
+
* Executes notebooks via `jupyter nbconvert --execute --inplace`
70
+
* Records execution timing in `logs/timing.log`
71
+
72
+
This step ensures notebooks contain up-to-date outputs with each commit in the main branch before rendering.
73
+
74
+
### Web Rendering (`make html`)
75
+
76
+
After compilation, Sphinx builds the website:
77
+
78
+
* Reads Markdown, reStructuredText, and Jupyter notebooks
79
+
* Renders them into HTML pages
80
+
* Outputs the website into:
81
+
82
+
```
83
+
docs/_build/html/
84
+
```
85
+
86
+
This directory is the source for online documentation hosting.
87
+
88
+
### Markdown Export (`make markdown`)
89
+
90
+
To support downstream consumers, we add a **new Makefile target**:
91
+
92
+
```bash
93
+
make markdown
94
+
```
95
+
96
+
This target:
97
+
98
+
* Does **not modify**`make compile`
99
+
* Scans all `.ipynb` files (excluding `_build/`)
100
+
* Converts notebooks directly to Markdown using `jupyter nbconvert --to markdown`
101
+
* Writes Markdown artifacts into the existing build directory:
In our [CI](https://github.com/sgl-project/sglang/blob/main/.github/workflows/release-docs.yml), the documentation pipeline first gets all the executed results and renders HTML and Markdown by:
117
+
118
+
```bash
119
+
make compile # execute notebooks (ensure outputs are up to date)
120
+
make html # build website as usual
121
+
make markdown # export markdown artifacts into _build/html/markdown
122
+
```
123
+
124
+
Then, the compiled results are forced pushed to [sgl-project.io](https://github.com/sgl-project/sgl-project.github.io) for rendering. In other words, sgl-project.io is push-only. All the changes of SGLang docs should be made directly in SGLang main repo, then push to the sgl-project.io.
0 commit comments