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

Minor changes.

parent 70085c70
Branches
No related tags found
No related merge requests found
...@@ -324,14 +324,16 @@ def setup_module(base: str, module: ModuleEntry) -> None: ...@@ -324,14 +324,16 @@ def setup_module(base: str, module: ModuleEntry) -> None:
# puppet_class['docstring'] # puppet_class['docstring']
# puppet_class['defaults'] # puppet_class['defaults']
with open(os.path.join(dir, 'source.pp'), 'w') as f: # TODO option to add .txt extension (for web serverse which
# treat .pp as application/binary)
with open(os.path.join(dir, 'source.pp.txt'), 'w') as f:
f.write(puppet_class['source']) f.write(puppet_class['source'])
with open(os.path.join(dir, 'source.json'), 'w') as f: with open(os.path.join(dir, 'source.json'), 'w') as f:
json.dump(puppet_class, f, indent=2) json.dump(puppet_class, f, indent=2)
with open(os.path.join(dir, 'source.pp.html'), 'w') as f: # with open(os.path.join(dir, 'source.pp.html'), 'w') as f:
f.write(format_class(puppet_class)) # f.write(format_class(puppet_class))
with open(os.path.join(dir, 'index.html'), 'w') as f: with open(os.path.join(dir, 'index.html'), 'w') as f:
template = jinja.get_template('code_page.html') template = jinja.get_template('code_page.html')
......
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
<ul>
<li><a href="source.pp.txt">Raw Source code</a></li>
<li><a href="source.json">JSON blob</a></li>
</ul>
{{ content }} {{ content }}
{% endblock %} {% endblock %}
{# ft: jinja #} {# ft: jinja #}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment