def extendMarkdown(self, md): """Insert AbbrPreprocessor before ReferencePreprocessor.""" add_to_registry( md.preprocessors, "dw-attachments", AttachmentPreprocessor(md), ">html_block", )
def extendMarkdown(self, md): self.md = md # append to end of inline patterns WIKILINK_RE = r"\[\[([\w0-9_ -]+)\]\]" wikilinkPattern = WikiLinks(WIKILINK_RE, self.getConfigs()) wikilinkPattern.md = md add_to_registry(md.inlinePatterns, "wikilink", wikilinkPattern, "<not_strong")
def extendMarkdown(self, md): """Add HilitePostprocessor to Markdown instance.""" hiliter = HiliteTreeprocessor(md) hiliter.config = self.getConfigs() if "hilite" in md.treeprocessors: logger.warning( "Replacing existing 'hilite' extension - please remove " "'codehilite' from WIKI_MARKDOWN_KWARGS") del md.treeprocessors["hilite"] add_to_registry(md.treeprocessors, "hilite", hiliter, "<inline") if "fenced_code_block" in md.preprocessors: logger.warning( "Replacing existing 'fenced_code_block' extension - please remove " "'fenced_code_block' or 'extras' from WIKI_MARKDOWN_KWARGS") del md.preprocessors["fenced_code_block"] hiliter = WikiFencedBlockPreprocessor(md) hiliter.config = self.getConfigs() add_to_registry(md.preprocessors, "fenced_code_block", hiliter, ">normalize_whitespace") md.registerExtension(self)
def extendMarkdown(self, md): add_to_registry(md.treeprocessors, "previewlinks", PreviewLinksTree(md), "_end")
def extendMarkdown(self, md): add_to_registry(md.inlinePatterns, "dw-macros", MacroPattern(MACRO_RE, md), ">link")
def extendMarkdown(self, md): add_to_registry(md.treeprocessors, "responsivetable", ResponsiveTableTree(md), "_end")
def extendMarkdown(self, md): md.registerExtension(self) self.md = md ext = self.TreeProcessorClass(md, self.getConfigs()) add_to_registry(md.treeprocessors, "redlinks", ext, ">inline")
def extendMarkdown(self, md): ext = EditSectionProcessor(md) ext.config = self.config add_to_registry(md.treeprocessors, "editsection", ext, "_end")
def extendMarkdown(self, md): add_to_registry(md.inlinePatterns, "dw-images", ImagePattern(IMAGE_RE, md), ">link") add_to_registry(md.postprocessors, "dw-images-cleanup", ImagePostprocessor(md), ">raw_html")