From a49fce9a12e5827a735ba88a5a9241994a801f83 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 23 Aug 2020 14:36:45 +0200 Subject: [PATCH] Add new section to have a local HTTP server easily (#833) --- src/rustdoc-internals.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/rustdoc-internals.md b/src/rustdoc-internals.md index d44e6679..f9c37ecd 100644 --- a/src/rustdoc-internals.md +++ b/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/".