Documentation
¶
Overview ¶
Package fence is the one grammar for ":::" directive fence lines. The Goldmark container parsers (through blockutil), sarde check-syntax and the content_lint plugin all classify lines with it, so a fence means the same thing to the renderer and to the tools that check content before a build.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AsideTypes = []string{
"note", "tip", "info", "danger", "warning", "important", "caution",
"gh-note", "gh-tip", "gh-important", "gh-warning", "gh-caution",
}
AsideTypes lists the aside names the aside extension opens. The aside parser's ValidTypes set is built from it, and ":::/aside" closes any of them.
Functions ¶
func Closes ¶
Closes reports whether ":::/closer" closes a block opened as ":::opener". Names compare case-insensitively.
func FindClosable ¶
FindClosable returns the index of the innermost (last) name in names that closer closes, or -1.
Types ¶
type CodeFence ¶
type CodeFence struct {
// contains filtered or unexported fields
}
CodeFence tracks fenced code blocks line by line. An opener is a run of three or more backticks or tildes; the closer is a run of the same character at least as long, alone on its line.
type Fence ¶
type Fence struct {
Kind Kind
Name string // lowercased; empty for a bare closer or a nameless Malformed
Colons int
}
Fence describes one classified line.
type Kind ¶
type Kind int
Kind classifies a trimmed line.
const ( // None is a line that is not a fence. None Kind = iota // Open is ":::name ..." with three or more colons. Open // Close is a bare ":::" or a named ":::/name" with nothing else on the line. Close // Malformed is ":::/" followed by something the parsers reject, such as // ":::/ note" or ":::/note extra". Parsers treat it as content; the // checker reports it. Malformed )