Documentation ¶
Overview ¶
Deprecated: Use "go.abhg.dev/goldmark/wikilink" instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Kind = wikilink.Kind
Kind is the kind of the wikilink AST node.
Functions ¶
This section is empty.
Types ¶
type Extender ¶
Extender extends a goldmark Markdown object with support for parsing and rendering Wikilinks.
type Node ¶
Node is a Wikilink AST node. Wikilinks have two components: the target and the label.
The target is the page to which this link points, and the label is the text that displays for this link.
For links in the following form, the label and the target are the same.
[[Foo bar]]
For links in the following form, the target is the portion of the link to the left of the "|", and the label is the portion to the right.
[[Foo bar|baz qux]]
type Parser ¶
Parser parses wikilinks.
Install it on your goldmark Markdown object with Extender, or install it directly on your goldmark Parser by using the WithInlineParsers option.
wikilinkParser := util.Prioritized(&wikilink.Parser{...}, 199) goldmarkParser.AddOptions(parser.WithInlineParsers(wikilinkParser))
Note that the priority for the wikilink parser must 199 or lower to take precednce over the plain Markdown link parser which has a priority of 200.
type Renderer ¶
Renderer renders wikilinks as HTML.
Install it on your goldmark Markdown object with Extender, or directly on a goldmark Renderer by using the WithNodeRenderers option.
wikilinkRenderer := util.Prioritized(&wikilink.Renderer{...}, 199) goldmarkRenderer.AddOptions(renderer.WithNodeRenderers(wikilinkRenderer))
type Resolver ¶
Resolver resolves pages referenced by wikilinks to their destinations.
var DefaultResolver Resolver = wikilink.DefaultResolver
DefaultResolver is a minimal wiklink resolver that resolves to HTML pages relative to the source page.
For example,
[[Foo]] // => "Foo.html" [[Foo bar]] // => "Foo bar.html" [[foo/Bar]] // => "foo/Bar.html"