From d91fb6a2f4fd8222fd791d53af3644e637d42778 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Fri, 24 Feb 2012 11:47:27 +0000 Subject: [PATCH] refactored the templates to make use of the lovely new multi line strings with templates; they're much easier to read now in IDEA (further improvements could be done to refactor functions from printFoo() to be foo() returning the String of the result) --- .../doc/templates/AllClassesFrameTemplate.kt | 1 - .../kotlin/doc/templates/ClassTemplate.kt | 149 +++++++++--------- .../kotlin/doc/templates/HelpDocTemplate.kt | 12 +- .../kotlin/doc/templates/IndexTemplate.kt | 4 +- .../doc/templates/OverviewFrameTemplate.kt | 17 +- .../doc/templates/OverviewSummaryTemplate.kt | 26 +-- .../doc/templates/OverviewTreeTemplate.kt | 21 ++- .../doc/templates/PackageFrameTemplate.kt | 35 ++-- .../doc/templates/PackageSummaryTemplate.kt | 128 +++++++-------- 9 files changed, 188 insertions(+), 205 deletions(-) diff --git a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/AllClassesFrameTemplate.kt b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/AllClassesFrameTemplate.kt index 500b01a1809..9985913c4aa 100644 --- a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/AllClassesFrameTemplate.kt +++ b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/AllClassesFrameTemplate.kt @@ -9,7 +9,6 @@ import org.jetbrains.kotlin.model.KModel class AllClassesFrameTemplate(val model: KModel, val classAttributes: String = "") : KDocTemplate() { override fun render() { - // TODO could really do with templates in multi-line strings :) println(""" diff --git a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/ClassTemplate.kt b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/ClassTemplate.kt index 5964fed1f17..2494f5a7ed1 100644 --- a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/ClassTemplate.kt +++ b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/ClassTemplate.kt @@ -16,27 +16,26 @@ open class ClassTemplate(open val model: KModel, pkg: KPackage, open val klass: open fun pageTitle(): String = "${klass.name} (${model.title})" override fun render() { - // TODO could really do with templates in multi-line strings :) println(""" -""") - println("""""") - println(""" -""") - println(pageTitle()) - println(""" + + + + +${pageTitle()} + -""") - println("""""") - println(""" + + +