Skip to content

Commit

Permalink
refactor: Mark all Jinja blocks as scoped
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jan 31, 2024
1 parent d70cd9d commit 548bdad
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
<p><strong>{{ section.title or lang.t("Attributes:") }}</strong></p>
<table>
<thead>
Expand Down Expand Up @@ -35,7 +35,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Attributes:") }}</p>
<ul>
{% for attribute in section.value %}
Expand All @@ -55,7 +55,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
<p><strong>{{ section.title or lang.t("Classes:") }}</strong></p>
<table>
<thead>
Expand All @@ -27,7 +27,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Classes:") }}</p>
<ul>
{% for class in section.value %}
Expand All @@ -42,7 +42,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
<p><strong>{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}</strong></p>
<table>
<thead>
Expand All @@ -29,7 +29,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}</p>
<ul>
{% for function in section.value %}
Expand All @@ -46,7 +46,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
<p><strong>{{ section.title or lang.t("Modules:") }}</strong></p>
<table>
<thead>
Expand All @@ -27,7 +27,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Modules:") }}</p>
<ul>
{% for module in section.value %}
Expand All @@ -42,7 +42,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
<p><strong>{{ section.title or lang.t("Other Parameters:") }}</strong></p>
<table>
<thead>
Expand Down Expand Up @@ -35,7 +35,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Other Parameters:") }}</p>
<ul>
{% for parameter in section.value %}
Expand All @@ -55,7 +55,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
<p><strong>{{ section.title or lang.t("Parameters:") }}</strong></p>
<table>
<thead>
Expand Down Expand Up @@ -45,7 +45,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Parameters:") }}</p>
<ul>
{% for parameter in section.value %}
Expand All @@ -70,7 +70,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
<p><strong>{{ section.title or lang.t("Raises:") }}</strong></p>
<table>
<thead>
Expand Down Expand Up @@ -33,7 +33,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ lang.t(section.title) or lang.t("Raises:") }}</p>
<ul>
{% for raises in section.value %}
Expand All @@ -52,7 +52,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
{% set name_column = section.value|selectattr("name")|any %}
<p><strong>{{ section.title or lang.t("Receives:") }}</strong></p>
<table>
Expand Down Expand Up @@ -36,7 +36,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Receives:") }}</p>
<ul>
{% for receives in section.value %}
Expand All @@ -58,7 +58,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
{% set name_column = section.value|selectattr("name")|any %}
<p><strong>{{ section.title or lang.t("Returns:") }}</strong></p>
<table>
Expand Down Expand Up @@ -36,7 +36,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Returns:") }}</p>
<ul>
{% for returns in section.value %}
Expand All @@ -58,7 +58,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
<p><strong>{{ section.title or lang.t("Warns:") }}</strong></p>
<table>
<thead>
Expand Down Expand Up @@ -33,7 +33,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Warns:") }}</p>
<ul>
{% for warns in section.value %}
Expand All @@ -52,7 +52,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% import "language.html" as lang with context %}

{% if config.docstring_section_style == "table" %}
{% block table_style %}
{% block table_style scoped %}
{% set name_column = section.value|selectattr("name")|any %}
<p><strong>{{ section.title or lang.t("Yields:") }}</strong></p>
<table>
Expand Down Expand Up @@ -36,7 +36,7 @@
</table>
{% endblock table_style %}
{% elif config.docstring_section_style == "list" %}
{% block list_style %}
{% block list_style scoped %}
<p>{{ section.title or lang.t("Yields:") }}</p>
<ul>
{% for yields in section.value %}
Expand All @@ -58,7 +58,7 @@
</ul>
{% endblock list_style %}
{% elif config.docstring_section_style == "spacy" %}
{% block spacy_style %}
{% block spacy_style scoped %}
<table>
<thead>
<tr>
Expand Down

0 comments on commit 548bdad

Please sign in to comment.