Documentation ¶
Overview ¶
A translation of peg-markdown 1 into Go.
Usage example:
package main import ( "github.com/knieriem/markdown" "os" "bufio" ) func main() { p := markdown.NewParser(&markdown.Extensions{Smart: true}) w := bufio.NewWriter(os.Stdout) p.Markdown(os.Stdin, markdown.ToHTML(w)) w.Flush() }
Index ¶
Constants ¶
View Source
const ( LIST = iota /* A generic list of values. For ordered and bullet lists, see below. */ RAW /* Raw markdown to be processed further */ SPACE LINEBREAK ELLIPSIS EMDASH ENDASH APOSTROPHE SINGLEQUOTED DOUBLEQUOTED STR LINK IMAGE CODE HTML EMPH STRONG STRIKE PLAIN PARA LISTITEM BULLETLIST ORDEREDLIST H1 /* Code assumes that H1..6 are in order. */ H2 H3 H4 H5 H6 BLOCKQUOTE VERBATIM HTMLBLOCK HRULE REFERENCE NOTE DEFINITIONLIST DEFTITLE DEFDATA )
Types of semantic values returned by parsers.
View Source
const (
TABSTOP = 4
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extensions ¶
type Extensions struct { Smart bool Notes bool FilterHTML bool FilterStyles bool Strike bool Dlists bool }
Markdown Extensions.
type Formatter ¶
type Formatter interface { FormatBlock(*element) Finish() }
A Formatter is called repeatedly, one Markdown block at a time, while the document is parsed. At the end of a document the Finish method is called, which may, for example, print footnotes. A Formatter can be reused.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.