[gi-docgen/derived-implements: 2/5] generate: List the interface implementations
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gi-docgen/derived-implements: 2/5] generate: List the interface implementations
- Date: Mon, 18 Oct 2021 12:18:39 +0000 (UTC)
commit 9be7bfe9d2fbd02d58675612b785576e133a9b42
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Oct 18 00:14:48 2021 +0100
generate: List the interface implementations
The interface page should list the implementations available in a class.
The list can be arbitrarily long, so let's collapse the section by
default.
Fixes: #104
gidocgen/gdgenerate.py | 8 ++++++++
gidocgen/templates/basic/interface.html | 13 +++++++++++++
2 files changed, 21 insertions(+)
---
diff --git a/gidocgen/gdgenerate.py b/gidocgen/gdgenerate.py
index a4f0a6e..2db23ad 100644
--- a/gidocgen/gdgenerate.py
+++ b/gidocgen/gdgenerate.py
@@ -1227,6 +1227,14 @@ class TemplateInterface:
if not config.is_hidden(interface.name, "function", func.name):
self.type_funcs.append(gen_index_func(func, namespace, md))
+ if len(interface.implementations) != 0:
+ self.implementations = []
+ for impl in interface.implementations:
+ self.implementations.append({
+ 'name': impl.name,
+ 'ctype': impl.ctype,
+ })
+
@property
def c_decl(self):
return f"interface {self.fqtn} : {self.requires_fqtn}"
diff --git a/gidocgen/templates/basic/interface.html b/gidocgen/templates/basic/interface.html
index 1039039..d895306 100644
--- a/gidocgen/templates/basic/interface.html
+++ b/gidocgen/templates/basic/interface.html
@@ -135,6 +135,19 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
</div>
</div>
+ {% if interface.implementations %}
+ <div class="implementations toggle-wrapper default-hide">
+ <h4 id="implementations">Implementations<a href="#implementations" class="anchor"></a></h4>
+ <div class="docblock">
+ <ul>
+ {%- for impl in interface.implementations %}
+ <li><a href="iface.{{ impl.name }}.html">{{ impl.ctype }}</a></li>
+ {% endfor -%}
+ </ul>
+ </div>
+ </div>
+ {% endif %}
+
{% if interface.type_funcs %}
<div class="methods toggle-wrapper">
<h4 id="type-functions">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]