func Render(doc ast.Node, renderer Renderer) []byte {
	var buf bytes.Buffer
	renderer.RenderHeader(&buf, doc)
	ast.WalkFunc(doc, func(node ast.Node, entering bool) ast.WalkStatus {
		return renderer.RenderNode(&buf, node, entering)
	})
	renderer.RenderFooter(&buf, doc)
	return buf.Bytes()
}
Render uses renderer to convert parsed markdown document into a different format.

To convert to HTML, pass html.Renderer
package markdown
import (
	"bytes"
	"io"
	"github.com/gomarkdown/markdown/ast"
	"github.com/gomarkdown/markdown/html"
	"github.com/gomarkdown/markdown/parser"
)
type Renderer interface {
	RenderNode(w io.Writer, node ast.Node, entering bool) ast.WalkStatus
	RenderHeader(w io.Writer, ast ast.Node)
	RenderFooter(w io.Writer, ast ast.Node)
}
func Parse(markdown []byte, p *parser.Parser) ast.Node {
	if p == nil {
		p = parser.New()
	}
	return p.Parse(markdown)
}