Skip to content

Commit

Permalink
refactor: Update *.html top-level templates to extend the `*.html.j…
Browse files Browse the repository at this point in the history
…inja` base templates

Issue-151: #151
  • Loading branch information
pawamoy committed Apr 28, 2024
1 parent e6f1b9c commit a8c540e
Show file tree
Hide file tree
Showing 43 changed files with 43 additions and 434 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/attribute.html" %}
{% extends "_base/attribute.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/children.html" %}
{% extends "_base/children.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/class.html" %}
{% extends "_base/class.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring.html" %}
{% extends "_base/docstring.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/admonition.html" %}
{% extends "_base/docstring/admonition.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/attributes.html" %}
{% extends "_base/docstring/attributes.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/classes.html" %}
{% extends "_base/docstring/classes.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/examples.html" %}
{% extends "_base/docstring/examples.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/functions.html" %}
{% extends "_base/docstring/functions.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/modules.html" %}
{% extends "_base/docstring/modules.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/other_parameters.html" %}
{% extends "_base/docstring/other_parameters.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/parameters.html" %}
{% extends "_base/docstring/parameters.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/raises.html" %}
{% extends "_base/docstring/raises.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/receives.html" %}
{% extends "_base/docstring/receives.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/returns.html" %}
{% extends "_base/docstring/returns.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/warns.html" %}
{% extends "_base/docstring/warns.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/docstring/yields.html" %}
{% extends "_base/docstring/yields.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/expression.html" %}
{% extends "_base/expression.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/function.html" %}
{% extends "_base/function.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/labels.html" %}
{% extends "_base/labels.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
<!-- Import translations for given language and fallback -->
{% set lang_pth = "languages/" ~ locale ~ ".html" %}
{% if lang_pth is existing_template %}
{% import lang_pth as lang %}
{% import "languages/en.html" as fallback %}
{% macro t(key) %}{{ lang.t(key) or fallback.t(key) }}{% endmacro %}
{% else %}
{% import "languages/en.html" as lang %}
{% macro t(key) %}{{ lang.t(key) }}{% endmacro %}
{% endif %}
{% extends "_base/language.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/languages/en.html" %}
{% extends "_base/languages/en.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/languages/ja.html" %}
{% extends "_base/languages/ja.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/languages/zh.html" %}
{% extends "_base/languages/zh.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/module.html" %}
{% extends "_base/module.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/signature.html" %}
{% extends "_base/signature.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/summary.html" %}
{% extends "_base/summary.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/summary/attributes.html" %}
{% extends "_base/summary/attributes.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/summary/classes.html" %}
{% extends "_base/summary/classes.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/summary/functions.html" %}
{% extends "_base/summary/functions.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% extends "_base/summary/modules.html" %}
{% extends "_base/summary/modules.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1,33 +1 @@
{{ log.debug() }}

{% import "language.html" as lang with context %}

<table class="field-list">
<colgroup>
<col class="field-name" />
<col class="field-body" />
</colgroup>
<tbody valign="top">
<tr class="field">
<th class="field-name">{{ section.title or lang.t("Attributes:") }}</th>
<td class="field-body">
<ul class="first simple">
{% for attribute in section.value %}
<li>
<b><code>{{ attribute.name }}</code></b>
{% if attribute.annotation %}
{% with expression = attribute.annotation %}
(<code>{% include "expression.html" with context %}</code>)
{% endwith %}
{% endif %}
<div class="doc-md-description">
{{ attribute.description|convert_markdown(heading_level, html_id) }}
</div>
</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
{% extends "_base/docstring/attributes.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1,33 +1 @@
{{ log.debug() }}

{% import "language.html" as lang with context %}

<table class="field-list">
<colgroup>
<col class="field-name" />
<col class="field-body" />
</colgroup>
<tbody valign="top">
<tr class="field">
<th class="field-name">{{ section.title or lang.t("Other parameters:") }}</th>
<td class="field-body">
<ul class="first simple">
{% for parameter in section.value %}
<li>
<b><code>{{ parameter.name }}</code></b>
{% if parameter.annotation %}
{% with expression = parameter.annotation %}
(<code>{% include "expression.html" with context %}</code>)
{% endwith %}
{% endif %}
<div class="doc-md-description">
{{ parameter.description|convert_markdown(heading_level, html_id) }}
</div>
</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
{% extends "_base/docstring/other_parameters.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1,38 +1 @@
{{ log.debug() }}

{% import "language.html" as lang with context %}

<table class="field-list">
<colgroup>
<col class="field-name" />
<col class="field-body" />
</colgroup>
<tbody valign="top">
<tr class="field">
<th class="field-name">{{ section.title or lang.t("Parameters:") }}</th>
<td class="field-body">
<ul class="first simple">
{% for parameter in section.value %}
<li>
<b><code>{{ parameter.name }}</code></b>
{% if parameter.annotation %}
{% with expression = parameter.annotation %}
(<code>{% include "expression.html" with context %}</code>
{%- if parameter.default %}, {{ lang.t("default:") }}
{% with expression = parameter.default %}
<code>{% include "expression.html" with context %}</code>
{% endwith %}
{% endif %})
{% endwith %}
{% endif %}
<div class="doc-md-description">
{{ parameter.description|convert_markdown(heading_level, html_id) }}
</div>
</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
{% extends "_base/docstring/parameters.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1,32 +1 @@
{{ log.debug() }}

{% import "language.html" as lang with context %}

<table class="field-list">
<colgroup>
<col class="field-name" />
<col class="field-body" />
</colgroup>
<tbody valign="top">
<tr class="field">
<th class="field-name">{{ section.title or lang.t("Raises:") }}</th>
<td class="field-body">
<ul class="first simple">
{% for raises in section.value %}
<li>
{% if raises.annotation %}
{% with expression = raises.annotation %}
<code>{% include "expression.html" with context %}</code>
{% endwith %}
{% endif %}
<div class="doc-md-description">
{{ raises.description|convert_markdown(heading_level, html_id) }}
</div>
</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
{% extends "_base/docstring/raises.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1,35 +1 @@
{{ log.debug() }}

{% import "language.html" as lang with context %}

<table class="field-list">
<colgroup>
<col class="field-name" />
<col class="field-body" />
</colgroup>
<tbody valign="top">
<tr class="field">
<th class="field-name">{{ section.title or lang.t("Receives:") }}</th>
<td class="field-body">
<ul class="first simple">
{% for receives in section.value %}
<li>
{% if receives.name %}<b><code>{{ receives.name }}</code></b>{% endif %}
{% if receives.annotation %}
{% with expression = receives.annotation %}
{% if receives.name %}({% endif %}
<code>{% include "expression.html" with context %}</code>
{% if receives.name %}){% endif %}
{% endwith %}
{% endif %}
<div class="doc-md-description">
{{ receives.description|convert_markdown(heading_level, html_id) }}
</div>
</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
{% extends "_base/docstring/receives.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1,35 +1 @@
{{ log.debug() }}

{% import "language.html" as lang with context %}

<table class="field-list">
<colgroup>
<col class="field-name" />
<col class="field-body" />
</colgroup>
<tbody valign="top">
<tr class="field">
<th class="field-name">{{ section.title or lang.t("Returns:") }}</th>
<td class="field-body">
<ul class="first simple">
{% for returns in section.value %}
<li>
{% if returns.name %}<b><code>{{ returns.name }}</code></b>{% endif %}
{% if returns.annotation %}
{% with expression = returns.annotation %}
{% if returns.name %}({% endif %}
<code>{% include "expression.html" with context %}</code>
{% if returns.name %}){% endif %}
{% endwith %}
{% endif %}
<div class="doc-md-description">
{{ returns.description|convert_markdown(heading_level, html_id) }}
</div>
</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
{% extends "_base/docstring/returns.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1,32 +1 @@
{{ log.debug() }}

{% import "language.html" as lang with context %}

<table class="field-list">
<colgroup>
<col class="field-name" />
<col class="field-body" />
</colgroup>
<tbody valign="top">
<tr class="field">
<th class="field-name">{{ section.title or lang.t("Warns:") }}</th>
<td class="field-body">
<ul class="first simple">
{% for warns in section.value %}
<li>
{% if warns.annotation %}
{% with expression = warns.annotation %}
<code>{% include "expression.html" with context %}</code>
{% endwith %}
{% endif %}
<div class="doc-md-description">
{{ warns.description|convert_markdown(heading_level, html_id) }}
</div>
</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
{% extends "_base/docstring/warns.html.jinja" %}
Original file line number Diff line number Diff line change
@@ -1,35 +1 @@
{{ log.debug() }}

{% import "language.html" as lang with context %}

<table class="field-list">
<colgroup>
<col class="field-name" />
<col class="field-body" />
</colgroup>
<tbody valign="top">
<tr class="field">
<th class="field-name">{{ section.title or lang.t("Yields:") }}</th>
<td class="field-body">
<ul class="first simple">
{% for yields in section.value %}
<li>
{% if yields.name %}<b></code>{{ yields.name }}</code></b>{% endif %}
{% if yields.annotation %}
{% with expression = yields.annotation %}
{% if yields.name %}({% endif %}
<code>{% include "expression.html" with context %}</code>
{% if yields.name %}){% endif %}
{% endwith %}
{% endif %}
<div class="doc-md-description">
{{ yields.description|convert_markdown(heading_level, html_id) }}
</div>
</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
{% extends "_base/docstring/yields.html.jinja" %}
Loading

0 comments on commit a8c540e

Please sign in to comment.