Documentation ¶
Overview ¶
Package markdown parses and HTML-renders Markdown documents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBfRenderer ¶
func NewBfRenderer() blackfriday.Renderer
NewBfRenderer creates the default blackfriday renderer to be passed to NewParser()
Types ¶
type Document ¶
type Document struct { // Meta is the document's metadata in the Markdown "front matter", if any. Meta Metadata // Title is taken from the metadata (if it exists) or else from the text content of the first // heading. Title string // HTML is the rendered Markdown content. HTML []byte // Tree is the tree of sections (used to show a table of contents). Tree []*SectionNode }
Document is a parsed and HTML-rendered Markdown document.
type FuncInfo ¶
type FuncInfo struct {
Version string // the version of the content containing the page to render
}
FuncInfo contains information passed to Markdown functions about the current execution context.
type FuncMap ¶
FuncMap contains named functions that can be invoked within Markdown documents (see (Options).Funcs).
type Metadata ¶
type Metadata struct { Title string `yaml:"title"` IgnoreDisconnectedPageCheck bool `yaml:"ignoreDisconnectedPageCheck"` }
Metadata is document metadata in the "front matter" of a Markdown document.
type Options ¶
type Options struct { // Base is the base URL (typically including only the path, such as "/" or "/help/") to use when // resolving relative links. Base *url.URL // ContentFilePathToLinkPath converts references to file paths of other content files to the URL // path to use in links. For example, ContentFilePathToLinkPath("a/index.md") == "a". ContentFilePathToLinkPath func(string) string // Funcs are custom functions that can be invoked within Markdown documents with // <markdownfuncjfunction-name arg="val" />. Funcs FuncMap // FuncInfo contains information passed to Markdown functions about the current execution // context. FuncInfo FuncInfo }
Options customize how Run parses and HTML-renders the Markdown document.
type SectionNode ¶
type SectionNode struct { Title string // section title URL string // section URL (usually an anchor link) Level int // heading level (1–6) Children []*SectionNode // subsections }
SectionNode is a section and its children.
Click to show internal directories.
Click to hide internal directories.