Documentation
¶
Overview ¶
Package wlmarkdown recognises the WikiLayer markdown dialect with goldmark.
New provides the parser extensions and Recognise returns structured dialect constructs. Strip extracts reader-visible text for search and previews.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KindCallout = ast.NewNodeKind("wlmarkdown.Callout")
KindCallout identifies a transformed callout node.
var KindMapEmbed = ast.NewNodeKind("wlmarkdown.MapEmbed")
KindMapEmbed identifies a transformed map embed node.
var KindUnreadable = ast.NewNodeKind("wlmarkdown.Unreadable")
KindUnreadable identifies a map whose coordinates lie outside the Earth.
Functions ¶
Types ¶
type Callout ¶
Callout is a blockquote transformed from a recognised callout marker. Class is the value assigned to that marker by the bundled rules.
type Declined ¶
type Declined struct {
Marker string
}
Declined records a dialect marker from a quote left unchanged. Marker keeps the spelling used by the dialect.
func DeclinedIn ¶
DeclinedIn returns marked quotes the dialect declined during a parse.
type Dialect ¶
type Dialect struct {
// contains filtered or unexported fields
}
Dialect holds the rules and goldmark extensions of the WikiLayer dialect.
func (Dialect) Classes ¶
Classes returns every callout class the dialect can report, in sorted order.
func (Dialect) Extensions ¶
Extensions returns the GFM and WikiLayer goldmark extensions in parse order.
func (Dialect) Markers ¶
Markers returns every marker that can open a dialect construct, in sorted order.
type Found ¶
type Found struct {
Kind string `yaml:"kind"`
Class string `yaml:"class,omitempty"`
Lat string `yaml:"lat,omitempty"`
Lng string `yaml:"lng,omitempty"`
Caption string `yaml:"caption,omitempty"`
Scheme string `yaml:"scheme,omitempty"`
Destination string `yaml:"destination,omitempty"`
Text string `yaml:"text,omitempty"`
}
Found is one dialect construct found in a document. Kind selects the meaningful fields: Class and Text for callout, Lat, Lng, and Caption for map, Text for unreadable, or Scheme, Destination, and Text for link.
type MapEmbed ¶
MapEmbed is a blockquote transformed from a valid map marker and point. Lat and Lng preserve the coordinate spelling, and Caption preserves its markdown.
type Unreadable ¶
Unreadable preserves the contents of a map that cannot be placed.
func (*Unreadable) Dump ¶
func (n *Unreadable) Dump(source []byte, level int)
Dump writes the node in goldmark's diagnostic tree format.