diff --git a/doc.go b/doc.go index 1651e8f..b34dc29 100644 --- a/doc.go +++ b/doc.go @@ -50,15 +50,17 @@ func main() { log.Fatalf("Create: cannot create index.html, err: %v", err) } - // find TOC + // Find TOC, and remove all hard coded all back to top. Then use + // back to top button for navigation. + // + // This is urgly, I know. At least this works so far with least efforts. + // A better and generic way obviously is to do DOM tree analysis. dom := b.String() tocStart := strings.Index(dom, "

Table of Contents

") tocEnd := strings.Index(dom, `

Disclaimer

`) toc := dom[tocStart:tocEnd] dom = dom[:tocStart] + `
` + dom[tocStart:tocEnd] + `
` + dom[tocEnd:] - - // remove all hard coded all back to top, use back to top button dom = strings.ReplaceAll(dom, `

Back To Top

`, "") type data struct {