-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add members and filters options
- Loading branch information
Showing
8 changed files
with
400 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 53 additions & 56 deletions
109
src/mkdocstrings_handlers/python/templates/material/_base/attribute.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,69 @@ | ||
{{ log.debug("Rendering " + attribute.path) }} | ||
{% if config.show_if_no_docstring or attribute.has_docstrings %} | ||
|
||
<div class="doc doc-object doc-attribute"> | ||
{% with html_id = attribute.path %} | ||
<div class="doc doc-object doc-attribute"> | ||
{% with html_id = attribute.path %} | ||
|
||
{% if not root or config.show_root_heading %} | ||
{% if root %} | ||
{% set show_full_path = config.show_root_full_path %} | ||
{% set root_members = True %} | ||
{% elif root_members %} | ||
{% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %} | ||
{% set root_members = False %} | ||
{% else %} | ||
{% set show_full_path = config.show_object_full_path %} | ||
{% endif %} | ||
|
||
{% if root %} | ||
{% set show_full_path = config.show_root_full_path %} | ||
{% set root_members = True %} | ||
{% elif root_members %} | ||
{% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %} | ||
{% set root_members = False %} | ||
{% else %} | ||
{% set show_full_path = config.show_object_full_path %} | ||
{% endif %} | ||
|
||
{% filter heading(heading_level, | ||
role="data" if attribute.parent.kind.value == "module" else "attr", | ||
id=html_id, | ||
class="doc doc-heading", | ||
toc_label=attribute.name) %} | ||
{% if not root or config.show_root_heading %} | ||
|
||
{% if config.separate_signature %} | ||
{% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %} | ||
{% else %} | ||
{% filter highlight(language="python", inline=True) %} | ||
{% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %} | ||
{% if attribute.annotation %}: {{ attribute.annotation }}{% endif %} | ||
{% if attribute.value %} = {{ attribute.value }}{% endif %} | ||
{% endfilter %} | ||
{% endif %} | ||
|
||
{% with labels = attribute.labels %} | ||
{% include "labels.html" with context %} | ||
{% endwith %} | ||
|
||
{% endfilter %} | ||
{% filter heading(heading_level, | ||
role="data" if attribute.parent.kind.value == "module" else "attr", | ||
id=html_id, | ||
class="doc doc-heading", | ||
toc_label=attribute.name) %} | ||
|
||
{% if config.separate_signature %} | ||
{% filter highlight(language="python", inline=False) %} | ||
{% filter format_code(config.line_length) %} | ||
{% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %} | ||
{% if attribute.annotation %}: {{ attribute.annotation|safe }}{% endif %} | ||
{% if attribute.value %} = {{ attribute.value|safe }}{% endif %} | ||
{% endfilter %} | ||
{% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %} | ||
{% else %} | ||
{% filter highlight(language="python", inline=True) %} | ||
{% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %} | ||
{% if attribute.annotation %}: {{ attribute.annotation }}{% endif %} | ||
{% if attribute.value %} = {{ attribute.value }}{% endif %} | ||
{% endfilter %} | ||
{% endif %} | ||
|
||
{% else %} | ||
{% if config.show_root_toc_entry %} | ||
{% filter heading(heading_level, | ||
role="data" if attribute.parent.kind.value == "module" else "attr", | ||
id=html_id, | ||
toc_label=attribute.path if config.show_root_full_path else attribute.name, | ||
hidden=True) %} | ||
{% with labels = attribute.labels %} | ||
{% include "labels.html" with context %} | ||
{% endwith %} | ||
|
||
{% endfilter %} | ||
|
||
{% if config.separate_signature %} | ||
{% filter highlight(language="python", inline=False) %} | ||
{% filter format_code(config.line_length) %} | ||
{% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %} | ||
{% if attribute.annotation %}: {{ attribute.annotation|safe }}{% endif %} | ||
{% if attribute.value %} = {{ attribute.value|safe }}{% endif %} | ||
{% endfilter %} | ||
{% endif %} | ||
{% set heading_level = heading_level - 1 %} | ||
{% endfilter %} | ||
{% endif %} | ||
|
||
<div class="doc doc-contents {% if root %}first{% endif %}"> | ||
{% with docstring_sections = attribute.docstring.parsed %} | ||
{% include "docstring.html" with context %} | ||
{% endwith %} | ||
</div> | ||
{% else %} | ||
{% if config.show_root_toc_entry %} | ||
{% filter heading(heading_level, | ||
role="data" if attribute.parent.kind.value == "module" else "attr", | ||
id=html_id, | ||
toc_label=attribute.path if config.show_root_full_path else attribute.name, | ||
hidden=True) %} | ||
{% endfilter %} | ||
{% endif %} | ||
{% set heading_level = heading_level - 1 %} | ||
{% endif %} | ||
|
||
{% endwith %} | ||
<div class="doc doc-contents {% if root %}first{% endif %}"> | ||
{% with docstring_sections = attribute.docstring.parsed %} | ||
{% include "docstring.html" with context %} | ||
{% endwith %} | ||
</div> | ||
|
||
{% endif %} | ||
{% endwith %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.