[gi-docgen/excessive-methods] template: Add blurb when eliding inherited methods
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gi-docgen/excessive-methods] template: Add blurb when eliding inherited methods
- Date: Fri, 12 Nov 2021 18:41:33 +0000 (UTC)
commit 9fbed91d12f55df23d8b6017c9cfae8ba8c81d6f
Author: Emmanuele Bassi <ebassi gnome org>
Date: Fri Nov 12 18:34:41 2021 +0000
template: Add blurb when eliding inherited methods
Makes it easier to understand that you're supposed to go and look at the
ancestor or interface page.
Fixes: #112
gidocgen/templates/basic/class.html | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/gidocgen/templates/basic/class.html b/gidocgen/templates/basic/class.html
index 435f6e0..792dcf6 100644
--- a/gidocgen/templates/basic/class.html
+++ b/gidocgen/templates/basic/class.html
@@ -290,7 +290,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
{% for ancestor in class.ancestors %}
{% if ancestor.n_methods > 0 %}
- <div class="{% if ancestor.methods %}toggle-wrapper default-hide{% endif %} ancestor-methods">
+ <div class="toggle-wrapper default-hide ancestor-methods">
{%- if ancestor.namespace == namespace.name %}
<h5 style="display:block;">Methods inherited from <a href="class.{{ ancestor.name }}.html">{{
ancestor.type_cname }}</a> ({{ ancestor.n_methods }})</h5>
{%- else -%}
@@ -317,6 +317,16 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
{%- endif -%}
</div>
{%- endif %}
+ {% else %}
+ <div class="docblock">
+ <p><em>Too many methods. Please see
+ {%- if ancestor.namespace == namespace.name -%}
+ <a href="class.{{ancestor.name}}.html#methods">{{ ancestor.type_cname }}</a>
+ {%- else -%}
+ <a class="external" href="javascript:void(0)" data-link="class.{{ ancestor.name
}}.html#methods" data-namespace="{{ ancestor.namespace }}">{{ ancestor.type_cname }}</a>
+ {%- endif -%}
+ for a full list.</em></p>
+ </div>
{% endfor %}
</div>
</div>
@@ -325,7 +335,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
{% for iface in class.interfaces %}
{% if iface.n_methods > 0 %}
- <div class="{% if iface.methods %}toggle-wrapper default-hide{% endif %} ancestor-methods">
+ <div class="toggle-wrapper default-hide ancestor-methods">
{%- if iface.namespace == namespace.name %}
<h5 style="display:block;">Methods inherited from <a href="iface.{{ iface.name }}.html">{{
iface.type_cname }}</a> ({{ iface.n_methods }})</h5>
{%- else -%}
@@ -352,6 +362,16 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
{%- endif -%}
</div>
{%- endif %}
+ {% else %}
+ <div class="docblock">
+ <p><em>Too many methods. Please see
+ {%- if iface.namespace == namespace.name -%}
+ <a href="iface.{{iface.name}}.html#methods">{{ iface.type_cname }}</a>
+ {%- else -%}
+ <a class="external" href="javascript:void(0)" data-link="iface.{{ iface.name }}.html#methods"
data-namespace="{{ iface.namespace }}">{{ iface.type_cname }}</a>
+ {%- endif -%}
+ for a full list.</em></p>
+ </div>
{% endfor %}
</div>
</div>
@@ -670,7 +690,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
{% endfor %}
</div>
</div>
- {% endif %}
+ {% endif %}
</section>
</section>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]