Hacky wrapping of long function/method signatures

This could be improved upon.
This commit is contained in:
Jeff Dairiki 2022-02-26 16:53:12 -08:00
parent 188e46d997
commit df446238ed
4 changed files with 29 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,19 +19,31 @@
{%- endmacro %}
{% macro get_doc_link(page) -%}
<a href="{{ page|url }}">{{ page.title }}{%
if page.type == 'function' or page.type == 'method' %}(){% endif %}</a>
<a href="{{ page|url }}">
{{- page.title -}}{% if page.type in ('function', 'method') %}(){% endif -%}
</a>
{%- endmacro %}
{% macro get_doc_header(page) %}
{% if page.type %}
<h1>{% if page.type %}{{ get_doc_icon(page) }} {% endif %}{%
if page.module %}<code class="mod">{{ page.module }}.</code>{% endif
%}<code class="obj">{{ page.title }}</code>{%
if (page.type == 'method' or page.type == 'function' or page.type == 'filter'
or page.type == 'event') or page.signature
%} <span class="sig">(<code>{{ page.signature }}</code>)</span>{% endif %}</h1>
<h1>
{%- if page.type %}{{ get_doc_icon(page) }} {% endif %}
{%- if page.module %}<code class="mod">{{ page.module }}.</code>{% endif -%}
<code class="obj">{{ page.title }}</code>
{%- if page.signature or page.type in ('method', 'function', 'filter', 'event') %}
<span class="sig">({{ format_signature(page.signature) }})</span>
{%- endif -%}
</h1>
{% else %}
<h1>{{ page.title }}</h1>
{% endif %}
{% endmacro %}
{% macro format_signature(signature) -%}
{% if signature|trim -%}
{% set sep = joiner(" ") -%}
{% for param in signature.split(',')|map('trim') -%}
{{ sep() }}<code>{{ param }}{% if not loop.last %},{% endif %}</code>
{%- endfor -%}
{% endif -%}
{% endmacro %}

View File

@ -221,6 +221,13 @@ div.blog-snippet {
div.doc-styling, div.blog-post, div.plugin {
line-height: 1.75;
h1 {
text-indent: -2em;
padding-left: 2em;
.glyphicon {
text-indent: 0;
}
}
a.ref {
font-style: italic;
}