markdown/doc.go
Michael Teichgräber f721084df0 new API: p := NewParser(&opts), p.Markdown(r, f) replaces d := Parse(r, opts), d.WriteHtml(w)
The new api allows to create a parser instance that can be
reused between calls to Markdown. Also, an interface `Formatter'
replaces the tight coupling between former Doc type and HTML
generation.
2012-04-28 22:57:55 +02:00

25 lines
371 B
Go

/*
A translation of peg-markdown [1] into Go.
Usage example:
package main
import (
"github.com/knieriem/markdown"
"os"
"bufio"
)
func main() {
p := markdown.NewParser(&markdown.Options{Smart: true})
w := bufio.NewWriter(os.Stdout)
p.Markdown(os.Stdin, markdown.ToHTML(w))
w.Flush()
}
[1]: https://github.com/jgm/peg-markdown/
*/
package markdown