Source File
doc.go
Belonging Package
github.com/gomarkdown/markdown
/*Package markdown implements markdown parser and HTML renderer.It parses markdown into AST format which can be serialized to HTML(using html.Renderer) or possibly other formats (using alternate renderers).Convert markdown to HTMLThe simplest way to convert markdown document to HTMLmd := []byte("## markdown document")html := markdown.ToHTML(md, nil, nil)Customizing parsing and HTML renderingYou can customize parser and HTML renderer:import ("github.com/gomarkdown/markdown/parser""github.com/gomarkdown/markdown/renderer""github.com/gomarkdown/markdown")extensions := parser.CommonExtensions | parser.AutoHeadingIDsp := parser.NewWithExtensions(extensions)htmlFlags := html.CommonFlags | html.HrefTargetBlankopts := html.RendererOptions{Flags: htmlFlags}renderer := html.NewRenderer(opts)md := []byte("markdown text")html := markdown.ToHTML(md, p, renderer)For a cmd-line tool see https://github.com/gomarkdown/mdtohtml*/package markdown
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |