Hacky wrapping of long function/method signatures
This could be improved upon.
This commit is contained in:
parent
188e46d997
commit
df446238ed
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -19,19 +19,31 @@
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
{% macro get_doc_link(page) -%}
|
{% macro get_doc_link(page) -%}
|
||||||
<a href="{{ page|url }}">{{ page.title }}{%
|
<a href="{{ page|url }}">
|
||||||
if page.type == 'function' or page.type == 'method' %}(){% endif %}</a>
|
{{- page.title -}}{% if page.type in ('function', 'method') %}(){% endif -%}
|
||||||
|
</a>
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
{% macro get_doc_header(page) %}
|
{% macro get_doc_header(page) %}
|
||||||
{% if page.type %}
|
{% if page.type %}
|
||||||
<h1>{% if page.type %}{{ get_doc_icon(page) }} {% endif %}{%
|
<h1>
|
||||||
if page.module %}<code class="mod">{{ page.module }}.</code>{% endif
|
{%- if page.type %}{{ get_doc_icon(page) }} {% endif %}
|
||||||
%}<code class="obj">{{ page.title }}</code>{%
|
{%- if page.module %}<code class="mod">{{ page.module }}.</code>{% endif -%}
|
||||||
if (page.type == 'method' or page.type == 'function' or page.type == 'filter'
|
<code class="obj">{{ page.title }}</code>
|
||||||
or page.type == 'event') or page.signature
|
{%- if page.signature or page.type in ('method', 'function', 'filter', 'event') %}
|
||||||
%} <span class="sig">(<code>{{ page.signature }}</code>)</span>{% endif %}</h1>
|
<span class="sig">({{ format_signature(page.signature) }})</span>
|
||||||
|
{%- endif -%}
|
||||||
|
</h1>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h1>{{ page.title }}</h1>
|
<h1>{{ page.title }}</h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% 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 %}
|
||||||
|
|
|
@ -221,6 +221,13 @@ div.blog-snippet {
|
||||||
div.doc-styling, div.blog-post, div.plugin {
|
div.doc-styling, div.blog-post, div.plugin {
|
||||||
line-height: 1.75;
|
line-height: 1.75;
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
text-indent: -2em;
|
||||||
|
padding-left: 2em;
|
||||||
|
.glyphicon {
|
||||||
|
text-indent: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
a.ref {
|
a.ref {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue