Function markdown

Synopsis

def markdown.markdown(text, args, kwargs)

Description

Convert a Markdown string to HTML and return HTML as a Unicode string.

This is a shortcut function for Markdown class to cover the most basic use case. It initializes an instance of Markdown, loads the necessary extensions and runs the parser on the given text.

Keyword arguments:

  • text: Markdown formatted text as Unicode or ASCII string.
  • Any arguments accepted by the Markdown class.

Returns: An HTML document as a string.

Examples

//
//

Source

From lines 478-496 in markdown/init.py

def markdown(text, *args, **kwargs):
    """Convert a Markdown string to HTML and return HTML as a Unicode string.

    This is a shortcut function for `Markdown` class to cover the most
    basic use case.  It initializes an instance of Markdown, loads the
    necessary extensions and runs the parser on the given text.

    Keyword arguments:

    * text: Markdown formatted text as Unicode or ASCII string.
    * Any arguments accepted by the Markdown class.

    Returns: An HTML document as a string.

    """
    md = Markdown(*args, **kwargs)
    return md.convert(text)




Discussions

There are 0 discussions relevant for this page, and 0 discussions in the whole project.




Add Discussion

Log in to comment