mirror of
https://github.com/golang/go
synced 2024-11-24 08:10:09 -07:00
godoc: show line numbers for non-go files (bug fix)
Also: Give line numbers a style and make them less intrusive. R=rsc CC=golang-dev https://golang.org/cl/4060043
This commit is contained in:
parent
3c7104479c
commit
955aa159ad
@ -157,6 +157,10 @@ h1#title {
|
||||
pre.ebnf, pre.grammar {
|
||||
background: #FFFFE0;
|
||||
}
|
||||
span.ln {
|
||||
font-size: 80%;
|
||||
color: #777777;
|
||||
}
|
||||
span.comment {
|
||||
color: #002090;
|
||||
}
|
||||
|
@ -360,12 +360,12 @@ func FormatText(text []byte, line int, goSource bool, pattern string, selection
|
||||
if pattern != "" {
|
||||
highlights = regexpSelection(text, pattern)
|
||||
}
|
||||
if comments != nil || highlights != nil || selection != nil {
|
||||
if line >= 0 || comments != nil || highlights != nil || selection != nil {
|
||||
var lineTag LinkWriter
|
||||
if line >= 0 {
|
||||
lineTag = func(w io.Writer, _ int, start bool) {
|
||||
if start {
|
||||
fmt.Fprintf(w, "<a id=\"L%d\"></a>%5d\t", line, line)
|
||||
fmt.Fprintf(w, "<a id=\"L%d\"></a><span class=\"ln\">%6d</span>\t", line, line)
|
||||
line++
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user