1
0
mirror of https://github.com/golang/go synced 2024-10-01 03:38:32 -06:00
Commit Graph

19 Commits

Author SHA1 Message Date
Kevin Burke
b54fdb7e52 godoc: don't select line numbers in orange
Previously a selection of text that spanned multiple lines would
include the line number as part of the orange highlight. This is
misleading (the line numbers aren't copied when you highlight the
text with your mouse) and a little ugly.

I had to move the tab character inside the <span class="ln"> block,
otherwise the orange highlight goes right up to the number, which is
off-putting and means the orange highlights don't line up vertically.

Before: https://monosnap.com/file/F9L166Zxxnf3ev74Z3JoJT0xz0nYLn.png
After: https://monosnap.com/file/6jfeFBG6tzhy3ZErqYWn6BfZ4fyk1R.png

Fixes golang/go#18561

Change-Id: I312d30ce01071850f8724246c54ce2d7259619d2
Reviewed-on: https://go-review.googlesource.com/34924
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-09 17:48:59 +00:00
Chris Broadfoot
2d7295cc9f godoc: allow nested toggles and toggles with <a name>
Toggles can now be nested within one another. They can also be
referenced using an <a> element with the name attribute, rather than
an element with the "id" attribute.

Updates golang/go#17574.

Change-Id: I43c17499a6879e983a79a74e14c99128296288e1
Reviewed-on: https://go-review.googlesource.com/34825
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-06 03:58:25 +00:00
Chris Broadfoot
4e83100c59 static: add underlines back to links in blog body
Specifically restricted to the "article" class, which is only used on
the blog.

Fixes golang/go#18302.

Change-Id: I5988c3df70f0de93d77544edf091640b0c5df30c
Reviewed-on: https://go-review.googlesource.com/34828
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-06 03:36:46 +00:00
Kevin Burke
0a14ca4e16 godoc: don't select line numbers when highlighting source code
CSS3 introduces the user-select property, which you can use to prevent snippets
of text from being highlighted. This is also the technique used by Github to
avoid highlighting line numbers when highlighting source code.

For more information, see:

https://developer.mozilla.org/en-US/docs/Web/CSS/user-select
https://www.w3.org/TR/1999/WD-css3-userint-19990916#user-select

Fixes golang/go#18279

Change-Id: Ia5eb68d5a042d6ee2a1c8e7bbad753a35de5c487
Reviewed-on: https://go-review.googlesource.com/34278
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-12-12 20:17:32 +00:00
Chris Broadfoot
c97d1a2623 godoc: add on-hover permalink anchors across the site
We already have anchors for godoc types and functions. Add them for
every heading (and "dl") on every other page on the site.

