aboutsummaryrefslogtreecommitdiff
path: root/src/Formats
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-14 19:34:52 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-14 19:34:52 +0400
commit68d3bc8d76e550f98cf768362eb311d0cc4f3a0d (patch)
tree5ae62771d6392ef81cf996db6b317610739b56fd /src/Formats
parent1aa62f8071939f1a2b3640e00378cd86b8599b9c (diff)
downloaddokka-68d3bc8d76e550f98cf768362eb311d0cc4f3a0d.tar.gz
dokka-68d3bc8d76e550f98cf768362eb311d0cc4f3a0d.tar.bz2
dokka-68d3bc8d76e550f98cf768362eb311d0cc4f3a0d.zip
Beautification and documentation.
Diffstat (limited to 'src/Formats')
-rw-r--r--src/Formats/MarkdownFormatService.kt18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/Formats/MarkdownFormatService.kt b/src/Formats/MarkdownFormatService.kt
index 2e541113..9626f62c 100644
--- a/src/Formats/MarkdownFormatService.kt
+++ b/src/Formats/MarkdownFormatService.kt
@@ -1,5 +1,7 @@
package org.jetbrains.dokka
+import org.jetbrains.dokka.DocumentationNode.Kind
+
public class MarkdownFormatService(val locationService: LocationService,
val signatureGenerator: SignatureGenerator) : FormatService {
override val extension: String = "md"
@@ -15,9 +17,11 @@ public class MarkdownFormatService(val locationService: LocationService,
appendln(node.doc.description)
appendln()
for (section in node.doc.sections) {
- append("### ")
- appendln(section.label)
- appendln(section.text)
+ append("##### ")
+ append(section.label)
+ appendln()
+ append(section.text)
+ appendln()
}
if (node.members.any()) {
@@ -26,7 +30,11 @@ public class MarkdownFormatService(val locationService: LocationService,
appendln("|------|-----------|---------|")
for (member in node.members.sortBy { it.name }) {
val relativePath = locationService.relativeLocation(node, member, extension)
- append("|[${member.name}](${relativePath})")
+ val displayName = when (member.kind) {
+ Kind.Constructor -> "*.init*"
+ else -> signatureGenerator.renderName(member).htmlEscape()
+ }
+ append("|[${displayName}](${relativePath})")
append("|`${signatureGenerator.render(member)}`")
append("|${member.doc.summary} ")
appendln("|")
@@ -34,4 +42,4 @@ public class MarkdownFormatService(val locationService: LocationService,
}
}
}
-} \ No newline at end of file
+}