markdown/doc.go

25 lines
892 B
Go
Raw Normal View History

2018-01-26 08:43:10 +00:00
// Package markdown implements markdown parser and HTML renderer.
//
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).
//
//
// Convert markdown to HTML
//
2018-01-26 23:14:20 +00:00
// The simplest way to convert markdown text to HTML
//
// 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
//
// 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)
//
// 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