go/godoc/static
Agniva De Sarker 3e7aa9e599 godoc: generate TOC from server-side for search page
Currently, we generate the TOC for a page dynamically after page load
through javascript. This is fine for pages with static content.

But for pages with dynamic output like /search, sometimes this causes a
noticeable page jump due to extensive DOM traversal. Also, the heuristics
to calculate the no. of columns is very rudimentary and fills the entire
above-the-fold area if the no. of results is very large.

Therefore, we generate the TOC from server side itself. And improve
the no. of columns heuristic further to accomodate up to 4 columns.

This improves page performance and utilizes real estate appropriately
according to the input.

Some screenshots at laptop (1366x768) resolution.
https://snag.gy/AXz2rP.jpg
https://snag.gy/th3Nn8.jpg

More can be found in the CL comments.

Fixes golang/go#21685
Updates golang/go#21686

Change-Id: Ia9b6dd1e67231d992709e4ba10ebdbedfe38b564
Reviewed-on: https://go-review.googlesource.com/c/129135
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-10-19 20:12:13 +00:00
..
analysis godoc/static/analysis: update user documentation 2015-06-26 20:38:07 +00:00
images
callgraph.html
codewalk.html
codewalkdir.html
dirlist.html
doc.go
error.html
example.html godoc: add GoogleCN property to pages 2017-08-02 21:09:52 +00:00
gen.go godoc, cmd/godoc: remove CLI support 2018-10-11 02:31:40 +00:00
gen_test.go godoc/static: use a stable quote function 2018-06-18 16:36:09 +00:00
godoc.html godoc: inject treeview content only when needed 2018-10-11 02:39:00 +00:00
godocs.js godoc: generate TOC from server-side for search page 2018-10-19 20:12:13 +00:00
implements.html
jquery.js
jquery.treeview.css
jquery.treeview.edit.js
jquery.treeview.js
makestatic.go godoc/static: add test for static.go file generation 2018-05-03 19:34:25 +00:00
methodset.html
opensearch.xml
package.html godoc: inject treeview content only when needed 2018-10-11 02:39:00 +00:00
packageroot.html godoc/vfs: improve implementation of RootType 2018-04-11 20:41:25 +00:00
play.js godoc/static: use window scope for checking notesEnabled 2016-07-17 07:19:41 +00:00
playground.js playground.js: make output of "Run" clearer 2018-10-16 19:24:31 +00:00
search.html godoc: generate TOC from server-side for search page 2018-10-19 20:12:13 +00:00
searchcode.html
searchdoc.html
searchtxt.html
static.go godoc: generate TOC from server-side for search page 2018-10-19 20:12:13 +00:00
style.css godoc: generate TOC from server-side for search page 2018-10-19 20:12:13 +00:00