diff --git a/app/core/template_filters.py b/app/core/template_filters.py index 09ecdcc..7bcda14 100644 --- a/app/core/template_filters.py +++ b/app/core/template_filters.py @@ -1,8 +1,16 @@ import ipaddress +import markdown as md_package from flask import Blueprint bp = Blueprint('filters', __name__) +@bp.app_template_filter('markdown') +def markdown_filter(text): + """Convert markdown text to HTML""" + if text: + return md_package.markdown(text, extensions=['tables', 'fenced_code']) + return "" + @bp.app_template_filter('ip_network') def ip_network_filter(cidr): """Convert a CIDR string to an IP network object""" @@ -19,14 +27,6 @@ def ip_address_filter(ip): except ValueError: return None -@bp.app_template_filter('markdown') -def markdown_filter(text): - """Convert markdown text to HTML""" - import markdown - if text: - return markdown.markdown(text, extensions=['tables', 'fenced_code']) - return "" - @bp.app_template_global('get_ip_network') def get_ip_network(cidr): """Global function to get an IP network object from CIDR""" diff --git a/app/routes/__pycache__/dashboard.cpython-313.pyc b/app/routes/__pycache__/dashboard.cpython-313.pyc index 59ff61c..28a1a02 100644 Binary files a/app/routes/__pycache__/dashboard.cpython-313.pyc and b/app/routes/__pycache__/dashboard.cpython-313.pyc differ diff --git a/app/routes/dashboard.py b/app/routes/dashboard.py index ea731cb..5e6b394 100644 --- a/app/routes/dashboard.py +++ b/app/routes/dashboard.py @@ -59,7 +59,6 @@ def server_view(server_id): title=f'Server - {server.hostname}', server=server, apps=apps, - markdown=markdown.markdown, now=datetime.now() ) @@ -263,7 +262,6 @@ def app_view(app_id): title=f'Application - {app.name}', app=app, server=server, - markdown=markdown.markdown, now=datetime.now() ) diff --git a/app/templates/dashboard/app_view.html b/app/templates/dashboard/app_view.html new file mode 100644 index 0000000..f3db2ad --- /dev/null +++ b/app/templates/dashboard/app_view.html @@ -0,0 +1,26 @@ + +
No documentation available
++ Add documentation to this application to keep track of important information. +
+ +No documentation available
++ Add documentation to this server to keep track of important information. +
+ +