1
0
mirror of https://github.com/golang/go synced 2024-11-18 12:44:49 -07:00
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 go.tools/godoc: server mode: add support for type and pointer analysis. 2014-03-14 18:58:22 -04:00
callgraph.html go.tools/godoc/static: indent with tabs. 2014-08-26 13:21:29 -07:00
codewalk.html go.tools/godoc/static: fix &amp; escape in codewalks 2013-10-13 22:22:48 -04:00
codewalkdir.html go.tools/cmd: move static files into new package 'static' 2013-08-21 13:49:05 +10:00
dirlist.html go.tools/cmd: move static files into new package 'static' 2013-08-21 13:49:05 +10:00
doc.go tools: add import comments. 2014-12-09 22:42:16 +00:00
error.html go.tools/cmd: move static files into new package 'static' 2013-08-21 13:49:05 +10:00
example.html godoc: add GoogleCN property to pages 2017-08-02 21:09:52 +00:00
gen_test.go godoc/static: use a stable quote function 2018-06-18 16:36:09 +00:00
gen.go godoc, cmd/godoc: remove CLI support 2018-10-11 02:31:40 +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 go.tools/godoc/static: indent with tabs. 2014-08-26 13:21:29 -07:00
jquery.js go.tools/cmd: move static files into new package 'static' 2013-08-21 13:49:05 +10:00
jquery.treeview.css go.tools/godoc: server mode: add support for type and pointer analysis. 2014-03-14 18:58:22 -04:00
jquery.treeview.edit.js go.tools/godoc: server mode: add support for type and pointer analysis. 2014-03-14 18:58:22 -04:00
jquery.treeview.js go.tools/godoc: server mode: add support for type and pointer analysis. 2014-03-14 18:58:22 -04:00
makestatic.go godoc/static: add test for static.go file generation 2018-05-03 19:34:25 +00:00
methodset.html go.tools/godoc/static: indent with tabs. 2014-08-26 13:21:29 -07:00
opensearch.xml go.tools/cmd: move static files into new package 'static' 2013-08-21 13:49:05 +10:00
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 godoc: Add package identifiers to documentation indexing. 2014-01-06 13:26:25 -05:00
searchdoc.html go.tools/godoc/static: indent with tabs. 2014-08-26 13:21:29 -07:00
searchtxt.html godoc: add ability to change or disable the display of search results. 2014-01-06 09:51:01 -05:00
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