Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
markdown
/
extensions
/
File Content:
footnotes.pyc
� �(�Sc @@ sP d Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z m Z d d l m Z d d l Z d Z d Z e j d � Z e j d � Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ g d � Z d S( u� ========================= FOOTNOTES ================================= This section adds footnote handling to markdown. It can be used as an example for extending python-markdown with relatively complex functionality. While in this case the extension is included inside the module itself, it could just as easily be added from outside the module. Not that all markdown classes above are ignorant about footnotes. All footnote functionality is provided separately and then added to the markdown instance at the run time. Footnote functionality is attached by calling extendMarkdown() method of FootnoteExtension. The method also registers the extension to allow it's state to be reset by a call to reset() method. Example: Footnotes[^1] have a label[^label] and a definition[^!DEF]. [^1]: This is a footnote [^label]: A footnote on "label" [^!DEF]: The footnote for definition i ( t absolute_import( t unicode_literalsi ( t Extensioni ( t Preprocessor( t Pattern( t Treeprocessor( t Postprocessor( t etreet text_type( t OrderedDictNu zz1337820767766393qqu qq3936677670287331zzu [ ]{0,3}\[\^([^\]]*)\]:\s*(.*)u ((\t)|( ))(.*)t FootnoteExtensionc B@ s_ e Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( u Footnote Extension. c C@ so i d d g d 6t d g d 6d d g d 6| _ x% | D] \ } } | | j | d <q7 Wd | _ | j � d S( u Setup configs. u ///Footnotes Go Here///u1 The text string that marks where the footnotes gou PLACE_MARKERu7 Avoid name collisions across multiple calls to reset().u UNIQUE_IDSu ↩uC The text string that links from the footnote to the reader's place.u BACKLINK_TEXTi N( t Falset configt unique_prefixt reset( t selft configst keyt value( ( sA /usr/lib/python2.7/site-packages/markdown/extensions/footnotes.pyt __init__- s c C@ s� | j | � | j | _ | | _ | j j d t | � d � d } | j j d t | | � d � | j j d t | � d � | j j d t | � d � d S( u Add pieces to Markdown. u footnoteu <referenceu \[\^([^\]]*)\]u _beginu >amp_substituteN( t registerExtensiont parsert mdt preprocessorst addt FootnotePreprocessort inlinePatternst FootnotePatternt treeprocessorst FootnoteTreeprocessort postprocessorst FootnotePostprocessor( R R t md_globalst FOOTNOTE_RE( ( sA /usr/lib/python2.7/site-packages/markdown/extensions/footnotes.pyt extendMarkdownC s c C@ s t � | _ | j d 7_ d S( uD Clear the footnotes on reset, and prepare for a distinct document. i N( R t footnotesR ( R ( ( sA /usr/lib/python2.7/site-packages/markdown/extensions/footnotes.pyR X s c @ s"