Skip to content

Commit df0ea49

Browse files
refactor: Update *.html top-level templates to extend the *.html.jinja base templates
Issue-151: mkdocstrings/python#151
1 parent 9ee811d commit df0ea49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+43
-434
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/attribute.html" %}
1+
{% extends "_base/attribute.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/children.html" %}
1+
{% extends "_base/children.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/class.html" %}
1+
{% extends "_base/class.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring.html" %}
1+
{% extends "_base/docstring.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/admonition.html" %}
1+
{% extends "_base/docstring/admonition.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/attributes.html" %}
1+
{% extends "_base/docstring/attributes.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/classes.html" %}
1+
{% extends "_base/docstring/classes.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/examples.html" %}
1+
{% extends "_base/docstring/examples.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/functions.html" %}
1+
{% extends "_base/docstring/functions.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/modules.html" %}
1+
{% extends "_base/docstring/modules.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/other_parameters.html" %}
1+
{% extends "_base/docstring/other_parameters.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/parameters.html" %}
1+
{% extends "_base/docstring/parameters.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/raises.html" %}
1+
{% extends "_base/docstring/raises.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/receives.html" %}
1+
{% extends "_base/docstring/receives.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/returns.html" %}
1+
{% extends "_base/docstring/returns.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/warns.html" %}
1+
{% extends "_base/docstring/warns.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/docstring/yields.html" %}
1+
{% extends "_base/docstring/yields.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/expression.html" %}
1+
{% extends "_base/expression.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/function.html" %}
1+
{% extends "_base/function.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/labels.html" %}
1+
{% extends "_base/labels.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
<!-- Import translations for given language and fallback -->
2-
{% set lang_pth = "languages/" ~ locale ~ ".html" %}
3-
{% if lang_pth is existing_template %}
4-
{% import lang_pth as lang %}
5-
{% import "languages/en.html" as fallback %}
6-
{% macro t(key) %}{{ lang.t(key) or fallback.t(key) }}{% endmacro %}
7-
{% else %}
8-
{% import "languages/en.html" as lang %}
9-
{% macro t(key) %}{{ lang.t(key) }}{% endmacro %}
10-
{% endif %}
1+
{% extends "_base/language.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/languages/en.html" %}
1+
{% extends "_base/languages/en.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/languages/ja.html" %}
1+
{% extends "_base/languages/ja.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/languages/zh.html" %}
1+
{% extends "_base/languages/zh.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/module.html" %}
1+
{% extends "_base/module.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/signature.html" %}
1+
{% extends "_base/signature.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/summary.html" %}
1+
{% extends "_base/summary.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/summary/attributes.html" %}
1+
{% extends "_base/summary/attributes.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/summary/classes.html" %}
1+
{% extends "_base/summary/classes.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/summary/functions.html" %}
1+
{% extends "_base/summary/functions.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "_base/summary/modules.html" %}
1+
{% extends "_base/summary/modules.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1,33 +1 @@
1-
{{ log.debug() }}
2-
3-
{% import "language.html" as lang with context %}
4-
5-
<table class="field-list">
6-
<colgroup>
7-
<col class="field-name" />
8-
<col class="field-body" />
9-
</colgroup>
10-
<tbody valign="top">
11-
<tr class="field">
12-
<th class="field-name">{{ section.title or lang.t("Attributes:") }}</th>
13-
<td class="field-body">
14-
<ul class="first simple">
15-
{% for attribute in section.value %}
16-
<li>
17-
<b><code>{{ attribute.name }}</code></b>
18-
{% if attribute.annotation %}
19-
{% with expression = attribute.annotation %}
20-
(<code>{% include "expression.html" with context %}</code>)
21-
{% endwith %}
22-
{% endif %}
23-
24-
<div class="doc-md-description">
25-
{{ attribute.description|convert_markdown(heading_level, html_id) }}
26-
</div>
27-
</li>
28-
{% endfor %}
29-
</ul>
30-
</td>
31-
</tr>
32-
</tbody>
33-
</table>
1+
{% extends "_base/docstring/attributes.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1,33 +1 @@
1-
{{ log.debug() }}
2-
3-
{% import "language.html" as lang with context %}
4-
5-
<table class="field-list">
6-
<colgroup>
7-
<col class="field-name" />
8-
<col class="field-body" />
9-
</colgroup>
10-
<tbody valign="top">
11-
<tr class="field">
12-
<th class="field-name">{{ section.title or lang.t("Other parameters:") }}</th>
13-
<td class="field-body">
14-
<ul class="first simple">
15-
{% for parameter in section.value %}
16-
<li>
17-
<b><code>{{ parameter.name }}</code></b>
18-
{% if parameter.annotation %}
19-
{% with expression = parameter.annotation %}
20-
(<code>{% include "expression.html" with context %}</code>)
21-
{% endwith %}
22-
{% endif %}
23-
24-
<div class="doc-md-description">
25-
{{ parameter.description|convert_markdown(heading_level, html_id) }}
26-
</div>
27-
</li>
28-
{% endfor %}
29-
</ul>
30-
</td>
31-
</tr>
32-
</tbody>
33-
</table>
1+
{% extends "_base/docstring/other_parameters.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1,38 +1 @@
1-
{{ log.debug() }}
2-
3-
{% import "language.html" as lang with context %}
4-
5-
<table class="field-list">
6-
<colgroup>
7-
<col class="field-name" />
8-
<col class="field-body" />
9-
</colgroup>
10-
<tbody valign="top">
11-
<tr class="field">
12-
<th class="field-name">{{ section.title or lang.t("Parameters:") }}</th>
13-
<td class="field-body">
14-
<ul class="first simple">
15-
{% for parameter in section.value %}
16-
<li>
17-
<b><code>{{ parameter.name }}</code></b>
18-
{% if parameter.annotation %}
19-
{% with expression = parameter.annotation %}
20-
(<code>{% include "expression.html" with context %}</code>
21-
{%- if parameter.default %}, {{ lang.t("default:") }}
22-
{% with expression = parameter.default %}
23-
<code>{% include "expression.html" with context %}</code>
24-
{% endwith %}
25-
{% endif %})
26-
{% endwith %}
27-
{% endif %}
28-
29-
<div class="doc-md-description">
30-
{{ parameter.description|convert_markdown(heading_level, html_id) }}
31-
</div>
32-
</li>
33-
{% endfor %}
34-
</ul>
35-
</td>
36-
</tr>
37-
</tbody>
38-
</table>
1+
{% extends "_base/docstring/parameters.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1,32 +1 @@
1-
{{ log.debug() }}
2-
3-
{% import "language.html" as lang with context %}
4-
5-
<table class="field-list">
6-
<colgroup>
7-
<col class="field-name" />
8-
<col class="field-body" />
9-
</colgroup>
10-
<tbody valign="top">
11-
<tr class="field">
12-
<th class="field-name">{{ section.title or lang.t("Raises:") }}</th>
13-
<td class="field-body">
14-
<ul class="first simple">
15-
{% for raises in section.value %}
16-
<li>
17-
{% if raises.annotation %}
18-
{% with expression = raises.annotation %}
19-
<code>{% include "expression.html" with context %}</code>
20-
{% endwith %}
21-
{% endif %}
22-
23-
<div class="doc-md-description">
24-
{{ raises.description|convert_markdown(heading_level, html_id) }}
25-
</div>
26-
</li>
27-
{% endfor %}
28-
</ul>
29-
</td>
30-
</tr>
31-
</tbody>
32-
</table>
1+
{% extends "_base/docstring/raises.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1,35 +1 @@
1-
{{ log.debug() }}
2-
3-
{% import "language.html" as lang with context %}
4-
5-
<table class="field-list">
6-
<colgroup>
7-
<col class="field-name" />
8-
<col class="field-body" />
9-
</colgroup>
10-
<tbody valign="top">
11-
<tr class="field">
12-
<th class="field-name">{{ section.title or lang.t("Receives:") }}</th>
13-
<td class="field-body">
14-
<ul class="first simple">
15-
{% for receives in section.value %}
16-
<li>
17-
{% if receives.name %}<b><code>{{ receives.name }}</code></b>{% endif %}
18-
{% if receives.annotation %}
19-
{% with expression = receives.annotation %}
20-
{% if receives.name %}({% endif %}
21-
<code>{% include "expression.html" with context %}</code>
22-
{% if receives.name %}){% endif %}
23-
{% endwith %}
24-
{% endif %}
25-
26-
<div class="doc-md-description">
27-
{{ receives.description|convert_markdown(heading_level, html_id) }}
28-
</div>
29-
</li>
30-
{% endfor %}
31-
</ul>
32-
</td>
33-
</tr>
34-
</tbody>
35-
</table>
1+
{% extends "_base/docstring/receives.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1,35 +1 @@
1-
{{ log.debug() }}
2-
3-
{% import "language.html" as lang with context %}
4-
5-
<table class="field-list">
6-
<colgroup>
7-
<col class="field-name" />
8-
<col class="field-body" />
9-
</colgroup>
10-
<tbody valign="top">
11-
<tr class="field">
12-
<th class="field-name">{{ section.title or lang.t("Returns:") }}</th>
13-
<td class="field-body">
14-
<ul class="first simple">
15-
{% for returns in section.value %}
16-
<li>
17-
{% if returns.name %}<b><code>{{ returns.name }}</code></b>{% endif %}
18-
{% if returns.annotation %}
19-
{% with expression = returns.annotation %}
20-
{% if returns.name %}({% endif %}
21-
<code>{% include "expression.html" with context %}</code>
22-
{% if returns.name %}){% endif %}
23-
{% endwith %}
24-
{% endif %}
25-
26-
<div class="doc-md-description">
27-
{{ returns.description|convert_markdown(heading_level, html_id) }}
28-
</div>
29-
</li>
30-
{% endfor %}
31-
</ul>
32-
</td>
33-
</tr>
34-
</tbody>
35-
</table>
1+
{% extends "_base/docstring/returns.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1,32 +1 @@
1-
{{ log.debug() }}
2-
3-
{% import "language.html" as lang with context %}
4-
5-
<table class="field-list">
6-
<colgroup>
7-
<col class="field-name" />
8-
<col class="field-body" />
9-
</colgroup>
10-
<tbody valign="top">
11-
<tr class="field">
12-
<th class="field-name">{{ section.title or lang.t("Warns:") }}</th>
13-
<td class="field-body">
14-
<ul class="first simple">
15-
{% for warns in section.value %}
16-
<li>
17-
{% if warns.annotation %}
18-
{% with expression = warns.annotation %}
19-
<code>{% include "expression.html" with context %}</code>
20-
{% endwith %}
21-
{% endif %}
22-
23-
<div class="doc-md-description">
24-
{{ warns.description|convert_markdown(heading_level, html_id) }}
25-
</div>
26-
</li>
27-
{% endfor %}
28-
</ul>
29-
</td>
30-
</tr>
31-
</tbody>
32-
</table>
1+
{% extends "_base/docstring/warns.html.jinja" %}
Original file line numberDiff line numberDiff line change
@@ -1,35 +1 @@
1-
{{ log.debug() }}
2-
3-
{% import "language.html" as lang with context %}
4-
5-
<table class="field-list">
6-
<colgroup>
7-
<col class="field-name" />
8-
<col class="field-body" />
9-
</colgroup>
10-
<tbody valign="top">
11-
<tr class="field">
12-
<th class="field-name">{{ section.title or lang.t("Yields:") }}</th>
13-
<td class="field-body">
14-
<ul class="first simple">
15-
{% for yields in section.value %}
16-
<li>
17-
{% if yields.name %}<b></code>{{ yields.name }}</code></b>{% endif %}
18-
{% if yields.annotation %}
19-
{% with expression = yields.annotation %}
20-
{% if yields.name %}({% endif %}
21-
<code>{% include "expression.html" with context %}</code>
22-
{% if yields.name %}){% endif %}
23-
{% endwith %}
24-
{% endif %}
25-
26-
<div class="doc-md-description">
27-
{{ yields.description|convert_markdown(heading_level, html_id) }}
28-
</div>
29-
</li>
30-
{% endfor %}
31-
</ul>
32-
</td>
33-
</tr>
34-
</tbody>
35-
</table>
1+
{% extends "_base/docstring/yields.html.jinja" %}

0 commit comments

Comments
 (0)