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 23:14:20 +00:00
|
|
|
// The simplest way to convert markdown text to HTML
|
|
|
|
//
|
2018-01-26 22:46:02 +00:00
|
|
|
// md := []byte("## markdown document")
|
2018-01-26 23:06:32 +00:00
|
|
|
// html := markdown.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")
|
2018-01-26 23:06:32 +00:00
|
|
|
// extensions := markdown.CommonExtensions | markdown.AutoHeadingIDs
|
|
|
|
// parser := markdown.NewParserWithExensions(extensions)
|
|
|
|
// htmlParams := markdown.CommonHTMLFlags | markdown.HrefTargetBlank
|
|
|
|
// renderer := markdown.NewHTMLRenderer(htmlParams)
|
|
|
|
// html := markdown.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
|