Andrew Bonventre bfb5194568 Revert "godoc: skip build tag annotations when displaying examples"
This reverts commit faa8a71ab532725a7fd9d901a97f74c5038c409b.

Reason for revert: +build tag in test causes build to fail :(

Change-Id: I8942a6dcc29faaceada23b63ba80ea881b3b2ca6
Reviewed-on: https://go-review.googlesource.com/126195
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-07-26 21:04:03 +00:00
..
2017-06-13 17:41:52 +00:00
2014-12-09 22:42:16 +00:00
2017-02-15 21:42:32 +00:00
2018-04-14 19:30:04 +00:00
2017-08-02 21:09:52 +00:00
2018-04-10 16:42:09 +00:00
2015-04-27 04:29:37 +00:00
2018-06-13 15:25:43 +00:00
2018-07-25 19:11:30 +00:00

godoc

This directory contains most of the code for running a godoc server. The executable lives at golang.org/x/tools/cmd/godoc.

Development mode

In production, CSS/JS/template assets need to be compiled into the godoc binary. It can be tedious to recompile assets every time, but you can pass a flag to load CSS/JS/templates from disk every time a page loads:

godoc -templates=$GOPATH/src/golang.org/x/tools/godoc/static -http=:6060

Recompiling static assets

The files that live at static/style.css, static/jquery.js and so on are not present in the final binary. They are placed into static/static.go by running go generate. So to compile a change and test it in your browser:

  1. Make changes to e.g. static/style.css.

  2. Run go generate golang.org/x/tools/godoc/static so static/static.go picks up the change.

  3. Run go install golang.org/x/tools/cmd/godoc so the compiled godoc binary picks up the change.

  4. Run godoc -http=:6060 and view your changes in the browser. You may need to disable your browser's cache to avoid reloading a stale file.