about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-08-23 14:36:45 +0200
committerGitHub <noreply@github.com>2020-08-23 14:36:45 +0200
commitafc0efe2cba1e20df35544007fda35c1fb04d3c2 (patch)
tree608db6ecb222952b166a95f8fdabab67f5bf2007 /src/doc/rustc-dev-guide
parent3c4555747238c31cb0bb91094be7106d54d259ab (diff)
downloadrust-afc0efe2cba1e20df35544007fda35c1fb04d3c2.tar.gz
rust-afc0efe2cba1e20df35544007fda35c1fb04d3c2.zip
Add new section to have a local HTTP server easily (#833)
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rw-r--r--src/doc/rustc-dev-guide/src/rustdoc-internals.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/rustdoc-internals.md b/src/doc/rustc-dev-guide/src/rustdoc-internals.md
index d44e6679b91..f9c37ecd4a6 100644
--- a/src/doc/rustc-dev-guide/src/rustdoc-internals.md
+++ b/src/doc/rustc-dev-guide/src/rustdoc-internals.md
@@ -192,3 +192,19 @@ runtime. These tests don't have as thorough of a writeup, but a broad example
 that features results in all tabs can be found in `basic.js`. The basic idea is
 that you match a given `QUERY` with a set of `EXPECTED` results, complete with
 the full item path of each item.
+
+## Testing locally
+
+Some features of the generated HTML documentation might require local
+storage to be used across pages, which doesn't work well without an HTTP
+server. To test these features locally, you can run a local HTTP server, like
+this:
+
+```bash
+$ ./x.py doc library/std --stage 1
+# The documentation has been generated into `build/[YOUR ARCH]/doc`.
+$ python3 -m http.server -d build/[YOUR ARCH]/doc
+```
+
+Now you can browse your documentation just like you would if it was hosted
+on the internet. For example, the url for `std` will be `/std/".