summaryrefslogtreecommitdiff
path: root/markdown
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2015-03-27 20:13:39 -0400
committerWaylan Limberg <waylan.limberg@icloud.com>2015-04-22 19:53:48 -0400
commit207990ec8bdcc51226d7b09522955729c7e4663a (patch)
tree8b53f6db6c699a6f2cbf1d35f0b06eb7c92026ad /markdown
parentae9c85f4a807fbf5f02436c698baf517aa3f167e (diff)
downloadpython-markdown-207990ec8bdcc51226d7b09522955729c7e4663a.tar.gz
Removed now unnessecary 'makeExtension' functions from extensions.
And misc. cleanup from adopting entrypoints for extensions.
Diffstat (limited to 'markdown')
-rw-r--r--markdown/core.py5
-rw-r--r--markdown/extensions/abbr.py4
-rw-r--r--markdown/extensions/admonition.py4
-rw-r--r--markdown/extensions/attr_list.py4
-rw-r--r--markdown/extensions/codehilite.py4
-rw-r--r--markdown/extensions/def_list.py4
-rw-r--r--markdown/extensions/extra.py4
-rw-r--r--markdown/extensions/fenced_code.py4
-rw-r--r--markdown/extensions/footnotes.py5
-rw-r--r--markdown/extensions/headerid.py4
-rw-r--r--markdown/extensions/meta.py4
-rw-r--r--markdown/extensions/nl2br.py4
-rw-r--r--markdown/extensions/sane_lists.py4
-rw-r--r--markdown/extensions/smart_strong.py4
-rw-r--r--markdown/extensions/smarty.py4
-rw-r--r--markdown/extensions/tables.py4
-rw-r--r--markdown/extensions/toc.py4
-rw-r--r--markdown/extensions/wikilinks.py4
18 files changed, 2 insertions, 72 deletions
diff --git a/markdown/core.py b/markdown/core.py
index eeaff61..d937ec3 100644
--- a/markdown/core.py
+++ b/markdown/core.py
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
import codecs
import sys
import logging
-import importlib
import pkg_resources
from . import util
from .preprocessors import build_preprocessors
@@ -108,7 +107,7 @@ class Markdown(object):
Keyword arguments:
* extensions: A list of extensions, which can either
- be strings or objects.
+ be strings or objects.
* configs: A dictionary mapping extension names to config options.
"""
@@ -131,7 +130,7 @@ class Markdown(object):
def build_extension(self, name, configs):
"""
Build an extension from a string name, and return an instance.
-
+
The string name must be registered as an entry point in the
`markdown.extensions` group which points to a subclass of
the `markdown.extensions.Extension` class. If multiple
diff --git a/markdown/extensions/abbr.py b/markdown/extensions/abbr.py
index 83cef61..c3941a5 100644
--- a/markdown/extensions/abbr.py
+++ b/markdown/extensions/abbr.py
@@ -85,7 +85,3 @@ class AbbrPattern(Pattern):
abbr.text = AtomicString(m.group('abbr'))
abbr.set('title', self.title)
return abbr
-
-
-def makeExtension(**kwargs):
- return AbbrExtension(**kwargs)
diff --git a/markdown/extensions/admonition.py b/markdown/extensions/admonition.py
index 997cab3..ad3c59d 100644
--- a/markdown/extensions/admonition.py
+++ b/markdown/extensions/admonition.py
@@ -90,7 +90,3 @@ class AdmonitionProcessor(BlockProcessor):
# e.g.: `!!! warning ""` will *not* render `p` with a title
title = None
return klass, title
-
-
-def makeExtension(**kwargs):
- return AdmonitionExtension(**kwargs)
diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py
index 26cef4c..84e9da1 100644
--- a/markdown/extensions/attr_list.py
+++ b/markdown/extensions/attr_list.py
@@ -171,7 +171,3 @@ class AttrListExtension(Extension):
md.treeprocessors.add(
'attr_list', AttrListTreeprocessor(md), '>prettify'
)
-
-
-def makeExtension(**kwargs):
- return AttrListExtension(**kwargs)
diff --git a/markdown/extensions/codehilite.py b/markdown/extensions/codehilite.py
index 1c63e8e..857601f 100644
--- a/markdown/extensions/codehilite.py
+++ b/markdown/extensions/codehilite.py
@@ -258,7 +258,3 @@ class CodeHiliteExtension(Extension):
md.treeprocessors.add("hilite", hiliter, "<inline")
md.registerExtension(self)
-
-
-def makeExtension(**kwargs):
- return CodeHiliteExtension(**kwargs)
diff --git a/markdown/extensions/def_list.py b/markdown/extensions/def_list.py
index 45f8358..f5224c2 100644
--- a/markdown/extensions/def_list.py
+++ b/markdown/extensions/def_list.py
@@ -109,7 +109,3 @@ class DefListExtension(Extension):
md.parser.blockprocessors.add('deflist',
DefListProcessor(md.parser),
'>ulist')
-
-
-def makeExtension(**kwargs):
- return DefListExtension(**kwargs)
diff --git a/markdown/extensions/extra.py b/markdown/extensions/extra.py
index 4432158..9a9d717 100644
--- a/markdown/extensions/extra.py
+++ b/markdown/extensions/extra.py
@@ -66,10 +66,6 @@ class ExtraExtension(Extension):
r'^(p|h[1-6]|li|dd|dt|td|th|legend|address)$', re.IGNORECASE)
-def makeExtension(**kwargs):
- return ExtraExtension(**kwargs)
-
-
class MarkdownInHtmlProcessor(BlockProcessor):
"""Process Markdown Inside HTML Blocks."""
def test(self, parent, block):
diff --git a/markdown/extensions/fenced_code.py b/markdown/extensions/fenced_code.py
index d89a5ae..af278b5 100644
--- a/markdown/extensions/fenced_code.py
+++ b/markdown/extensions/fenced_code.py
@@ -106,7 +106,3 @@ class FencedBlockPreprocessor(Preprocessor):
txt = txt.replace('>', '&gt;')
txt = txt.replace('"', '&quot;')
return txt
-
-
-def makeExtension(**kwargs):
- return FencedCodeExtension(**kwargs)
diff --git a/markdown/extensions/footnotes.py b/markdown/extensions/footnotes.py
index 40a8fbb..24ef4c4 100644
--- a/markdown/extensions/footnotes.py
+++ b/markdown/extensions/footnotes.py
@@ -312,8 +312,3 @@ class FootnotePostprocessor(Postprocessor):
FN_BACKLINK_TEXT, self.footnotes.getConfig("BACKLINK_TEXT")
)
return text.replace(NBSP_PLACEHOLDER, "&#160;")
-
-
-def makeExtension(**kwargs):
- """ Return an instance of the FootnoteExtension """
- return FootnoteExtension(**kwargs)
diff --git a/markdown/extensions/headerid.py b/markdown/extensions/headerid.py
index 33fa63b..5466544 100644
--- a/markdown/extensions/headerid.py
+++ b/markdown/extensions/headerid.py
@@ -91,7 +91,3 @@ class HeaderIdExtension(Extension):
def reset(self):
self.processor.IDs = set()
-
-
-def makeExtension(**kwargs):
- return HeaderIdExtension(**kwargs)
diff --git a/markdown/extensions/meta.py b/markdown/extensions/meta.py
index 4b83161..f64babc 100644
--- a/markdown/extensions/meta.py
+++ b/markdown/extensions/meta.py
@@ -72,7 +72,3 @@ class MetaPreprocessor(Preprocessor):
break # no meta data - done
self.markdown.Meta = meta
return lines
-
-
-def makeExtension(**kwargs):
- return MetaExtension(**kwargs)
diff --git a/markdown/extensions/nl2br.py b/markdown/extensions/nl2br.py
index c293240..946ad90 100644
--- a/markdown/extensions/nl2br.py
+++ b/markdown/extensions/nl2br.py
@@ -29,7 +29,3 @@ class Nl2BrExtension(Extension):
def extendMarkdown(self, md, md_globals):
br_tag = SubstituteTagPattern(BR_RE, 'br')
md.inlinePatterns.add('nl', br_tag, '_end')
-
-
-def makeExtension(**kwargs):
- return Nl2BrExtension(**kwargs)
diff --git a/markdown/extensions/sane_lists.py b/markdown/extensions/sane_lists.py
index 20b5967..81cf8ad 100644
--- a/markdown/extensions/sane_lists.py
+++ b/markdown/extensions/sane_lists.py
@@ -41,7 +41,3 @@ class SaneListExtension(Extension):
""" Override existing Processors. """
md.parser.blockprocessors['olist'] = SaneOListProcessor(md.parser)
md.parser.blockprocessors['ulist'] = SaneUListProcessor(md.parser)
-
-
-def makeExtension(**kwargs):
- return SaneListExtension(**kwargs)
diff --git a/markdown/extensions/smart_strong.py b/markdown/extensions/smart_strong.py
index 62de375..bb387ce 100644
--- a/markdown/extensions/smart_strong.py
+++ b/markdown/extensions/smart_strong.py
@@ -35,7 +35,3 @@ class SmartEmphasisExtension(Extension):
SimpleTagPattern(SMART_STRONG_RE, 'strong'),
'>emphasis2'
)
-
-
-def makeExtension(**kwargs):
- return SmartEmphasisExtension(**kwargs)
diff --git a/markdown/extensions/smarty.py b/markdown/extensions/smarty.py
index e973b09..7e4634f 100644
--- a/markdown/extensions/smarty.py
+++ b/markdown/extensions/smarty.py
@@ -257,7 +257,3 @@ class SmartyExtension(Extension):
inlineProcessor.inlinePatterns = self.inlinePatterns
md.treeprocessors.add('smarty', inlineProcessor, '_end')
md.ESCAPED_CHARS.extend(['"', "'"])
-
-
-def makeExtension(**kwargs):
- return SmartyExtension(**kwargs)
diff --git a/markdown/extensions/tables.py b/markdown/extensions/tables.py
index 3d9bf03..15840b0 100644
--- a/markdown/extensions/tables.py
+++ b/markdown/extensions/tables.py
@@ -96,7 +96,3 @@ class TableExtension(Extension):
md.parser.blockprocessors.add('table',
TableProcessor(md.parser),
'<hashheader')
-
-
-def makeExtension(**kwargs):
- return TableExtension(**kwargs)
diff --git a/markdown/extensions/toc.py b/markdown/extensions/toc.py
index 9f62902..f1cfa17 100644
--- a/markdown/extensions/toc.py
+++ b/markdown/extensions/toc.py
@@ -301,7 +301,3 @@ class TocExtension(Extension):
def reset(self):
self.md.toc = ''
-
-
-def makeExtension(**kwargs):
- return TocExtension(**kwargs)
diff --git a/markdown/extensions/wikilinks.py b/markdown/extensions/wikilinks.py
index 6ae9483..284dbb7 100644
--- a/markdown/extensions/wikilinks.py
+++ b/markdown/extensions/wikilinks.py
@@ -83,7 +83,3 @@ class WikiLinks(Pattern):
if 'wiki_html_class' in self.md.Meta:
html_class = self.md.Meta['wiki_html_class'][0]
return base_url, end_url, html_class
-
-
-def makeExtension(**kwargs):
- return WikiLinkExtension(**kwargs)