f721084df0
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.
25 lines
371 B
Go
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
|