Documentation
¶
Overview ¶
Package poems is a extension for the goldmark (http://github.com/yuin/goldmark).
This extension adds parsing code blocks in markdown document as poems.
Example ¶
package main
import (
"log"
"os"
poems "github.com/mdigger/goldmark-poems"
"github.com/yuin/goldmark"
)
func main() {
var source = []byte("# Sample\n\n" +
"\tAlas for man! day after day may rise,\n" +
"\t Night may shade his thankless head,\n" +
"\tHe sees no God in the bright, morning skies\n" +
"\t He sings no praises from his guarded bed.")
md := goldmark.New(
goldmark.WithExtensions(poems.Extension))
err := md.Convert(source, os.Stdout)
if err != nil {
log.Fatal(err)
}
}
Output: <h1>Sample</h1> <div class="poem">Alas for man! day after day may rise,<br> Night may shade his thankless head,<br> He sees no God in the bright, morning skies<br> He sings no praises from his guarded bed.</div>
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Enable = goldmark.WithExtensions(Extension)
Enable is goldmark.Enable for poem code blocks extension.
View Source
var Extension goldmark.Extender = new(poemExtension)
Extension is a initialized goldmark extension for poems code block support.
View Source
var KindPoem = ast.NewNodeKind("Poem")
KindPoem is a NodeKind of the Poem node.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.