mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 08:23:48 +03:00
for cross-referencing code/rfc, also linkify the errata
This commit is contained in:
parent
6a39f2cc54
commit
a87ac99038
2 changed files with 3 additions and 10 deletions
|
@ -149,16 +149,12 @@ func main() {
|
|||
lines = lines[:len(lines)-1]
|
||||
}
|
||||
for i, line := range lines {
|
||||
if !iserrata && len(line) > 80 {
|
||||
if !(iserrata && i > 0) && len(line) > 80 {
|
||||
line = strings.TrimRight(line[:80], " ")
|
||||
}
|
||||
refs := lineRefs[i+1]
|
||||
if len(refs) > 0 {
|
||||
if iserrata {
|
||||
line = ""
|
||||
} else {
|
||||
line = fmt.Sprintf("%-80s", line)
|
||||
}
|
||||
|
||||
// Lookup source files for rfc:line, so we can cross-link the rfcs.
|
||||
done := map[string]bool{}
|
||||
|
@ -181,9 +177,6 @@ func main() {
|
|||
}
|
||||
line += fmt.Sprintf(" %s%s:%d", comment, r.dstpath, r.dstlineno)
|
||||
}
|
||||
if iserrata {
|
||||
line = line[1:]
|
||||
}
|
||||
}
|
||||
line += "\n"
|
||||
b.WriteString(line)
|
||||
|
|
|
@ -217,7 +217,7 @@ body { font-family: 'ubuntu mono', monospace; }
|
|||
for i, line := range strings.Split(string(buf), "\n") {
|
||||
if line == "" {
|
||||
line = "\n"
|
||||
} else if len(line) < 80 || strings.Contains(rfc.File, "-") {
|
||||
} else if len(line) < 80 || strings.Contains(rfc.File, "-") && i > 0 {
|
||||
line = htmltemplate.HTMLEscapeString(line)
|
||||
} else {
|
||||
t := strings.Split(line[80:], " ")
|
||||
|
|
Loading…
Reference in a new issue