diff --git a/mkdocs_landing/filters/md.py b/mkdocs_landing/filters.py similarity index 84% rename from mkdocs_landing/filters/md.py rename to mkdocs_landing/filters.py index 0cb9028..8dccb33 100644 --- a/mkdocs_landing/filters/md.py +++ b/mkdocs_landing/filters.py @@ -1,5 +1,12 @@ import markdown -from .base import jinja_filter +from jinja2.filters import FILTERS + + +def jinja_filter(tag): + def register_filter(fcn): + FILTERS[tag] = fcn + + return register_filter # if config event not run, use parser with default config @@ -15,6 +22,7 @@ def on_config(config, **kwargs): # create markdown interpreter md = markdown.Markdown(extensions=config.markdown_extensions) + # define conversion function @jinja_filter("markdown") def parse_markdown(text, id=""): diff --git a/mkdocs_landing/filters/__init__.py b/mkdocs_landing/filters/__init__.py deleted file mode 100644 index d288037..0000000 --- a/mkdocs_landing/filters/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import md, layout \ No newline at end of file diff --git a/mkdocs_landing/filters/base.py b/mkdocs_landing/filters/base.py deleted file mode 100644 index eb93ad8..0000000 --- a/mkdocs_landing/filters/base.py +++ /dev/null @@ -1,7 +0,0 @@ -from jinja2.filters import FILTERS - -def jinja_filter(tag): - def register_filter(fcn): - FILTERS[tag] = fcn - - return register_filter \ No newline at end of file diff --git a/mkdocs_landing/filters/layout.py b/mkdocs_landing/hooks/layout.py similarity index 100% rename from mkdocs_landing/filters/layout.py rename to mkdocs_landing/hooks/layout.py