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