[gi-docgen/more-external-links: 2/2] template: Link to ancestors and interfaces in external namespaces




commit 9e17a1ad5ff53ef72bb2dab4e61158fab5eb0049
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Sep 1 12:39:01 2021 +0100

    template: Link to ancestors and interfaces in external namespaces
    
    We want to link to types inherited across namespaces.

 gidocgen/templates/basic/class.html | 54 ++++++++++++++++++++++++++-----------
 1 file changed, 39 insertions(+), 15 deletions(-)
---
diff --git a/gidocgen/templates/basic/class.html b/gidocgen/templates/basic/class.html
index 658a12d..87bc93f 100644
--- a/gidocgen/templates/basic/class.html
+++ b/gidocgen/templates/basic/class.html
@@ -154,7 +154,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           {% if ancestor.namespace == namespace.name %}
           <li class="class"><a href="class.{{ ancestor.name }}.html" title="{{ ancestor.name }}">{{ 
ancestor.type_cname }}</a></li>
           {% else %}
-          <li class="class">{{ ancestor.type_cname }}</li>
+          <li class="class"><a class="external" href="javascript:void(0)" data-link="class.{{ ancestor.name 
}}.html" data-namespace="{{ ancestor.namespace }}">{{ ancestor.type_cname }}</a></li>
           {% endif %}
         {% endfor %}
         </ul>
@@ -175,7 +175,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           {% if iface.namespace == namespace.name %}
           <li class="interface"><a href="iface.{{ iface.name }}.html" title="{{ iface.name }}">{{ 
iface.type_cname }}</a></li>
           {% else %}
-          <li class="interface">{{ iface.type_cname }}</a></li>
+          <li class="interface"><a class="external" href="javascript:void(0)" data-link="iface.{{ iface.name 
}}.html" data-namespace="{{ iface.namespace }}">{{ iface.type_cname }}</a></li>
           {% endif %}
         {% endfor %}
         </ul>
@@ -215,7 +215,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
     </div>
     {% endif %}
 
-    {% if class.methods %}
+    {% if class.show_methods %}
     <div class="toggle-wrapper methods">
       <h4 id="methods">
         Instance methods
@@ -244,11 +244,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       </div>
 
       {% for ancestor in class.ancestors %}
-        {% if ancestor.namespace == namespace.name and ancestor.n_methods > 0 %}
+        {% if ancestor.n_methods > 0 %}
         <div class="{% if ancestor.methods %}toggle-wrapper default-hide{% endif %} 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 -%}
+          <h5 style="display:block;">Methods inherited from <a class="external" href="javascript:void(0)" 
data-link="class.{{ ancestor.name }}.html" data-namespace="{{ ancestor.namespace }}">{{ ancestor.type_cname 
}}</a> ({{ ancestor.n_methods }})</h5>
+          {% endif -%}
 
-          {% if ancestor.methods %}
+          {% if ancestor.namespace == namespace.name %}
           <div class="docblock">
           {% for method in ancestor.methods %}
             <h6><a href="method.{{ ancestor.name }}.{{ method.name }}.html">{{ method.identifier }}</a></h6>
@@ -273,11 +277,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       {% endfor %}
 
       {% for iface in class.interfaces %}
-        {% if iface.namespace == namespace.name and iface.n_methods > 0 %}
+        {% if iface.n_methods > 0 %}
         <div class="{% if iface.methods %}toggle-wrapper default-hide{% endif %} 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 -%}
+          <h5 style="display:block;">Methods inherited from <a class="external" href="javascript:void(0)" 
data-link="iface.{{ iface.name }}.html" data-namespace="{{ iface.namespace }}">{{ iface.type_cname }}</a> ({{ 
iface.n_methods }})</h5>
+          {% endif -%}
 
-          {% if iface.methods %}
+          {% if iface.namespace == namespace.name %}
           <div class="docblock">
           {% for method in iface.methods %}
             <h6><a href="method.{{ iface.name }}.{{ method.name }}.html">{{ method.identifier }}</a></h6>
@@ -336,11 +344,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       {% endif %}
 
       {% for ancestor in class.ancestors %}
-        {% if ancestor.namespace == namespace.name and ancestor.n_properties > 0 %}
+        {% if ancestor.n_properties > 0 %}
         <div class="{% if ancestor.properties %}toggle-wrapper default-hide{% endif %} ancestor-properties">
