From d9f135d0a783461cd8650440230a5c0c8613ea29 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 23 Mar 2015 19:18:39 +0100 Subject: don't show redundant signatures for packages --- src/Formats/KotlinWebsiteFormatService.kt | 7 +++++-- src/Kotlin/KotlinLanguageService.kt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Formats/KotlinWebsiteFormatService.kt b/src/Formats/KotlinWebsiteFormatService.kt index 01df0501..3b95a915 100644 --- a/src/Formats/KotlinWebsiteFormatService.kt +++ b/src/Formats/KotlinWebsiteFormatService.kt @@ -20,13 +20,16 @@ public class KotlinWebsiteFormatService(locationService: LocationService, return "" } - override public fun formatCode(code: String): String = "$code" + override public fun formatCode(code: String): String = if (code.length() > 0) "$code" else "" override fun formatStrikethrough(text: String): String = "$text" override fun appendAsSignature(to: StringBuilder, block: () -> Unit) { + val oldLength = to.length() block() - to.append("
") // since we've used HTML to format the signature, add an HTML line break following it + if (to.length() > oldLength) { + to.append("
") // since we've used HTML to format the signature, add an HTML line break following it + } } override fun formatLink(text: String, href: String): String { diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt index 8626e7e1..a8c9bc64 100644 --- a/src/Kotlin/KotlinLanguageService.kt +++ b/src/Kotlin/KotlinLanguageService.kt @@ -11,7 +11,7 @@ class KotlinLanguageService : LanguageService { override fun render(node: DocumentationNode, renderMode: RenderMode): ContentNode { return content { when (node.kind) { - DocumentationNode.Kind.Package -> renderPackage(node) + DocumentationNode.Kind.Package -> if (renderMode == RenderMode.FULL) renderPackage(node) DocumentationNode.Kind.Class, DocumentationNode.Kind.Interface, DocumentationNode.Kind.Enum, -- cgit