Skip to content
Snippets Groups Projects
Commit 24e5ad00 authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

Don't render non-markdown files.

parent 697f456b
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import os
import os.path
import pathlib
import json
import html
from .gather import ModuleEntry
from jinja2 import (
Environment,
......@@ -378,7 +379,11 @@ def setup_module(base: str, module: ModuleEntry, *, path_base: str) -> None:
pathlib.Path(os.path.join(path, name)).mkdir(exist_ok=True)
out_path = os.path.join(path, name, 'index.html')
content = markdown(raw_content)
if filename.endswith('.md'):
content = markdown(raw_content)
else:
content = '<pre>' + html.escape(raw_content) + '</pre>'
template = jinja.get_template('content.html')
crumbs = breadcrumbs(('Environment', ''),
module.name,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment