diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2023-02-14 13:22:19 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2023-02-14 13:22:19 -0600 |
commit | 26dabc676ac74812f2dbcfaf0e2b7c5b21e804c9 (patch) | |
tree | bbd5be35c25d171ef8999a5135a790fd7f0fd1be /src | |
parent | 0e46f2cd0a2f6a972da76ec92d10bb77cd3c7f37 (diff) |
add simple tests and simple working solution
Diffstat (limited to 'src')
-rw-r--r-- | src/pymdvar/__init__.py | 3 | ||||
-rw-r--r-- | src/pymdvar/pymdvar.py | 19 |
2 files changed, 0 insertions, 22 deletions
diff --git a/src/pymdvar/__init__.py b/src/pymdvar/__init__.py deleted file mode 100644 index b64a3b6..0000000 --- a/src/pymdvar/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .pymdvar import VariableExtension - -__all__ = ['VariableExtension']
\ No newline at end of file diff --git a/src/pymdvar/pymdvar.py b/src/pymdvar/pymdvar.py deleted file mode 100644 index aa62cfd..0000000 --- a/src/pymdvar/pymdvar.py +++ /dev/null @@ -1,19 +0,0 @@ -from markdown.extensions import Extension -from markdown.inlinepatterns import Pattern - -VARIABLE_RE = r'\$\{(\w+)\}' - - -class VariablePattern(Pattern): - def handleMatch(self, m): - variable = m.group(2) - return variable - - -def makeExtension(*args, **kwargs): - return VariableExtension(*args, **kwargs) - - -class VariableExtension(Extension): - def extendMarkdown(self, md): - md.inlinePatterns.register(VariablePattern(VARIABLE_RE), 'var', 175)
\ No newline at end of file |