This repository was archived by the owner on Jan 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
60 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
span.summarylabel { | ||
background-color: var(--color-foreground-secondary); | ||
color: var(--color-background-secondary); | ||
font-size: 70%; | ||
padding-left: 2px; | ||
padding-right: 2px; | ||
border-radius: 3px; | ||
vertical-align: 15%; | ||
padding-bottom: 2px; | ||
filter: opacity(40%); | ||
} | ||
|
||
table.summarytable { | ||
width: 100%; | ||
} |
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,11 +1,41 @@ | ||
{% macro auto_summary(objs, title='') -%} | ||
{% macro _render_item_name(obj, sig=False) -%} | ||
:py:obj:`{{ obj.name }} <{{ obj.id }}>` | ||
{%- if sig -%} | ||
\ ( | ||
{%- for arg in obj.obj.args -%} | ||
{%- if arg[0] %}{{ arg[0]|replace('*', '\*') }}{% endif -%}{{ arg[1] -}} | ||
{%- if not loop.last %}, {% endif -%} | ||
{%- endfor -%} | ||
){%- endif -%} | ||
{%- endmacro %} | ||
|
||
{% macro _item(obj, sig=False, label='') %} | ||
* - {{ _render_item_name(obj, sig) }} | ||
- {% if label %}:summarylabel:`{{ label }}` {% endif %}{% if obj.summary %}{{ obj.summary }}{% else %}\-{% endif +%} | ||
{% endmacro %} | ||
|
||
{% macro auto_summary(objs, title='') -%} | ||
.. list-table:: {{ title }} | ||
:header-rows: 0 | ||
:widths: auto | ||
:class: summarytable | ||
|
||
{% for obj in objs -%} | ||
{%- set sig = (obj.type in ['method', 'function'] and not 'property' in obj.properties) -%} | ||
|
||
{%- if 'property' in obj.properties -%} | ||
{%- set label = 'prop' -%} | ||
{%- elif 'classmethod' in obj.properties -%} | ||
{%- set label = 'class' -%} | ||
{%- elif 'abstractmethod' in obj.properties -%} | ||
{%- set label = 'abc' -%} | ||
{%- elif 'staticmethod' in obj.properties -%} | ||
{%- set label = 'static' -%} | ||
{%- else -%} | ||
{%- set label = '' -%} | ||
{%- endif -%} | ||
|
||
{{- _item(obj, sig=sig, label=label) -}} | ||
{%- endfor -%} | ||
|
||
{% for obj in objs %} | ||
* - obj.name | ||
- obj.summary | ||
{% endfor %} | ||
{% endmacro %} |
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