Esempio n. 1
0
def md2node(text):
    md = Markdown()
    md.serializer = Serializer(md)
    md.stripTopLevelTags = False
    md.postprocessors = OrderedDict()
    md.postprocessors['section'] = SectionPostprocessor()
    md.postprocessors['strip'] = StripPostprocessor()
    return md.convert(text)
Esempio n. 2
0
    def extendMarkdown(self, md, md_globals):
        """Create a dict of inline replace patterns and add to the tree processor."""

        configs = self.getConfigs()
        self.patterns = OrderedDict()

        for k, v in REPL.items():
            if configs[k]:
                self.add_pattern(v, md)

        inline_processor = InlineProcessor(md)
        inline_processor.inlinePatterns = self.patterns
        md.treeprocessors.add('smart-symbols', inline_processor, '_end')
        if "smarty" in md.treeprocessors.keys():
            md.treeprocessors.link('smarty', '_end')
Esempio n. 3
0
 def reset(self):
     """ Clear literature references on reset, and prepare for distinct document. """
     self.literatures = OrderedDict()
     self.unique_prefix += 1
Esempio n. 4
0
 def reset(self):
     """ Clear footnotes on reset, and prepare for distinct document. """
     self.footnotes = OrderedDict()
     self.unique_prefix += 1