[gi-docgen/ebassi/iface-docs: 1/2] generate: Add interface type description




commit a8dce98e47278cea7a6d177956ff658157da8126
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Apr 2 00:53:51 2022 +0100

    generate: Add interface type description
    
    We're missing the documentation for the interface structure.

 gidocgen/gdgenerate.py                  | 8 +++++---
 gidocgen/templates/basic/interface.html | 4 ++++
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gidocgen/gdgenerate.py b/gidocgen/gdgenerate.py
index d90be33..adbdc18 100644
--- a/gidocgen/gdgenerate.py
+++ b/gidocgen/gdgenerate.py
@@ -1279,13 +1279,15 @@ class TemplateInterface:
 
         self.class_struct = namespace.find_record(interface.type_struct)
         if self.class_struct is not None:
+            if self.class_struct.doc:
+                self.class_description = utils.preprocess_docs(self.class_struct.doc.content, namespace, 
md=md)
+            else:
+                self.class_description = MISSING_DESCRIPTION
             self.class_fields = []
-            self.class_methods = []
-
             for field in self.class_struct.fields:
                 if not field.private:
                     self.class_fields.append(TemplateField(namespace, field))
-
+            self.class_methods = []
             for method in self.class_struct.methods:
                 self.class_methods.append(gen_index_func(method, namespace, md))
 
diff --git a/gidocgen/templates/basic/interface.html b/gidocgen/templates/basic/interface.html
index 4f64e51..4b26c64 100644
--- a/gidocgen/templates/basic/interface.html
+++ b/gidocgen/templates/basic/interface.html
@@ -306,6 +306,10 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 }</code></pre>
       </div>
 
+      <div class="docblock">
+        {{ interface.class_description }}
+      </div>
+
       {% if interface.class_fields %}
       <div class="docblock">
         <h6>Interface members</h6>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]