+          {% if ancestor.namespace == namespace.name %}
           <h5 style="display:block;">Properties inherited from <a href="class.{{ ancestor.name }}.html">{{ 
ancestor.type_cname }}</a> ({{ ancestor.n_properties }})</h5>
+          {% else %}
+          <h5 style="display:block;">Properties inherited from <a class="external" href="javascript:void(0)" 
data-link="class.{{ ancestor.name }}.html" data-namespace="{{ ancestor.namespace }}">{{ ancestor.type_cname 
}}</a> ({{ ancestor.n_properties }})</h5>
+          {% endif %}
 
-          {% if ancestor.properties %}
+          {% if ancestor.namespace == namespace.name %}
           <div class="docblock">
           {% for property in ancestor.properties %}
             <h6><a href="property.{{ ancestor.name }}.{{ property.name }}.html">{{ ancestor.fqtn }}:{{ 
property.name }}</a></h6>
@@ -365,11 +377,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       {% endfor %}
 
       {% for iface in class.interfaces %}
-        {% if iface.namespace == namespace.name and iface.n_properties > 0 %}
+        {% if iface.n_properties > 0 %}
         <div class="{% if iface.properties %}toggle-wrapper default-hide{% endif %} ancestor-properties">
+          {% if iface.namespace == namespace.name %}
           <h5 style="display:block;">Properties inherited from <a href="iface.{{ iface.name }}.html">{{ 
iface.type_cname }}</a> ({{ iface.n_properties }})</h5>
+          {% else %}
+          <h5 style="display:block;">Properties inherited from <a class="external" href="javascript:void(0)" 
data-link="iface.{{ iface.name }}.html" data-namespace="{{ iface.namespace }}">{{ iface.type_cname }}</a> ({{ 
iface.n_properties }})</h5>
+          {% endif %}
 
-          {% if iface.properties %}
+          {% if iface.namespace == namespace.name %}
           <div class="docblock">
           {% for property in iface.properties %}
             <h6><a href="property.{{ iface.name }}.{{ property.name }}.html">{{ iface.fqtn }}:{{ 
property.name }}</a></h6>
@@ -427,11 +443,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       {% endif %}
 
       {% for ancestor in class.ancestors %}
-        {% if ancestor.namespace == namespace.name and ancestor.n_signals > 0 %}
+        {% if ancestor.n_signals > 0 %}
         <div class="{% if ancestor.signals %}toggle-wrapper default-hide{% endif %} ancestor-signals">
+          {% if ancestor.namespace == namespace.name %}
           <h5 style="display:block;">Signals inherited from <a href="class.{{ ancestor.name }}.html">{{ 
ancestor.type_cname }}</a> ({{ ancestor.n_signals }})</h5>
+          {% else %}
+          <h5 style="display:block;">Signals inherited from <a class="external" href="javascript:void(0)" 
data-link="class.{{ ancestor.name }}.html" data-namespace="{{ ancestor.namespace }}">{{ ancestor.type_cname 
}}</a> ({{ ancestor.n_signals }})</h5>
+          {% endif %}
 
-          {% if ancestor.signals %}
+          {% if ancestor.namespace == namespace.name %}
           <div class="docblock">
           {% for signal in ancestor.signals %}
             <h6><a href="signal.{{ ancestor.name }}.{{ signal.name }}.html">{{ ancestor.fqtn }}::{{ 
signal.name }}</a></h6>
@@ -456,11 +476,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
       {% endfor %}
 
       {% for iface in class.interfaces %}
-        {% if iface.namespace == namespace.name and iface.n_signals %}
+        {% if iface.n_signals %}
         <div class="{% if iface.signals %}toggle-wrapper default-hide{% endif %} ancestor-signals">
+          {% if iface.namespace == namespace.name %}
           <h5 style="display:block;">Signals inherited from <a href="iface.{{ iface.name }}.html">{{ 
iface.type_cname }}</a> ({{ iface.n_signals }})</h5>
+          {% else %}
+          <h5 style="display:block;">Signals inherited from <a class="external" href="javascript:void(0)" 
data-link="iface.{{ iface.name }}.html" data-namespace="{{ iface.namespace }}">{{ iface.type_cname }}</a> ({{ 
iface.n_signals }})</h5>
+          {% endif %}
 
-          {% if iface.signals %}
+          {% if iface.namespace == namespace.name %}
           <div class="docblock">
           {% for signal in iface.signals %}
             <h6><a href="signal.{{ iface.name }}.{{ signal.name }}.html">{{ iface.fqtn }}::{{ signal.name 
}}</a></h6>


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