aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-07-03 22:58:08 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-07-03 22:58:08 +0200
commitb1494d78c31e85b2b966fd52ff4efad528e03e03 (patch)
tree3e3a0b2e0ae40c790b3a695a52d5ac3f6f950cf3 /templates
parentMakefile: Also add pyright check. (diff)
downloadmuppet-strings-b1494d78c31e85b2b966fd52ff4efad528e03e03.tar.gz
muppet-strings-b1494d78c31e85b2b966fd52ff4efad528e03e03.tar.xz
Harden typesystem + misc.
Misc includes: - at least one more category - basic sidebars
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html21
-rw-r--r--templates/code_page.html6
-rw-r--r--templates/index.html12
-rw-r--r--templates/module_index.html26
-rw-r--r--templates/snippets/ResourceType-index-entry.html15
-rw-r--r--templates/snippets/ResourceType-list-entry.html10
-rw-r--r--templates/snippets/tabset.html (renamed from templates/tabset.html)0
7 files changed, 63 insertions, 27 deletions
diff --git a/templates/base.html b/templates/base.html
index c9cbb88..9c8fa46 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -34,16 +34,21 @@ Parameters:
<body>
<header>
{% if breadcrumbs %}
- <ul class="breadcrumb">
- {%- for item in breadcrumbs.crumbs -%}
- <li><a href="{{ path_base }}{{ item.ref }}">{{ item.text }}</a></li>
- {%- endfor -%}
- <li>{{ breadcrumbs.final }}</li>
- </ul>
+ <nav>
+ <ul class="breadcrumb">
+ {%- for item in breadcrumbs.crumbs -%}
+ <li><a href="{{ path_base }}{{ item.ref }}">{{ item.text }}</a></li>
+ {%- endfor -%}
+ <li>{{ breadcrumbs.final }}</li>
+ </ul>
+ </nav>
{% endif %}
</header>
- {% block content %}
- {% endblock %}
+ <div id="page-root">
+ <aside id="left-sidebar" class="sidebar">{% block left_sidebar %}{% endblock %}</aside>
+ <main>{% block content %}{% endblock %}</main>
+ <aside id="right-sidebar" class="sidebar">{% block right_sidebar %}{% endblock %}</aside>
+ </div>
</body>
</html>
{# ft: jinja #}
diff --git a/templates/code_page.html b/templates/code_page.html
index 989fc5a..2e7f99c 100644
--- a/templates/code_page.html
+++ b/templates/code_page.html
@@ -7,6 +7,12 @@ Parameters:
Content of page
#}
{% extends "base.html" %}
+{% block left_sidebar %}
+ {# Class list, basically the right sidebar from module index #}
+{% endblock %}
+{% block right_sidebar %}
+ {# All defined variables #}
+{% endblock %}
{% block content %}
<h1><code>{{ title }}</code></h1>
<ul class="alternatives">
diff --git a/templates/index.html b/templates/index.html
index 5cd4683..b3f4b6e 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -10,20 +10,22 @@ Parameters:
{% extends "base.html" %}
{% block content %}
<h1>Muppet Strings</h1>
- <ul>
+ <dl class="module-index">
{% for module in modules %}
- <li>
+ <dt>
{%- if module.metadata.get('name') -%}
{{ module.metadata['name'].split('-')[0] }}/
{%- endif -%}
<a href="{{ module.name }}"
class="{{ 'error' if module.strings_output == None }}"
>{{ module.name }}</a>
+ </dt>
+ <dd>
{%- if module.metadata.get('summary') %}
- &mdash; {{ module.metadata['summary'] }}
+ {{ module.metadata['summary'] }}
{%- endif -%}
- </li>
+ </dd>
{% endfor %}
- </ul>
+ </dl>
{% endblock %}
{# ft: jinja #}
diff --git a/templates/module_index.html b/templates/module_index.html
index e8a74db..3448000 100644
--- a/templates/module_index.html
+++ b/templates/module_index.html
@@ -7,6 +7,17 @@ Parameters:
content:
#}
{% extends "base.html" %}
+{% block left_sidebar %}
+ {# environment list #}
+{% endblock %}
+{% block right_sidebar %}
+ {# Table of contents, including all types #}
+ <ul class="toc">
+ {% for entry in content %}
+ {{ entry.to_html_list() }}
+ {% endfor %}
+ </ul>
+{% endblock %}
{% block content %}
<h1>{{ module_author }} / {{ module_name.title() }}</h1>
@@ -17,20 +28,7 @@ Parameters:
</ul>
{% for entry in content %}
- <h2>{{ entry['title'] }}</h2>
- {% for subentry in entry['list'] %}
- <h3>{{ subentry['title'] }}</h3>
- <ul class="overview-list">
- {% for item in subentry['list'] %}
- <li>
- <a href="{{ item['file'] }}">{{ item['name'] }}</a>
- {%- if 'summary' in item %}
- &mdash; {{ item['summary'] }}
- {%- endif -%}
- </li>
- {% endfor %}
- </ul>
- {% endfor %}
+ {{ entry.to_html() }}
{% endfor %}
{% endblock %}
diff --git a/templates/snippets/ResourceType-index-entry.html b/templates/snippets/ResourceType-index-entry.html
new file mode 100644
index 0000000..b08d658
--- /dev/null
+++ b/templates/snippets/ResourceType-index-entry.html
@@ -0,0 +1,15 @@
+{#
+#}
+<dt><a href="#">{{ item.base() }}</a></dt>
+<dd>
+ {% if item.summary %}
+ <!-- TODO docstring.text -->
+ {{ item.summary }}
+ {% endif %}
+ <dl>
+ {% for provider in item.children %}
+ {{ provider.to_html() }}
+ {% endfor %}
+ </dl>
+</dd>
+{# ft:jinja2 #}
diff --git a/templates/snippets/ResourceType-list-entry.html b/templates/snippets/ResourceType-list-entry.html
new file mode 100644
index 0000000..dedb1a0
--- /dev/null
+++ b/templates/snippets/ResourceType-list-entry.html
@@ -0,0 +1,10 @@
+{#
+#}
+<li><a href="#">{{ item.base() }}</a>
+ <ul>
+ {% for provider in item.children %}
+ {{ provider.to_html_list() }}
+ {% endfor %}
+ </ul>
+</li>
+{# ft:jinja2 #}
diff --git a/templates/tabset.html b/templates/snippets/tabset.html
index 559af0a..559af0a 100644
--- a/templates/tabset.html
+++ b/templates/snippets/tabset.html