# README
goldmark-lineblocks
This goldmark parser extension adds support for inline blocks in markdown.
var md = goldmark.New(
lineblocks.Enable,
)
err := md.Convert(source, os.Stdout)
if err != nil {
log.Fatal(err)
}
A line block is a sequence of lines beginning with a vertical bar (|
) followed by a space. The division into lines will be preserved in the output, as will any leading spaces; otherwise, the lines will be formatted as Markdown. This is useful for verse and addresses:
| The limerick packs laughs anatomical
| In space that is quite economical.
| But the good ones I've seen
| So seldom are clean
| And the clean ones so seldom are comical
| 200 Main St.
| Berkeley, CA 94718
The lines can be hard-wrapped if needed.
| The Right Honorable Most Venerable and
Righteous Samuel L. Constable, Jr.
| 200 Main St.
| Berkeley, CA 94718
This syntax is borrowed from reStructuredText and Pandoc.
# Functions
NewHTMLRenderer returns a new sectionHTMLRenderer.
NewLineBlock return new initialized LineBlock.
NewLineBlockItem return new initialized LineBlockItem.
# Variables
Enable is goldmark.Option for line blocks extension.
Extension is a initialized goldmark extension for line blocks support.
KindLineBlock is a NodeKind of the LineBlock node.
KindLineBlock is a NodeKind of the LineBlock node.
ParagraphTransformer is a ParagraphTransformer implementation that parses and transform line blocks from paragraphs.
# Structs
A LineBlock struct represents a list of inline text block.
A LineBlockItem struct represents a list of inline text block.