From c5b233aca9c81792b6313dc45dd5055cbb24901a Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Tue, 14 Jul 2020 19:17:49 +0200 Subject: Fix table rendering with JDK12 stylesheets --- .../src/main/kotlin/javadoc/JavadocPageCreator.kt | 2 +- .../javadoc/src/main/resources/views/class.korte | 157 +++++++++++---------- .../resources/views/components/indexTable.korte | 10 +- .../javadoc/JavadocPackageTemplateMapTest.kt | 4 +- 4 files changed, 94 insertions(+), 79 deletions(-) (limited to 'plugins/javadoc/src') diff --git a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt b/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt index 52a8a50b..6fe18001 100644 --- a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt +++ b/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt @@ -116,7 +116,7 @@ open class JavadocPageCreator( } private val KClass.tabTitle: String - get() = colTitle + if(colTitle.last() != 's') "s" else "es" + get() = "$colTitle Summary" private fun contentForClasslike(c: DClasslike): JavadocContentNode = JavadocContentGroup( diff --git a/plugins/javadoc/src/main/resources/views/class.korte b/plugins/javadoc/src/main/resources/views/class.korte index a909bf3c..adf719af 100644 --- a/plugins/javadoc/src/main/resources/views/class.korte +++ b/plugins/javadoc/src/main/resources/views/class.korte @@ -52,22 +52,24 @@

Nested Class Summary

- - - - - - - - {% for classlike in classlikes %} - - - - - - {% endfor %} -
Nested Classes 
Modifier and TypeClassDescription
{{ classlike.modifiers }}{{ classlike.signature }} - {{ classlike.description }}
+
+ + + + + + + + {% for classlike in classlikes %} + + + + + + {% endfor %} +
Nested Classes 
Modifier and TypeClassDescription
{{ classlike.modifiers }}{{ classlike.signature }} + {{ classlike.description }}
+
@@ -80,21 +82,23 @@

Field Summary

- - - - - - - - {% for property in properties %} - - - - - - {% endfor %} -
Fields 
Modifier and TypeFieldDescription
{{ property.modifiers|raw }}{{ property.signature|raw }}{{ description|raw }}
+
+ + + + + + + + {% for property in properties %} + + + + + + {% endfor %} +
Fields 
Modifier and TypeFieldDescription
{{ property.modifiers|raw }}{{ property.signature|raw }}{{ description|raw }}
+
@@ -107,24 +111,26 @@

Constructor Summary

- - - - - - - - - {% for constructor in constructors %} - - - +
+
Constructors 
ConstructorDescription
{{ constructor.name }}({{ constructor.inlineParameters|raw }}){{ constructor.brief|raw }}
+ + + + + - {% endfor %} - -
Constructors 
ConstructorDescription
+ {% for constructor in constructors %} + + {{ constructor.name }}({{ constructor.inlineParameters|raw }}) + {{ constructor.brief|raw }} + + {% endfor %} + + + + @@ -163,29 +169,30 @@

Method Summary

- - - - - - - - - {% for method in methods.own %} - - - - - - {% endfor %} - -
All Methods Static Methods Concrete Methods 
Modifier and TypeMethodDescription
{{ method.signature.modifiers|raw }} - {{ method.signature.signatureWithoutModifiers|raw }} - {{ method.brief|raw }}
+
+
+ + +
+
+ + + + + + + {% for method in methods.own %} + + + + + + {% endfor %} + +
Modifier and TypeMethodDescription
{{ method.signature.modifiers|raw }} + {{ method.signature.signatureWithoutModifiers|raw }} + {{ method.brief|raw }}
+
    {% for method in methods.inherited %}
  • @@ -252,8 +259,14 @@

    Method Detail

    {% for method in methods.own %} - -
      + + + +
      • {{ method.name }}

        {{ method.signature.annotations|raw }} {{ method.signature.modifiers|raw }} {{ method.signature.signatureWithoutModifiers|raw}}
        diff --git a/plugins/javadoc/src/main/resources/views/components/indexTable.korte b/plugins/javadoc/src/main/resources/views/components/indexTable.korte index e1b507b9..21c94b7c 100644 --- a/plugins/javadoc/src/main/resources/views/components/indexTable.korte +++ b/plugins/javadoc/src/main/resources/views/components/indexTable.korte @@ -1,8 +1,7 @@ {% if isTypeSummary %} - -{% else %} -
        +
        {% endif %} +
        @@ -13,4 +12,7 @@ {{ createTabRow(item, contextRoot)|raw }} {% end -%} -
        {{ tabTitle }} 
        {{ colTitle }}
        \ No newline at end of file + +{% if isTypeSummary %} +
+{% endif %} \ No newline at end of file diff --git a/plugins/javadoc/src/test/kotlin/javadoc/JavadocPackageTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/javadoc/JavadocPackageTemplateMapTest.kt index a1b99ba0..e0ef030e 100644 --- a/plugins/javadoc/src/test/kotlin/javadoc/JavadocPackageTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/javadoc/JavadocPackageTemplateMapTest.kt @@ -28,7 +28,7 @@ internal class JavadocPackageTemplateMapTest : AbstractJavadocTemplateMapTest() """ ) { val map = singlePageOfType().templateMap - assertEquals("Classes", ((map["lists"] as List<*>).first() as Map)["tabTitle"]) + assertEquals("Class Summary", ((map["lists"] as List<*>).first() as Map)["tabTitle"]) assertEquals("Class", ((map["lists"] as List<*>).first() as Map)["colTitle"]) assertEquals("com.test.package0", map["title"]) assertEquals("", map["subtitle"]) @@ -69,7 +69,7 @@ internal class JavadocPackageTemplateMapTest : AbstractJavadocTemplateMapTest() val packagePages = allPagesOfType() packagePages.forEach { page -> val map = page.templateMap - assertEquals("Classes", ((map["lists"] as List<*>).first() as Map)["tabTitle"]) + assertEquals("Class Summary", ((map["lists"] as List<*>).first() as Map)["tabTitle"]) assertEquals("Class", ((map["lists"] as List<*>).first() as Map)["colTitle"]) assertEquals("", map["subtitle"]) assertEquals("package", map["kind"]) -- cgit