From 548bdaddd66ffc99b3b9a5a62228a2ff4ff0dd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Wed, 31 Jan 2024 12:32:37 +0100 Subject: [PATCH] refactor: Mark all Jinja blocks as scoped --- .../templates/material/_base/docstring/attributes.html | 6 +++--- .../python/templates/material/_base/docstring/classes.html | 6 +++--- .../templates/material/_base/docstring/functions.html | 6 +++--- .../python/templates/material/_base/docstring/modules.html | 6 +++--- .../material/_base/docstring/other_parameters.html | 6 +++--- .../templates/material/_base/docstring/parameters.html | 6 +++--- .../python/templates/material/_base/docstring/raises.html | 6 +++--- .../python/templates/material/_base/docstring/receives.html | 6 +++--- .../python/templates/material/_base/docstring/returns.html | 6 +++--- .../python/templates/material/_base/docstring/warns.html | 6 +++--- .../python/templates/material/_base/docstring/yields.html | 6 +++--- 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html index 0b29157..88c5990 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html @@ -3,7 +3,7 @@ {% import "language.html" as lang with context %} {% if config.docstring_section_style == "table" %} - {% block table_style %} + {% block table_style scoped %}

{{ section.title or lang.t("Attributes:") }}

@@ -35,7 +35,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Attributes:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html index 4253164..b8ad2e0 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html @@ -3,7 +3,7 @@ {% import "language.html" as lang with context %} {% if config.docstring_section_style == "table" %} - {% block table_style %} + {% block table_style scoped %}

{{ section.title or lang.t("Classes:") }}

@@ -27,7 +27,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Classes:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html index f93a2e4..ab1939f 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html @@ -3,7 +3,7 @@ {% import "language.html" as lang with context %} {% if config.docstring_section_style == "table" %} - {% block table_style %} + {% block table_style scoped %}

{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}

@@ -29,7 +29,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Methods:") if obj.is_class else lang.t("Functions:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html index 3bae2a8..f771f20 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html @@ -3,7 +3,7 @@ {% import "language.html" as lang with context %} {% if config.docstring_section_style == "table" %} - {% block table_style %} + {% block table_style scoped %}

{{ section.title or lang.t("Modules:") }}

@@ -27,7 +27,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Modules:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html index 8315381..7ede671 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html @@ -3,7 +3,7 @@ {% import "language.html" as lang with context %} {% if config.docstring_section_style == "table" %} - {% block table_style %} + {% block table_style scoped %}

{{ section.title or lang.t("Other Parameters:") }}

@@ -35,7 +35,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Other Parameters:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html index 9483e8a..7b4788c 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html @@ -3,7 +3,7 @@ {% import "language.html" as lang with context %} {% if config.docstring_section_style == "table" %} - {% block table_style %} + {% block table_style scoped %}

{{ section.title or lang.t("Parameters:") }}

@@ -45,7 +45,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Parameters:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html index e4edc66..396ccc7 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html @@ -3,7 +3,7 @@ {% import "language.html" as lang with context %} {% if config.docstring_section_style == "table" %} - {% block table_style %} + {% block table_style scoped %}

{{ section.title or lang.t("Raises:") }}

@@ -33,7 +33,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ lang.t(section.title) or lang.t("Raises:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html index d58fb68..77d83c0 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html @@ -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 %}

{{ section.title or lang.t("Receives:") }}

@@ -36,7 +36,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Receives:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html index a8e3b77..b19917a 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html @@ -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 %}

{{ section.title or lang.t("Returns:") }}

@@ -36,7 +36,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Returns:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html index cf1cc4a..8377669 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html @@ -3,7 +3,7 @@ {% import "language.html" as lang with context %} {% if config.docstring_section_style == "table" %} - {% block table_style %} + {% block table_style scoped %}

{{ section.title or lang.t("Warns:") }}

@@ -33,7 +33,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Warns:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html index 63824c0..c69135e 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html @@ -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 %}

{{ section.title or lang.t("Yields:") }}

@@ -36,7 +36,7 @@
{% endblock table_style %} {% elif config.docstring_section_style == "list" %} - {% block list_style %} + {% block list_style scoped %}

{{ section.title or lang.t("Yields:") }}

{% endblock list_style %} {% elif config.docstring_section_style == "spacy" %} - {% block spacy_style %} + {% block spacy_style scoped %}