From 374e734168cb74d9ab3a934f9624e3c1927d36ae Mon Sep 17 00:00:00 2001 From: James Strachan Date: Thu, 1 Mar 2012 15:51:34 +0000 Subject: [PATCH] fixed function links and use correct package format --- .../jetbrains/kotlin/doc/templates/KDocTemplate.kt | 11 ++++++----- .../kotlin/doc/templates/OverviewSummaryTemplate.kt | 2 +- .../kotlin/doc/templates/PackageTemplateSupport.kt | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/KDocTemplate.kt b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/KDocTemplate.kt index 4ae576058ae..d4a9cb7dca2 100644 --- a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/KDocTemplate.kt +++ b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/KDocTemplate.kt @@ -54,12 +54,13 @@ abstract class KDocTemplate() : TextTemplate() { } open fun sourceHref(f: KFunction): String { - return if (f.owner is KClass) { - "${rootHref(f.owner.pkg)}src-html/${f.owner.simpleName}.html#line.${f.sourceLine}" - } else { + val owner = f.owner + return if (owner is KClass) { + "${rootHref(owner.pkg)}src-html/${owner.simpleName}.html#line.${f.sourceLine}" + } else if (owner is KPackage) { // TODO how to find the function in a package??? - "" - } + "${rootHref(owner)}src-html/namespace.html#line.${f.sourceLine}" + } else href(f) } open fun link(c: KClass, fullName: Boolean = false): String { diff --git a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/OverviewSummaryTemplate.kt b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/OverviewSummaryTemplate.kt index d362e07aa56..c5983170aaa 100644 --- a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/OverviewSummaryTemplate.kt +++ b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/OverviewSummaryTemplate.kt @@ -104,7 +104,7 @@ ${model.title} """) for (p in model.packages) { println(""" -${p.nameAsPath} +${p.name} ${p.description} """) } diff --git a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/PackageTemplateSupport.kt b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/PackageTemplateSupport.kt index c0d22cb2e92..6884b94fbc2 100644 --- a/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/PackageTemplateSupport.kt +++ b/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/PackageTemplateSupport.kt @@ -91,7 +91,7 @@ abstract class PackageTemplateSupport(open val pkg: KPackage) : KDocTemplate() { } fun printFunctionDetail(function: KFunction): Unit { - println("""

""") + println("""

""") println("""${function.name}

""") println("""
""")
         println("""""")