Change-Id: Ibad77f04442e48dd5a41de759010625f89b48604
Reviewed-on: https://go-review.googlesource.com/33641
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-29 00:47:29 +00:00
nwidger
2c200eec40 cmd/godoc: Add anchor links to functions, types and methods
Added anchor link beside each function, type and method definition in
godoc's generated HTML.  Anchor links are only shown when the mouse is
hovering over the definition.  The link body is the Unicode PILCROW SIGN
character (&#xb6; HTML entity).

Fixes: golang/go#13748

Change-Id: I645269f6c229f76b2882899e1a7483577877ac30
Reviewed-on: https://go-review.googlesource.com/20246
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-05 16:36:38 +00:00
Andrew Gerrand
95cc01bac9 godoc/static: fix dd styles
This makes /doc/install/source render correctly.

Fixes golang/go#14104

Change-Id: I58a883abd875197064a5e120a47e5ea8faad7df9
Reviewed-on: https://go-review.googlesource.com/18955
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-01-27 04:50:12 +00:00
Timothy Studd
4ad533583d x/tools/godoc: fixed width limit for non-paragraph text
Change-Id: I6020e03959a434622e3e999e0054849f0bfb522f
Fixes: golang/go#13602
Reviewed-on: https://go-review.googlesource.com/18361
Reviewed-by: Francesc Campoy Flores <campoy@golang.org>
2016-01-09 02:08:43 +00:00
Andrew Gerrand
a29e96e3bf godoc/static: redirect to download from installation instructions page
Change-Id: If29d04ced7404d6ba8761f734b4a16fe96959635
Reviewed-on: https://go-review.googlesource.com/13200
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-08-05 05:57:28 +00:00
Andrew Gerrand
bbc4202318 godoc/static: shorten vertical space above headings
Without this change, a h3 below a h2 looks weird.

Change-Id: I96cd1545615547b03460cf6896acd0df1abfc1a1
Reviewed-on: https://go-review.googlesource.com/13052
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-08-03 23:58:58 +00:00
Matthew Holt
9febd36660 tools/godoc: Fix indentation in doc contents
Mobile-friendly design overlooked indentation in table of contents
for article table of contents; this change restores indentation.

Change-Id: I9a3013497e1659ebfb657a8fb9374b8ad9b04b16
Reviewed-on: https://go-review.googlesource.com/11582
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-06-28 23:35:27 +00:00
Matthew Holt
f671283c22 tools/godoc: Mobile-friendly site design
This change makes golang.org responsive, including a top
bar menu and appropriate font sizing. The result is a
website that looks pleasing and is functional both on
mobile and on desktop. Also added a few print styles so
the site looks great on paper or PDF.

Change-Id: I16ee25ef4afde2002f240aec0804414bfb172a24
Reviewed-on: https://go-review.googlesource.com/9062
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-06-24 07:57:00 +00:00
Shenghou Ma
cd3ef3b6f0 godoc/static: set explicit page background color
Fixes golang/go#10961.

Change-Id: I3fc947bb18535853b278bad5fa449cf259eba59c
Reviewed-on: https://go-review.googlesource.com/10451
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-05-28 01:09:23 +00:00
Andrew Gerrand
277e5a16d7 go.tools/godoc: mention sub-repos and package indexes on packages page
Also several cosmetic tweaks to the package page.

LGTM=r, bradfitz
R=bradfitz, r
CC=golang-codereviews
https://golang.org/cl/128490043
2014-08-21 09:53:57 +10:00
Alan Donovan
80c4f06c0f go.tools/godoc: server mode: add support for type and pointer analysis.
See analysis.go for overview of new features.
See README for known bugs and issues.

Much UI polish, testing and optimization work remains, but
this is a starting point.

Flag: we add a new flag -analysis=type,pointer, default "",
for adventurous users only at this stage.
Type analysis takes ~10s for stdlib + go.tools;
Pointer analysis (currently) takes several minutes.

Dependencies: we now include jquery.treeview.js and its GIF
images among the resources.  (bake.go now handles binary.)

LGTM=crawshaw, bgarcia
R=crawshaw, bgarcia
CC=bradfitz, golang-codereviews
https://golang.org/cl/60540044
2014-03-14 18:58:22 -04:00
Andrew Gerrand
88be67fd25 go.tools/present: add -edit and -numbers flags to .code/.play
Also update style.css to hide outline of editable text areas and apply
correct styles to line numbers in non-playground snippets.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13946043
2013-09-27 09:46:08 +10:00
Andrew Gerrand
371fdaacb9 go.tools/godoc: add 'Blog' heading and playground scripts and styles
This is part of altering the blog to be styled like the rest of golang.org.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13641045
2013-09-18 15:12:51 +10:00
Andrew Gerrand
b9b578154e go.tools/godoc: some content re-organization
Remove References section heading.
Add redirects from old paths to new content.
Add a link to the SubRepositories wiki page from package list.
Add styles for "pop-out" link.

R=r
CC=golang-dev
https://golang.org/cl/13356047
2013-09-16 15:46:38 +10:00
Andrew Gerrand
373fd88c80 go.tools/cmd: move static files into new package 'static'
Fixes golang/go#6200.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12805046
2013-08-21 13:49:05 +10:00