Skip to content

Commit 71ca3e0

Browse files
committed
minor refactor: improve consistent ordering in groovydoc templates
1 parent 9f08bc2 commit 71ca3e0

File tree

2 files changed

+7
-4
lines changed
  • subprojects
    • groovy-docgenerator/src/main/resources/org/apache/groovy/docgenerator
    • groovy-groovydoc/src/main/resources/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel

2 files changed

+7
-4
lines changed

subprojects/groovy-docgenerator/src/main/resources/org/apache/groovy/docgenerator/template.class.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,16 @@ <h3>Methods Summary</h3>
9191
</tbody>
9292
</table>
9393
</li>
94-
<% docType.inheritedMethods.each { inhDocType, inhDocMethods -> %>
94+
<%
95+
docType.inheritedMethods.each { inhDocType, inhDocMethods ->
96+
inhDocTypeName = inhDocType.fullyQualifiedClassName.replace('.', '/')
97+
%>
9598
<ul class="blockList">
9699
<li class="blockList">
97100
<h4>Methods inherited from ${inhDocType.interface ? 'interface' : 'class'} ${inhDocType.packageName}.${docType.linkAnchor(inhDocType)}</h4>
98101
<p>
99-
<%= inhDocMethods.findAll { !it.static }.collect { docMethod ->
100-
"""<code><strong><a href="${pathPref}${inhDocType.fullyQualifiedClassName.replace('.', '/')}.html#${docMethod.name}(${docMethod.parametersSignature})">${docMethod.name}</a></strong></code>"""
102+
<%= inhDocMethods.findAll { !it.static }.collect { docMethod -> [docMethod.name + "(" + docMethod.parametersSignature + ")", docMethod.name] }.sort{ it[0] }.collect { sig, name ->
103+
"""<code><strong><a href="${pathPref}${inhDocTypeName}.html#$sig">$name</a></strong></code>"""
101104
}.join(", ") %>
102105
</p>
103106
</li>

subprojects/groovy-groovydoc/src/main/resources/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ <h3>Constructor Summary</h3>
527527
buffer << """
528528
<tr class="${i%2==0?'altColor':'rowColor'}">
529529
<td class="colFirst"><code>${c.typeSourceDescription} ${linkable(c)}</code></td>
530-
<td class="colLast"><code>${list.join(', ')}</code></td>
530+
<td class="colLast"><code>${list.sort().join(', ')}</code></td>
531531
</tr>"""
532532
}
533533
}

0 commit comments

Comments
 (0)