Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AdmonitionAttributeFilter = html.GlobalAttributeFilter
HeadingAttributeFilter defines attribute names which heading elements can have
var KindAdmonition = ast.NewNodeKind("Admonition")
KindAdmonition is a NodeKind of the Admonition node.
Functions ¶
func NewAdmonitionParser ¶
func NewAdmonitionParser() parser.BlockParser
NewAdmonitionParser returns a new BlockParser that parses admonition blocks.
Types ¶
type Admonition ¶
A Admonition struct represents a fenced code block of Markdown text.
func (*Admonition) Dump ¶
func (n *Admonition) Dump(source []byte, level int)
Dump implements Node.Dump .
type BlockQuoteClassifier ¶
type BlockQuoteClassifier struct {
// contains filtered or unexported fields
}
func GHAlertsBlockQuoteClassifier ¶
func GHAlertsBlockQuoteClassifier() BlockQuoteClassifier
func LegacyBlockQuoteClassifier ¶
func LegacyBlockQuoteClassifier() BlockQuoteClassifier
func (BlockQuoteClassifier) ClassifyingBlockQuote ¶
func (classifier BlockQuoteClassifier) ClassifyingBlockQuote(literal string) BlockQuoteType
ClassifyingBlockQuote compares a string against a set of patterns and returns a BlockQuoteType
type BlockQuoteLevelMap ¶
func GenerateBlockQuoteLevel ¶ added in v0.0.4
func GenerateBlockQuoteLevel(someNode ast.Node) BlockQuoteLevelMap
GenerateBlockQuoteLevel walks a given node and returns a map of blockquote levels
type BlockQuoteType ¶
type BlockQuoteType int
Define BlockQuoteType enum
const ( Info BlockQuoteType = iota Note Warn Tip None )
func ParseBlockQuoteType ¶ added in v0.0.4
func ParseBlockQuoteType(node ast.Node, source []byte) BlockQuoteType
ParseBlockQuoteType parses the first line of a blockquote and returns its type
func (BlockQuoteType) String ¶
func (t BlockQuoteType) String() string
type Extender ¶
type Extender struct {
// contains filtered or unexported fields
}
This extender allows you to use admonitions in markdown
Admonitions are a markdown extension that allows you to style markdown as nice boxes with a title. This is done by way of wrapping other elements in divs with classes starting with "adm-"
!!!note This is the title {.some-additional-class} This is the admonition
## with a header
!!!danger Nesting is possible! ```R X <- as.data.table(iris) X[Species != "virginica", mean(Sepal.Length), Species] ``` !!! !!!
type Renderer ¶
type Renderer struct {
Config
LevelMap BlockQuoteLevelMap
}
A Renderer struct is an implementation of renderer.NodeRenderer that renders nodes as (X)HTML.
func (*Renderer) RegisterFuncs ¶
func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs implements NodeRenderer.RegisterFuncs .
