2018-01-26 08:43:10 +00:00
|
|
|
// Package markdown implements markdown parser and HTML renderer.
|
2016-09-05 07:25:10 +00:00
|
|
|
//
|
2018-01-26 08:43:10 +00:00
|
|
|
// It parses markdown into AST format which can be serialized to HTML
|
|
|
|
// (using HTMLRenderer) or possibly other formats (using alternate renderers).
|
2016-09-05 07:25:10 +00:00
|
|
|
//
|
|
|
|
//
|
2018-01-26 22:46:02 +00:00
|
|
|
// Convert markdown to HTML
|
2016-09-05 07:25:10 +00:00
|
|
|
//
|
2018-01-26 22:46:02 +00:00
|
|
|
// md := []byte("## markdown document")
|
|
|
|
// html := ToHTML(md, nil, nil)
|
2018-01-26 08:43:10 +00:00
|
|
|
//
|
2018-01-26 22:46:02 +00:00
|
|
|
// Customizing parsing and HTML rendering
|
|
|
|
//
|
2018-01-26 22:46:57 +00:00
|
|
|
// md := []byte("markdown document")
|
|
|
|
// extensions := CommonExtensions | AutoHeadingIDs
|
|
|
|
// parser := NewParserWithExensions(extensions)
|
|
|
|
// htmlParams := CommonHTMLFlags | HrefTargetBlank
|
|
|
|
// renderer := NewHTMLRenderer(htmlParams)
|
|
|
|
// html := ToHTML(md, parser, renderer)
|
2018-01-26 22:46:02 +00:00
|
|
|
//
|
|
|
|
// For a cmd-line tool see https://github.com/gomarkdown/markdown/tree/master/cmd/mdtohtml
|
2018-01-25 21:01:19 +00:00
|
|
|
package markdown
|