Documentation ¶
Overview ¶
Package markdown implements a GitHub Flavored Markdown renderer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Plug your own Redis cacher in. Cache caches.Cacher )
Regexps for Markdown use cases.
Functions ¶
func Pygmentize ¶
Pygmentize searches for fenced code blocks in rendered Markdown HTML and runs Pygments to syntax highlight it.
On error the original given source is returned back.
The rendered result is cached in Redis if available, because the CLI call takes ~0.6s which is slow if you're rendering a lot of code blocks.
func RenderMarkdown ¶
RenderMarkdown renders markdown to HTML, safely. It uses blackfriday to render Markdown to HTML and then Bluemonday to sanitize the resulting HTML.
func RenderTrustedMarkdown ¶
RenderTrustedMarkdown renders markdown to HTML, but without applying bluemonday filtering afterward. This is for blog posts and website Markdown pages, not for user-submitted comments or things.
func TitleFromMarkdown ¶
TitleFromMarkdown tries to find a title from the source of a Markdown file.
On error, returns "Untitled" along with the error. So if you're lazy and want a suitable default, you can safely ignore the error.
Types ¶
This section is empty.