webhelpers.markdown – Markdown

webhelpers.markdown

webhelpers.markdown.markdown(text, extensions=[], safe_mode=False)
webhelpers.markdown.markdownFromFile(input=None, output=None, extensions=[], encoding=None, message_threshold=50, safe=False)
class webhelpers.markdown.Markdown(source=None, extensions=[], extension_configs=None, safe_mode=False)

Markdown formatter class for creating an html document from Markdown text

convert(source=None)

Return the document in XHTML format.

@returns: A serialized XHTML body.

registerExtension(extension)

This gets called by the extension

reset()

Resets all state variables so that we can start with a new text.

class webhelpers.markdown.Document
class webhelpers.markdown.Element(tag)
find(test, depth=0)

Returns a list of descendants that pass the test function

class webhelpers.markdown.TextNode(text)
class webhelpers.markdown.EntityReference(entity)
class webhelpers.markdown.HeaderPreprocessor

Replaces underlined headers with hashed headers to avoid the need for lookahead later.

class webhelpers.markdown.LinePreprocessor

Deals with HR lines (needs to be done before processing lists)

class webhelpers.markdown.HtmlBlockPreprocessor

Removes html blocks from the source text and stores it.

class webhelpers.markdown.ReferencePreprocessor

Removes reference definitions from the text and stores them for later use.

class webhelpers.markdown.Pattern(pattern)
class webhelpers.markdown.SimpleTextPattern(pattern)
class webhelpers.markdown.SimpleTagPattern(pattern, tag)
class webhelpers.markdown.BacktickPattern(pattern)
class webhelpers.markdown.DoubleTagPattern(pattern, tag)
class webhelpers.markdown.HtmlPattern(pattern)
class webhelpers.markdown.LinkPattern(pattern)
class webhelpers.markdown.ImagePattern(pattern)
class webhelpers.markdown.ReferencePattern(pattern)
class webhelpers.markdown.ImageReferencePattern(pattern)
class webhelpers.markdown.AutolinkPattern(pattern)
class webhelpers.markdown.AutomailPattern(pattern)
class webhelpers.markdown.Postprocessor

Postprocessors are run before the dom it converted back into text.

Each Postprocessor implements a “run” method that takes a pointer to a NanoDom document, modifies it as necessary and returns a NanoDom document.

Postprocessors must extend markdown.Postprocessor.

There are currently no standard post-processors, but the footnote extension uses one.

class webhelpers.markdown.HtmlStash

This class is used for stashing HTML objects that we extract in the beginning and replace with place-holders.

store(html, safe=False)

Saves an HTML segment for later reinsertion. Returns a placeholder string that needs to be inserted into the document.

@param html: an html segment @param safe: label an html segment as safe for safemode @param inline: label a segmant as inline html @returns : a placeholder string

class webhelpers.markdown.BlockGuru
detabbed_fn(line)

An auxiliary method to be passed to _findHead

webhelpers.markdown.print_error(string)

Print an error string to stderr

webhelpers.markdown.dequote(string)

Removes quotes from around a string

class webhelpers.markdown.CorePatterns

This class is scheduled for removal as part of a refactoring effort.

class webhelpers.markdown.Extension(configs={})
webhelpers.markdown.parse_options()
Read the Docs v: v1.0.1rc1
Versions
latest
v1.0.1rc1
v0.9.7
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.