Skip to content

Commit 401abb9

Browse files
Add new section to have a local HTTP server easily (#833)
1 parent 844361c commit 401abb9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/rustdoc-internals.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,19 @@ runtime. These tests don't have as thorough of a writeup, but a broad example
192192
that features results in all tabs can be found in `basic.js`. The basic idea is
193193
that you match a given `QUERY` with a set of `EXPECTED` results, complete with
194194
the full item path of each item.
195+
196+
## Testing locally
197+
198+
Some features of the generated HTML documentation might require local
199+
storage to be used across pages, which doesn't work well without an HTTP
200+
server. To test these features locally, you can run a local HTTP server, like
201+
this:
202+
203+
```bash
204+
$ ./x.py doc library/std --stage 1
205+
# The documentation has been generated into `build/[YOUR ARCH]/doc`.
206+
$ python3 -m http.server -d build/[YOUR ARCH]/doc
207+
```
208+
209+
Now you can browse your documentation just like you would if it was hosted
210+
on the internet. For example, the url for `std` will be `/std/".

0 commit comments

Comments
 (0)