You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2024/01/13 11:51:33 UTC

(groovy) branch master updated: Added inherited properties summary to properties section

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 0b46fdd1b3 Added inherited properties summary to properties section
0b46fdd1b3 is described below

commit 0b46fdd1b30e5b6f670e8b434964cc4aa1c72d19
Author: مصطفي محمود كمال الدين <48...@users.noreply.github.com>
AuthorDate: Fri Jan 5 17:36:59 2024 +0200

    Added inherited properties summary to properties section
---
 .../gstringTemplates/classLevel/classDocName.html  | 37 ++++++++++++++++++++--
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/subprojects/groovy-groovydoc/src/main/resources/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html b/subprojects/groovy-groovydoc/src/main/resources/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html
index 6bb6aeb430..3656785663 100644
--- a/subprojects/groovy-groovydoc/src/main/resources/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html
+++ b/subprojects/groovy-groovydoc/src/main/resources/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html
@@ -310,6 +310,7 @@ if (classDoc.isInterface() && classDoc.interfaces()) {
         <!-- =========== FIELD SUMMARY =========== -->
         <%
         def buffer = new StringBuilder()
+        def propBuffer = new StringBuilder()
         classes = []
         if (classDoc.isInterface()) {
             classes.addAll(classDoc.interfaces().toList())
@@ -341,6 +342,19 @@ if (classDoc.isInterface() && classDoc.interfaces()) {
                             <td class="colFirst"><strong><code>${c.typeSourceDescription} ${linkable(c)}</code></strong></td>
                             <td class="colLast"><code>${list.join(', ')}</code></td>
                         </tr>
+"""
+                }
+
+                list = []
+                list = c.properties().collect { prop ->
+                        "<a href='${classDoc.relativeRootPath}${c.fullPathName}.html#${prop.name()}'>${prop.name()}</a>"
+                        prop.name()
+                }
+                if (list) {
+                    propBuffer << """                        <tr class="${i%2==0?'altColor':'rowColor'}">
+                                <td class="colFirst"><strong><code>${c.typeSourceDescription} ${linkable(c)}</code></strong></td>
+                                <td class="colLast"><code>${list.join(', ')}</code></td>
+                            </tr>
 """
                 }
             }
@@ -390,8 +404,9 @@ if (classDoc.isInterface() && classDoc.interfaces()) {
         <% } // if hasFields or buffer %>
 
         <!-- =========== PROPERTY SUMMARY =========== -->
-        <% if (hasProperties) { %>
-         <ul class="blockList">
+        <% if (hasProperties || propBuffer.length()>0) { %>
+         <ul class="blockList"> <%
+                if (hasProperties) { %>
                 <li class="blockList"><a name="property_summary"><!--   --></a>
                     <h3>Properties Summary</h3>
                     <ul class="blockList">
@@ -410,8 +425,24 @@ if (classDoc.isInterface() && classDoc.interfaces()) {
                     </table>
                    </ul>
                 </li>
+                <% } // if hasProperties
+
+                 if (propBuffer.length()>0) { %>
+                 <li class="blockList"><a name="properties_summary"><!--   --></a>
+                     <ul class="blockList">
+                         <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Inherited properties summary table">
+                             <caption><span>Inherited properties</span><span class="tabEnd">&nbsp;</span></caption>
+                             <tr>
+                                 <th class="colFirst" scope="col">Properties inherited from class</th>
+                                 <th class="colLast" scope="col">Properties</th>
+                             </tr>
+                             ${propBuffer}
+                         </table>
+                     </ul>
+                 </li>
+                 <% } // if propBuffer %>
             </ul>
-        <% } %>
+        <% } // if hasProperties or propBuffer %>
 
         <!-- =========== ELEMENT SUMMARY =========== -->
         <% if (hasElements) { %>