aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-10 19:42:30 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-10 19:42:30 +0100
commitc5e98b1481c48954b6336916eca3644adb5f9372 (patch)
tree026df0fbc1aaf1f0fe96143d32571e8374825d75
parentebbf265dbe9d5fe37e56c9baa567edaf21dd16fa (diff)
downloaddokka-c5e98b1481c48954b6336916eca3644adb5f9372.tar.gz
dokka-c5e98b1481c48954b6336916eca3644adb5f9372.tar.bz2
dokka-c5e98b1481c48954b6336916eca3644adb5f9372.zip
fix links to supertypes
-rw-r--r--src/Kotlin/KotlinLanguageService.kt2
-rw-r--r--src/Model/Content.kt2
-rw-r--r--test/data/format/typeLink.html24
-rw-r--r--test/data/format/typeLink.kt5
-rw-r--r--test/src/format/HtmlFormatTest.kt6
5 files changed, 37 insertions, 2 deletions
diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt
index 26eee435..526582e6 100644
--- a/src/Kotlin/KotlinLanguageService.kt
+++ b/src/Kotlin/KotlinLanguageService.kt
@@ -58,7 +58,7 @@ class KotlinLanguageService : LanguageService {
}
}
- private fun ContentBlock.renderLinked(node: DocumentationNode, body: ContentNode.(DocumentationNode)->Unit) {
+ private fun ContentBlock.renderLinked(node: DocumentationNode, body: ContentBlock.(DocumentationNode)->Unit) {
val to = node.links.firstOrNull()
if (to == null)
body(node)
diff --git a/src/Model/Content.kt b/src/Model/Content.kt
index 7a0f6c2e..f74a4461 100644
--- a/src/Model/Content.kt
+++ b/src/Model/Content.kt
@@ -76,7 +76,7 @@ fun ContentBlock.keyword(value: String) = append(ContentKeyword(value))
fun ContentBlock.symbol(value: String) = append(ContentSymbol(value))
fun ContentBlock.identifier(value: String) = append(ContentIdentifier(value))
-fun ContentBlock.link(to: DocumentationNode, body: ContentNode.() -> Unit) {
+fun ContentBlock.link(to: DocumentationNode, body: ContentBlock.() -> Unit) {
val block = ContentNodeLink(to)
block.body()
append(block)
diff --git a/test/data/format/typeLink.html b/test/data/format/typeLink.html
new file mode 100644
index 00000000..3f83dbda
--- /dev/null
+++ b/test/data/format/typeLink.html
@@ -0,0 +1,24 @@
+<HTML>
+<HEAD>
+<title>test / Bar</title>
+</HEAD>
+<BODY>
+<a href="out.html">test</a>&nbsp;/&nbsp;<a href="out.html"></a>&nbsp;/&nbsp;<a href="out.html">Bar</a><br/>
+<br/>
+<h1>Bar</h1>
+<code><span class="keyword">class </span><span class="identifier">Bar</span><span class="symbol"> : </span><a href="out.html"><span class="identifier">Foo</span></a></code><br/>
+<br/>
+<br/>
+<h3>Constructors</h3>
+<table>
+<tbody>
+<tr>
+<td>
+<a href="out.html">&lt;init&gt;</a></td>
+<td>
+<code><span class="keyword">public</span> <span class="identifier">Bar</span><span class="symbol">(</span><span class="symbol">)</span></code></td>
+</tr>
+</tbody>
+</table>
+</BODY>
+</HTML>
diff --git a/test/data/format/typeLink.kt b/test/data/format/typeLink.kt
new file mode 100644
index 00000000..966e020e
--- /dev/null
+++ b/test/data/format/typeLink.kt
@@ -0,0 +1,5 @@
+class Foo() {
+}
+
+class Bar(): Foo {
+}
diff --git a/test/src/format/HtmlFormatTest.kt b/test/src/format/HtmlFormatTest.kt
index 53c1a39d..1e469b91 100644
--- a/test/src/format/HtmlFormatTest.kt
+++ b/test/src/format/HtmlFormatTest.kt
@@ -75,4 +75,10 @@ public class HtmlFormatTest {
htmlService.appendNodes(tempLocation, output, model.members.single().members)
}
}
+
+ Test fun typeLink() {
+ verifyOutput("test/data/format/typeLink.kt", ".html") { model, output ->
+ htmlService.appendNodes(tempLocation, output, model.members.single().members.filter { it.name == "Bar"} )
+ }
+ }
}