From e45744e7c5b9916c398fe41273194ffb671fcdac Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 15 Oct 2024 22:30:47 +0200 Subject: Merging upstream version 1.1.0. Signed-off-by: Daniel Baumann --- docs/templates/python/material/anta_test.html | 163 --------------------- .../templates/python/material/anta_test.html.jinja | 163 +++++++++++++++++++++ docs/templates/python/material/class.html | 35 ----- docs/templates/python/material/class.html.jinja | 35 +++++ docs/templates/python/material/docstring.html | 36 ----- .../templates/python/material/docstring.html.jinja | 36 +++++ 6 files changed, 234 insertions(+), 234 deletions(-) delete mode 100644 docs/templates/python/material/anta_test.html create mode 100644 docs/templates/python/material/anta_test.html.jinja delete mode 100644 docs/templates/python/material/class.html create mode 100644 docs/templates/python/material/class.html.jinja delete mode 100644 docs/templates/python/material/docstring.html create mode 100644 docs/templates/python/material/docstring.html.jinja (limited to 'docs/templates') diff --git a/docs/templates/python/material/anta_test.html b/docs/templates/python/material/anta_test.html deleted file mode 100644 index ade0ba6..0000000 --- a/docs/templates/python/material/anta_test.html +++ /dev/null @@ -1,163 +0,0 @@ -{% if obj.members %} - {{ log.debug("Rendering children of " + obj.path) }} - -
- - {% if root_members %} - {% set members_list = config.members %} - {% else %} - {% set members_list = none %} - {% endif %} - - {% if config.group_by_category %} - - {% with %} - - {% if config.show_category_heading %} - {% set extra_level = 1 %} - {% else %} - {% set extra_level = 0 %} - {% endif %} - - {% with attributes = obj.attributes|filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) %} - {% if attributes %} - {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-attributes") %}Attributes{% endfilter %} - {% endif %} - {% with heading_level = heading_level + extra_level %} - {% for attribute in attributes|order_members(config.members_order, members_list) %} - {% if members_list is not none or attribute.is_public(check_name=False) %} - {% include attribute|get_template with context %} - {% endif %} - {% endfor %} - {% endwith %} - {% endif %} - {% endwith %} - - {% with classes = obj.classes|filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) %} - {% if classes %} - {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-classes") %}Classes{% endfilter %} - {% endif %} - {% with heading_level = heading_level + extra_level %} - {% for class in classes|order_members(config.members_order, members_list) %} - {% if class.name == "Input" %} - {% filter heading(heading_level, id=html_id ~ "-attributes") %}Inputs{% endfilter %} - {% set root = False %} - {% set heading_level = heading_level + 1 %} - {% set old_obj = obj %} - {% set obj = class %} - {% include "attributes_table.html" with context %} - {% set obj = old_obj %} - {% else %} - {% if members_list is not none or class.is_public(check_name=False) %} - {% include class|get_template with context %} - {% endif %} - {% endif %} - {% endfor %} - {% endwith %} - {% endif %} - {% endwith %} - - {% with functions = obj.functions|filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) %} - {% if functions %} - {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-functions") %}Functions{% endfilter %} - {% endif %} - {% with heading_level = heading_level + extra_level %} - {% for function in functions|order_members(config.members_order, members_list) %} - {% if not (obj.kind.value == "class" and function.name == "__init__" and config.merge_init_into_class) %} - {% if members_list is not none or function.is_public(check_name=False) %} - {% include function|get_template with context %} - {% endif %} - {% endif %} - {% endfor %} - {% endwith %} - {% endif %} - {% endwith %} - - {% if config.show_submodules %} - {% with modules = obj.modules|filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) %} - {% if modules %} - {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-modules") %}Modules{% endfilter %} - {% endif %} - {% with heading_level = heading_level + extra_level %} - {% for module in modules|order_members(config.members_order.alphabetical, members_list) %} - {% if members_list is not none or module.is_public(check_name=False) %} - {% include module|get_template with context %} - {% endif %} - {% endfor %} - {% endwith %} - {% endif %} - {% endwith %} - {% endif %} - - {% endwith %} - - {% else %} - - {% for child in obj.all_members - |filter_objects( - filters=config.filters, - members_list=members_list, - inherited_members=config.inherited_members, - keep_no_docstrings=config.show_if_no_docstring, - ) - |order_members(config.members_order, members_list) - %} - - {% if not (obj.is_class and child.name == "__init__" and config.merge_init_into_class) %} - - {% if members_list is not none or child.is_public(check_name=False) %} - {% if child.is_attribute %} - {% with attribute = child %} - {% include attribute|get_template with context %} - {% endwith %} - - {% elif child.is_class %} - {% with class = child %} - {% include class|get_template with context %} - {% endwith %} - - {% elif child.is_function %} - {% with function = child %} - {% include function|get_template with context %} - {% endwith %} - - {% elif child.is_module and config.show_submodules %} - {% with module = child %} - {% include module|get_template with context %} - {% endwith %} - - {% endif %} - {% endif %} - - {% endif %} - - {% endfor %} - - {% endif %} - -
-{% endif %} diff --git a/docs/templates/python/material/anta_test.html.jinja b/docs/templates/python/material/anta_test.html.jinja new file mode 100644 index 0000000..a40d86a --- /dev/null +++ b/docs/templates/python/material/anta_test.html.jinja @@ -0,0 +1,163 @@ +{% if obj.members %} + {{ log.debug("Rendering children of " + obj.path) }} + +
+ + {% if root_members %} + {% set members_list = config.members %} + {% else %} + {% set members_list = none %} + {% endif %} + + {% if config.group_by_category %} + + {% with %} + + {% if config.show_category_heading %} + {% set extra_level = 1 %} + {% else %} + {% set extra_level = 0 %} + {% endif %} + + {% with attributes = obj.attributes|filter_objects( + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) %} + {% if attributes %} + {% if config.show_category_heading %} + {% filter heading(heading_level, id=html_id ~ "-attributes") %}Attributes{% endfilter %} + {% endif %} + {% with heading_level = heading_level + extra_level %} + {% for attribute in attributes|order_members(config.members_order, members_list) %} + {% if members_list is not none or attribute.is_public %} + {% include attribute|get_template with context %} + {% endif %} + {% endfor %} + {% endwith %} + {% endif %} + {% endwith %} + + {% with classes = obj.classes|filter_objects( + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) %} + {% if classes %} + {% if config.show_category_heading %} + {% filter heading(heading_level, id=html_id ~ "-classes") %}Classes{% endfilter %} + {% endif %} + {% with heading_level = heading_level + extra_level %} + {% for class in classes|order_members(config.members_order, members_list) %} + {% if class.name == "Input" %} + {% filter heading(heading_level, id=html_id ~ "-attributes") %}Inputs{% endfilter %} + {% set root = False %} + {% set heading_level = heading_level + 1 %} + {% set old_obj = obj %} + {% set obj = class %} + {% include "attributes_table.html" with context %} + {% set obj = old_obj %} + {% else %} + {% if members_list is not none or class.is_public %} + {% include class|get_template with context %} + {% endif %} + {% endif %} + {% endfor %} + {% endwith %} + {% endif %} + {% endwith %} + + {% with functions = obj.functions|filter_objects( + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) %} + {% if functions %} + {% if config.show_category_heading %} + {% filter heading(heading_level, id=html_id ~ "-functions") %}Functions{% endfilter %} + {% endif %} + {% with heading_level = heading_level + extra_level %} + {% for function in functions|order_members(config.members_order, members_list) %} + {% if not (obj.kind.value == "class" and function.name == "__init__" and config.merge_init_into_class) %} + {% if members_list is not none or function.is_public %} + {% include function|get_template with context %} + {% endif %} + {% endif %} + {% endfor %} + {% endwith %} + {% endif %} + {% endwith %} + + {% if config.show_submodules %} + {% with modules = obj.modules|filter_objects( + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) %} + {% if modules %} + {% if config.show_category_heading %} + {% filter heading(heading_level, id=html_id ~ "-modules") %}Modules{% endfilter %} + {% endif %} + {% with heading_level = heading_level + extra_level %} + {% for module in modules|order_members(config.members_order.alphabetical, members_list) %} + {% if members_list is not none or module.is_public %} + {% include module|get_template with context %} + {% endif %} + {% endfor %} + {% endwith %} + {% endif %} + {% endwith %} + {% endif %} + + {% endwith %} + + {% else %} + + {% for child in obj.all_members + |filter_objects( + filters=config.filters, + members_list=members_list, + inherited_members=config.inherited_members, + keep_no_docstrings=config.show_if_no_docstring, + ) + |order_members(config.members_order, members_list) + %} + + {% if not (obj.is_class and child.name == "__init__" and config.merge_init_into_class) %} + + {% if members_list is not none or child.is_public %} + {% if child.is_attribute %} + {% with attribute = child %} + {% include attribute|get_template with context %} + {% endwith %} + + {% elif child.is_class %} + {% with class = child %} + {% include class|get_template with context %} + {% endwith %} + + {% elif child.is_function %} + {% with function = child %} + {% include function|get_template with context %} + {% endwith %} + + {% elif child.is_module and config.show_submodules %} + {% with module = child %} + {% include module|get_template with context %} + {% endwith %} + + {% endif %} + {% endif %} + + {% endif %} + + {% endfor %} + + {% endif %} + +
+{% endif %} diff --git a/docs/templates/python/material/class.html b/docs/templates/python/material/class.html deleted file mode 100644 index 940103b..0000000 --- a/docs/templates/python/material/class.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "_base/class.html" %} -{% set anta_test = namespace(found=false) %} -{% for base in class.bases %} -{% set basestr = base | string %} -{% if "AntaTest" == basestr %} -{% set anta_test.found = True %} -{% endif %} -{% endfor %} -{% block children %} -{% if anta_test.found %} - {% set root = False %} - {% set heading_level = heading_level + 1 %} - {% include "anta_test.html" with context %} - {# render source after children - TODO make add flag to respect disabling it.. though do we want to disable?#} -
- Source code in - {%- if class.relative_filepath.is_absolute() -%} - {{ class.relative_package_filepath }} - {%- else -%} - {{ class.relative_filepath }} - {%- endif -%} - - {{ class.source|highlight(language="python", linestart=class.lineno, linenums=True) }} -
-{% else %} - {{ super() }} -{% endif %} -{% endblock children %} - -{# Do not render source before children for AntaTest #} -{% block source %} -{% if not anta_test.found %} - {{ super() }} -{% endif %} -{% endblock source %} diff --git a/docs/templates/python/material/class.html.jinja b/docs/templates/python/material/class.html.jinja new file mode 100644 index 0000000..1c1173c --- /dev/null +++ b/docs/templates/python/material/class.html.jinja @@ -0,0 +1,35 @@ +{% extends "_base/class.html.jinja" %} +{% set anta_test = namespace(found=false) %} +{% for base in class.bases %} +{% set basestr = base | string %} +{% if "AntaTest" == basestr %} +{% set anta_test.found = True %} +{% endif %} +{% endfor %} +{% block children %} +{% if anta_test.found %} + {% set root = False %} + {% set heading_level = heading_level + 1 %} + {% include "anta_test.html.jinja" with context %} + {# render source after children - TODO make add flag to respect disabling it.. though do we want to disable?#} +
+ Source code in + {%- if class.relative_filepath.is_absolute() -%} + {{ class.relative_package_filepath }} + {%- else -%} + {{ class.relative_filepath }} + {%- endif -%} + + {{ class.source|highlight(language="python", linestart=class.lineno, linenums=True) }} +
+{% else %} + {{ super() }} +{% endif %} +{% endblock children %} + +{# Do not render source before children for AntaTest #} +{% block source %} +{% if not anta_test.found %} + {{ super() }} +{% endif %} +{% endblock source %} diff --git a/docs/templates/python/material/docstring.html b/docs/templates/python/material/docstring.html deleted file mode 100644 index b12ae7e..0000000 --- a/docs/templates/python/material/docstring.html +++ /dev/null @@ -1,36 +0,0 @@ -{% if docstring_sections %} - {{ log.debug("Rendering docstring") }} - {% for section in docstring_sections %} - {% if config.show_docstring_description and section.kind.value == "text" %} - {% if not (config.anta_hide_test_module_description and module == obj) %} - {{ section.value|convert_markdown(heading_level, html_id) }} - {% endif %} - {% elif config.show_docstring_attributes and section.kind.value == "attributes" %} - {% include "docstring/attributes.html" with context %} - {% elif config.show_docstring_functions and section.kind.value == "functions" %} - {% include "docstring/functions.html" with context %} - {% elif config.show_docstring_classes and section.kind.value == "classes" %} - {% include "docstring/classes.html" with context %} - {% elif config.show_docstring_modules and section.kind.value == "modules" %} - {% include "docstring/modules.html" with context %} - {% elif config.show_docstring_parameters and section.kind.value == "parameters" %} - {% include "docstring/parameters.html" with context %} - {% elif config.show_docstring_other_parameters and section.kind.value == "other parameters" %} - {% include "docstring/other_parameters.html" with context %} - {% elif config.show_docstring_raises and section.kind.value == "raises" %} - {% include "docstring/raises.html" with context %} - {% elif config.show_docstring_warns and section.kind.value == "warns" %} - {% include "docstring/warns.html" with context %} - {% elif config.show_docstring_yields and section.kind.value == "yields" %} - {% include "docstring/yields.html" with context %} - {% elif config.show_docstring_receives and section.kind.value == "receives" %} - {% include "docstring/receives.html" with context %} - {% elif config.show_docstring_returns and section.kind.value == "returns" %} - {% include "docstring/returns.html" with context %} - {% elif config.show_docstring_examples and section.kind.value == "examples" %} - {% include "docstring/examples.html" with context %} - {% elif config.show_docstring_description and section.kind.value == "admonition" %} - {% include "docstring/admonition.html" with context %} - {% endif %} - {% endfor %} -{% endif %} diff --git a/docs/templates/python/material/docstring.html.jinja b/docs/templates/python/material/docstring.html.jinja new file mode 100644 index 0000000..b12ae7e --- /dev/null +++ b/docs/templates/python/material/docstring.html.jinja @@ -0,0 +1,36 @@ +{% if docstring_sections %} + {{ log.debug("Rendering docstring") }} + {% for section in docstring_sections %} + {% if config.show_docstring_description and section.kind.value == "text" %} + {% if not (config.anta_hide_test_module_description and module == obj) %} + {{ section.value|convert_markdown(heading_level, html_id) }} + {% endif %} + {% elif config.show_docstring_attributes and section.kind.value == "attributes" %} + {% include "docstring/attributes.html" with context %} + {% elif config.show_docstring_functions and section.kind.value == "functions" %} + {% include "docstring/functions.html" with context %} + {% elif config.show_docstring_classes and section.kind.value == "classes" %} + {% include "docstring/classes.html" with context %} + {% elif config.show_docstring_modules and section.kind.value == "modules" %} + {% include "docstring/modules.html" with context %} + {% elif config.show_docstring_parameters and section.kind.value == "parameters" %} + {% include "docstring/parameters.html" with context %} + {% elif config.show_docstring_other_parameters and section.kind.value == "other parameters" %} + {% include "docstring/other_parameters.html" with context %} + {% elif config.show_docstring_raises and section.kind.value == "raises" %} + {% include "docstring/raises.html" with context %} + {% elif config.show_docstring_warns and section.kind.value == "warns" %} + {% include "docstring/warns.html" with context %} + {% elif config.show_docstring_yields and section.kind.value == "yields" %} + {% include "docstring/yields.html" with context %} + {% elif config.show_docstring_receives and section.kind.value == "receives" %} + {% include "docstring/receives.html" with context %} + {% elif config.show_docstring_returns and section.kind.value == "returns" %} + {% include "docstring/returns.html" with context %} + {% elif config.show_docstring_examples and section.kind.value == "examples" %} + {% include "docstring/examples.html" with context %} + {% elif config.show_docstring_description and section.kind.value == "admonition" %} + {% include "docstring/admonition.html" with context %} + {% endif %} + {% endfor %} +{% endif %} -- cgit v1.2.3