From 48ec8b73cb77f8acbd6d6cb1777469226f201402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= <hugo@lysator.liu.se> Date: Mon, 29 May 2023 15:00:10 +0200 Subject: [PATCH] Minor changes. --- muppet/__main__.py | 8 +++++--- templates/code_page.html | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/muppet/__main__.py b/muppet/__main__.py index 21593dd..b35d5f0 100644 --- a/muppet/__main__.py +++ b/muppet/__main__.py @@ -324,14 +324,16 @@ def setup_module(base: str, module: ModuleEntry) -> None: # puppet_class['docstring'] # 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']) with open(os.path.join(dir, 'source.json'), 'w') as f: json.dump(puppet_class, f, indent=2) - with open(os.path.join(dir, 'source.pp.html'), 'w') as f: - f.write(format_class(puppet_class)) + # with open(os.path.join(dir, 'source.pp.html'), 'w') as f: + # f.write(format_class(puppet_class)) with open(os.path.join(dir, 'index.html'), 'w') as f: template = jinja.get_template('code_page.html') diff --git a/templates/code_page.html b/templates/code_page.html index 1bf0fc1..2840bfc 100644 --- a/templates/code_page.html +++ b/templates/code_page.html @@ -1,5 +1,9 @@ {% extends "base.html" %} {% 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 }} {% endblock %} {# ft: jinja #} -- GitLab