summaryrefslogtreecommitdiffstats
path: root/docs/templates/python/material/class.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/templates/python/material/class.html')
-rw-r--r--docs/templates/python/material/class.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/templates/python/material/class.html b/docs/templates/python/material/class.html
new file mode 100644
index 0000000..940103b
--- /dev/null
+++ b/docs/templates/python/material/class.html
@@ -0,0 +1,35 @@
+{% 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?#}
+ <details class="quote">
+ <summary>Source code in <code>
+ {%- if class.relative_filepath.is_absolute() -%}
+ {{ class.relative_package_filepath }}
+ {%- else -%}
+ {{ class.relative_filepath }}
+ {%- endif -%}
+ </code></summary>
+ {{ class.source|highlight(language="python", linestart=class.lineno, linenums=True) }}
+ </details>
+{% else %}
+ {{ super() }}
+{% endif %}
+{% endblock children %}
+
+{# Do not render source before children for AntaTest #}
+{% block source %}
+{% if not anta_test.found %}
+ {{ super() }}
+{% endif %}
+{% endblock source %}