Wiki Links support
This commit is contained in:
@@ -15,11 +15,18 @@ import (
|
||||
"github.com/yuin/goldmark/renderer/html"
|
||||
)
|
||||
|
||||
var md = goldmark.New(
|
||||
goldmark.WithExtensions(extension.GFM, extension.Table),
|
||||
goldmark.WithParserOptions(parser.WithAutoHeadingID()),
|
||||
goldmark.WithRendererOptions(html.WithUnsafe()),
|
||||
)
|
||||
var md goldmark.Markdown
|
||||
|
||||
// initMarkdown builds the package-level goldmark instance. Called once from
|
||||
// main after the wiki root is known so the wiki-link extension can resolve
|
||||
// targets against the filesystem.
|
||||
func initMarkdown(root string) {
|
||||
md = goldmark.New(
|
||||
goldmark.WithExtensions(extension.GFM, extension.Table, newWikiLinkExt(root)),
|
||||
goldmark.WithParserOptions(parser.WithAutoHeadingID()),
|
||||
goldmark.WithRendererOptions(html.WithUnsafe()),
|
||||
)
|
||||
}
|
||||
|
||||
type crumb struct{ Name, URL string }
|
||||
type entry struct {
|
||||
@@ -32,6 +39,7 @@ type pageData struct {
|
||||
Crumbs []crumb
|
||||
CanEdit bool
|
||||
EditMode bool
|
||||
IsRoot bool
|
||||
SectionIndex int // -1 = whole page; >=0 = section being edited
|
||||
PostURL string
|
||||
RawContent string
|
||||
|
||||
Reference in New Issue
Block a user