Automatically render wiki TOC (#19873)
Automatically add sidebar in the wiki view containing a TOC for the wiki page. Make the TOC collapsable Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
c1c07e533c
commit
ac88f21ecc
8 changed files with 146 additions and 50 deletions
|
@ -8,12 +8,13 @@ import (
|
|||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"code.gitea.io/gitea/modules/markup"
|
||||
"code.gitea.io/gitea/modules/translation/i18n"
|
||||
|
||||
"github.com/yuin/goldmark/ast"
|
||||
)
|
||||
|
||||
func createTOCNode(toc []Header, lang string) ast.Node {
|
||||
func createTOCNode(toc []markup.Header, lang string) ast.Node {
|
||||
details := NewDetails()
|
||||
summary := NewSummary()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue