-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed 85f19df with MkDocs version: 1.6.1
- Loading branch information
Testing Git
committed
Dec 15, 2024
1 parent
6022519
commit 1baae3a
Showing
33 changed files
with
413 additions
and
59 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
mkdocstrings/python/material/docstring/attributes.html.jinja
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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{{ log.debug("Rendering attributes section") }} | ||
|
||
{% import "language.html" as lang with context %} | ||
|
||
{% if config.docstring_section_style == "table" %} | ||
{% block table_style scoped %} | ||
<p><strong>{{ section.title or lang.t("Attributes:") }}</strong></p> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>{{ lang.t("Name") }}</th> | ||
<th>{{ lang.t("Type") }}</th> | ||
<th>{{ lang.t("Description") }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for attribute in section.value %} | ||
<tr> | ||
<td><code><span data-autorefs-optional-hover="{{ obj.path }}.{{ attribute.name }}">{{ attribute.name }}</span></code></td> | ||
<td> | ||
{% if attribute.annotation %} | ||
{% with expression = attribute.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
<div class="doc-md-description"> | ||
{{ attribute.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endblock table_style %} | ||
{% elif config.docstring_section_style == "list" %} | ||
{% block list_style scoped %} | ||
<p>{{ section.title or lang.t("Attributes:") }}</p> | ||
<ul> | ||
{% for attribute in section.value %} | ||
<li class="field-body"> | ||
<b><code><span data-autorefs-optional-hover="{{ obj.path }}.{{ attribute.name }}">{{ attribute.name }}</span></code></b> | ||
{% if attribute.annotation %} | ||
{% with expression = attribute.annotation %} | ||
(<code>{% include "expression.html" with context %}</code>) | ||
{% endwith %} | ||
{% endif %} | ||
– | ||
<div class="doc-md-description"> | ||
{{ attribute.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock list_style %} | ||
{% elif config.docstring_section_style == "spacy" %} | ||
{% block spacy_style scoped %} | ||
<table> | ||
<thead> | ||
<tr> | ||
<th><b>{{ (section.title or lang.t("ATTRIBUTE")).rstrip(":").upper() }}</b></th> | ||
<th><b>{{ lang.t("DESCRIPTION") }}</b></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for attribute in section.value %} | ||
<tr> | ||
<td><code><span data-autorefs-optional-hover="{{ obj.path }}.{{ attribute.name }}">{{ attribute.name }}</span></code></td> | ||
<td class="doc-attribute-details"> | ||
<div class="doc-md-description"> | ||
{{ attribute.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
<p> | ||
{% if attribute.annotation %} | ||
<span class="doc-attribute-annotation"> | ||
<b>TYPE:</b> | ||
{% with expression = attribute.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
</span> | ||
{% endif %} | ||
</p> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endblock spacy_style %} | ||
{% endif %} |
98 changes: 98 additions & 0 deletions
98
mkdocstrings/python/material/docstring/parameters.html.jinja
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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{{ log.debug("Rendering parameters section") }} | ||
|
||
{% import "language.html" as lang with context %} | ||
|
||
{% if config.docstring_section_style == "table" %} | ||
{% block table_style scoped %} | ||
<p><strong>{{ section.title or lang.t("Parameters:") }}</strong></p> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>{{ lang.t("Name") }}</th> | ||
<th>{{ lang.t("Type") }}</th> | ||
<th>{{ lang.t("Description") }}</th> | ||
<th>{{ lang.t("Default") }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for parameter in section.value %} | ||
<tr> | ||
<td><code>{{ parameter.name }}</code></td> | ||
<td> | ||
{% if parameter.annotation %} | ||
{% with expression = parameter.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
<div class="doc-md-description"> | ||
{{ parameter.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</td> | ||
<td> | ||
{% if parameter.default %} | ||
{% with expression = parameter.default %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
{% else %} | ||
<em>{{ lang.t("required") }}</em> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endblock table_style %} | ||
{% elif config.docstring_section_style == "list" %} | ||
{% block list_style scoped %} | ||
<p class="doc-section-head">{{ section.title or lang.t("Parameters:") }}</p> | ||
<ul> | ||
{% for parameter in section.value %} | ||
<li class="field-body"> | ||
<b><code>{{ parameter.name }}</code></b> | ||
{% if parameter.annotation %} | ||
{% with expression = parameter.annotation %} | ||
(<code>{% include "expression.html" with context %}</code> | ||
{%- if parameter.default %}, {{ lang.t("default:") }} | ||
{% with expression = parameter.default %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
{% endif %}) | ||
{% endwith %} | ||
{% endif %} | ||
– | ||
<div class="doc-md-description"> | ||
{{ parameter.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock list_style %} | ||
{% elif config.docstring_section_style == "spacy" %} | ||
{% block spacy_style scoped %} | ||
<p class="doc-section-head">{{ section.title or lang.t("Parameters:") }}</p> | ||
<dl class="doc-field-list"> | ||
{% for parameter in section.value %} | ||
<dt class="doc-field-term"><code>{{ parameter.name }}</code></dt> | ||
<dd class="doc-field-def"> | ||
<div class="doc-md-description"> | ||
{{ parameter.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
{% if parameter.annotation %}<p class="doc-param-annotation"> | ||
<span class="doc-param-key">{{ lang.t("TYPE:") }}</span> | ||
{% with expression = parameter.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
</p>{% endif %} | ||
{% if parameter.default %}<p class="doc-param-default"> | ||
<span class="doc-param-key">{{ lang.t("DEFAULT:") }}</span> | ||
{% with expression = parameter.default %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
</p>{% endif %} | ||
</dd> | ||
{% endfor %} | ||
</dl> | ||
{% endblock spacy_style %} | ||
{% endif %} |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{{ log.debug("Rendering raises section") }} | ||
|
||
{% import "language.html" as lang with context %} | ||
|
||
{% if config.docstring_section_style == "table" %} | ||
{% block table_style scoped %} | ||
<p><strong>{{ section.title or lang.t("Raises:") }}</strong></p> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>{{ lang.t("Type") }}</th> | ||
<th>{{ lang.t("Description") }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for raises in section.value %} | ||
<tr> | ||
<td> | ||
{% if raises.annotation %} | ||
{% with expression = raises.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
<div class="doc-md-description"> | ||
{{ raises.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endblock table_style %} | ||
{% elif config.docstring_section_style == "list" %} | ||
{% block list_style scoped %} | ||
<p>{{ lang.t(section.title) or lang.t("Raises:") }}</p> | ||
<ul> | ||
{% for raises in section.value %} | ||
<li class="field-body"> | ||
{% if raises.annotation %} | ||
{% with expression = raises.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
– | ||
{% endif %} | ||
<div class="doc-md-description"> | ||
{{ raises.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock list_style %} | ||
{% elif config.docstring_section_style == "spacy" %} | ||
{% block spacy_style scoped %} | ||
<p class="doc-section-head">{{ (section.title or lang.t("Raises:")) }}</p> | ||
<dl class="doc-field-list"> | ||
{% for raises in section.value %} | ||
<dt class="doc-field-term doc-raises-annotation"> | ||
{% with expression = raises.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
</dt> | ||
<dd class="doc-field-def doc-raises-details"> | ||
<div class="doc-md-description"> | ||
{{ raises.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</dd> | ||
{% endfor %} | ||
</dl> | ||
{% endblock spacy_style %} | ||
{% endif %} |
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{{ log.debug("Rendering returns section") }} | ||
|
||
{% import "language.html" as lang with context %} | ||
|
||
{% if config.docstring_section_style == "table" %} | ||
{% block table_style scoped %} | ||
{% set name_column = section.value|selectattr("name")|any %} | ||
<p><strong>{{ section.title or lang.t("Returns:") }}</strong></p> | ||
<table> | ||
<thead> | ||
<tr> | ||
{% if name_column %}<th>{{ lang.t("Name") }}</th>{% endif %} | ||
<th>{{ lang.t("Type") }}</th> | ||
<th>{{ lang.t("Description") }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for returns in section.value %} | ||
<tr> | ||
{% if name_column %}<td>{% if returns.name %}<code>{{ returns.name }}</code>{% endif %}</td>{% endif %} | ||
<td> | ||
{% if returns.annotation %} | ||
{% with expression = returns.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
<div class="doc-md-description"> | ||
{{ returns.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endblock table_style %} | ||
{% elif config.docstring_section_style == "list" %} | ||
{% block list_style scoped %} | ||
<p>{{ section.title or lang.t("Returns:") }}</p> | ||
<ul> | ||
{% for returns in section.value %} | ||
<li class="field-body"> | ||
{% if returns.name %}<b><code>{{ returns.name }}</code></b>{% endif %} | ||
{% if returns.annotation %} | ||
{% with expression = returns.annotation %} | ||
{% if returns.name %} ({% endif %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% if returns.name %}){% endif %} | ||
{% endwith %} | ||
{% endif %} | ||
– | ||
<div class="doc-md-description"> | ||
{{ returns.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock list_style %} | ||
{% elif config.docstring_section_style == "spacy" %} | ||
{% block spacy_style scoped %} | ||
<p class="doc-section-head">{{ (section.title or lang.t("Returns:")) }}</p> | ||
<dl class="doc-field-list"> | ||
{% for returns in section.value %} | ||
<dt class="doc-field-term"> | ||
{% if returns.name %} | ||
<code>{{ returns.name }}</code> | ||
{% elif returns.annotation %} | ||
<span class="doc-returns-annotation"> | ||
{% with expression = returns.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
</span> | ||
{% endif %} | ||
</dt> | ||
<dd class="doc-field-def doc-returns-details"> | ||
<div class="doc-md-description"> | ||
{{ returns.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
{% if returns.name and returns.annotation %} | ||
<p> | ||
<span class="doc-returns-annotation"> | ||
<span class="doc-param-key">{{ lang.t("TYPE:") }}</span> | ||
{% with expression = returns.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
</span> | ||
</p> | ||
{% endif %} | ||
</dd> | ||
{% endfor %} | ||
</dl> | ||
{% endblock spacy_style %} | ||
{% endif %} |
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
Oops, something went wrong.