Module Expr Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Str BinOpBitOr BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Num FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str If UnaryOpNot NameLoad body Assign NameStore Call NameLoad orelse TryExcept body Assign NameStore Call NameLoad NameLoad keyword NameLoad handlers ExceptHandler type NameLoad body Assign NameStore Call NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If NameLoad body Assign NameStore BinOpMod NameLoad TupleLoad BinOpMod NameLoad TupleLoad NameLoad orelse Assign NameStore BinOpMod NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr NameLoad While Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Break Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str NameLoad keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad keyword NameLoad Assign NameStore Call AttributeLoad Str attr SubscriptLoad NameLoad Slice Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Slice Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr Str decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Call NameLoad NameLoad Str decorator_list decorator_list
N/A N/A 
Fenced Code Extension for Markdown
===================================

    >>> import markdown
    >>> text = '''
    ... A paragraph before a fenced code block:
    ...
    ... ```
    ... Fenced code block
    ... ```
    ... '''
    >>> html = markdown.markdown(text, extensions=['fenced_code'])
    >>> print html
    <p>A paragraph before a fenced code block:</p>
    <pre><code>Fenced code block
    </code></pre>

Language tags:

    >>> text = '''
    ... ```python
    ... # Some python code
    ... ```'''
    >>> print markdown.markdown(text, extensions=['fenced_code'])
    <pre><code class="language-python"># Some python code
    </code></pre>

Optionally tildes instead of  backticks:

    >>> text = '''
    ... ~~~
    ... # Arbitrary code
    ... ``` # these backticks will not close the block
    ... ~~~
    >>> print markdown.markdown(text, extensions=['fenced_code'])
    <pre><code># Arbitrary code
    ``` # these backticks will not close the block
    </code></pre>


Adapted under the BSD License from the `fenced_code` and `codehilite`
extensions (Copyright 2007-2008 Waylan Limberg http://achinghead.com/).

 N/A re markdown Extension markdown.preprocessors Preprocessor pygments highlight pygments.lexers get_lexer_by_name TextLexer pygments.formatters HtmlFormatter N/A FENCED_BLOCK_RE N/A N/A re compile (?P<fence>^(?:~{3,}|`{3,}))[ ]*(?P<lang>[a-z0-9_+-]*)(?P<linenums>#)?[ ]*\n(?P<code>.*?)(?<=\n)(?P=fence)[ ]*$ N/A N/A N/A re MULTILINE N/A re DOTALL N/A re IGNORECASE N/A OPEN_CODE <pre><code%s>{%% raw %%} N/A LANG_TAG  class="language-%s" N/A CLOSE_CODE {% endraw %}</code></pre> N/A TAB_LENGTH 4 highlight_syntax N/A N/A src lang linenums N/A False N/A N/A Pass code to the [Pygments](http://pygments.pocoo.org/) highliter
    with optional line numbers. The output should then be styled with CSS
    to  your liking. No styles are applied by default - only styling hooks
    (i.e.: <span class="k">).
     N/A src N/A N/A src strip N/A N/A lang N/A N/A lexer N/A TextLexer N/A N/A N/A N/A lexer N/A get_lexer_by_name lang stripall True N/A N/A N/A ValueError N/A N/A lexer N/A TextLexer N/A formatter N/A HtmlFormatter linenos linenums tab_length TAB_LENGTH N/A html N/A highlight src lexer formatter N/A lang N/A N/A open_code N/A OPEN_CODE N/A N/A LANG_TAG N/A lang N/A N/A open_code N/A OPEN_CODE N/A html N/A N/A html replace <div class="highlight"><pre> open_code 1 N/A html N/A N/A html replace </pre></div> CLOSE_CODE N/A html N/A FencedBlockPreprocessor N/A Preprocessor N/A run N/A N/A self lines N/A N/A N/A  Match and store Fenced Code Blocks in the HtmlStash.
         N/A text N/A N/A join lines N/A 1 N/A N/A m N/A N/A FENCED_BLOCK_RE search text N/A N/A m N/A N/A N/A lang N/A N/A m group lang N/A linenums N/A bool N/A N/A m group linenums N/A html N/A highlight_syntax N/A N/A m group code lang linenums linenums N/A placeholder N/A N/A N/A N/A self markdown htmlStash store html safe True N/A text N/A N/A {}
{}
{} format N/A text N/A N/A N/A m start placeholder N/A text N/A N/A N/A m end N/A N/A N/A text split N/A N/A FencedCodeExtension N/A Extension N/A extendMarkdown N/A N/A self md md_globals N/A N/A N/A N/A N/A md registerExtension self N/A N/A N/A N/A md preprocessors add fenced_code_block N/A FencedBlockPreprocessor md >normalize_whitespace N/A N/A