Skip to content

Commit

Permalink
refac: Simplify filters to one file
Browse files Browse the repository at this point in the history
  • Loading branch information
TEParsons committed Sep 30, 2024
1 parent 4ac2af4 commit 37cd9ab
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 9 additions & 1 deletion mkdocs_landing/filters/md.py → mkdocs_landing/filters.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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=""):
Expand Down
1 change: 0 additions & 1 deletion mkdocs_landing/filters/__init__.py

This file was deleted.

7 changes: 0 additions & 7 deletions mkdocs_landing/filters/base.py

This file was deleted.

File renamed without changes.

0 comments on commit 37cd9ab

Please sign in to comment.