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)
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')
def reset(self): """ Clear literature references on reset, and prepare for distinct document. """ self.literatures = OrderedDict() self.unique_prefix += 1
def reset(self): """ Clear footnotes on reset, and prepare for distinct document. """ self.footnotes = OrderedDict() self.unique_prefix += 1