mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
api docs (#2240)
* api docs * more docstrings * logs * docs shakeup * fix notes, added intro to all apis * Remove defaults to * add note to events * note * use fira code
This commit is contained in:
15
docs/_templates/python/material/_base/class.html
vendored
15
docs/_templates/python/material/_base/class.html
vendored
@@ -13,7 +13,9 @@
|
||||
{% set show_full_path = config.show_object_full_path %}
|
||||
{% endif %}
|
||||
|
||||
{% if not root or config.show_root_heading %}
|
||||
|
||||
|
||||
{% if 1 %}
|
||||
|
||||
{% filter heading(heading_level,
|
||||
role="class",
|
||||
@@ -34,7 +36,7 @@
|
||||
<code>{% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}</code>
|
||||
{% endif %}
|
||||
|
||||
{% with labels = class.labels %}
|
||||
{% with labels = ['class'] %}
|
||||
{% include "labels.html" with context %}
|
||||
{% endwith %}
|
||||
|
||||
@@ -43,11 +45,10 @@
|
||||
{% if config.separate_signature and config.merge_init_into_class %}
|
||||
{% if "__init__" in class.members %}
|
||||
{% with function = class.members["__init__"] %}
|
||||
{% filter highlight(language="python", inline=False) %}
|
||||
class {% filter format_signature(config.line_length) %}
|
||||
{% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}
|
||||
{% include "signature.html" with context %}
|
||||
{% endfilter %}
|
||||
{% filter highlight(language="python", inline=False) -%}
|
||||
def {% filter format_signature(config.line_length) %}
|
||||
__init__{% include "signature.html" with context %}
|
||||
{% endfilter %}:
|
||||
{% endfilter %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
5
docs/_templates/python/material/_base/docstring/admonition.html
vendored
Normal file
5
docs/_templates/python/material/_base/docstring/admonition.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ log.debug("Rendering admonition") }}
|
||||
<details class="{{ section.value.kind }}" open>
|
||||
<summary>{{ section.title|convert_markdown(heading_level, html_id, strip_paragraph=True) }}</summary>
|
||||
{{ section.value.contents|convert_markdown(heading_level, html_id) }}
|
||||
</details>
|
||||
@@ -29,8 +29,7 @@
|
||||
{% include "signature.html" with context %}
|
||||
{% endfilter %}
|
||||
{% endif %}
|
||||
|
||||
{% with labels = function.labels %}
|
||||
{% with labels = function.labels or [(function.parameters._parameters_list and function.parameters._parameters_list[0].name == 'self') and 'method' or 'function'] %}
|
||||
{% include "labels.html" with context %}
|
||||
{% endwith %}
|
||||
|
||||
@@ -41,7 +40,7 @@
|
||||
def {% filter format_signature(config.line_length) %}
|
||||
{% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}
|
||||
{% include "signature.html" with context %}
|
||||
{% endfilter %}
|
||||
{% endfilter %}:
|
||||
{% endfilter %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
|
||||
(
|
||||
{%- for parameter in function.parameters -%}
|
||||
{%- if parameter.name not in ("self", "cls") or loop.index0 > 0 or not (function.parent and function.parent.is_class) -%}
|
||||
{%- if 1 -%}
|
||||
|
||||
{%- if parameter.kind.value == "positional-only" -%}
|
||||
{%- set ns.has_pos_only = True -%}
|
||||
{%- else -%}
|
||||
{%- if ns.has_pos_only and ns.render_pos_only_separator -%}
|
||||
{%- set ns.render_pos_only_separator = False %}/, {% endif -%}
|
||||
{%- if parameter.kind.value == "keyword-only" -%}
|
||||
{%- if parameter.kind.value == "keyword-only" -%}
|
||||
{%- if ns.render_kw_only_separator -%}
|
||||
{%- set ns.render_kw_only_separator = False %}*, {% endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
Reference in New Issue
Block a user