aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-11-17 12:38:47 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-11-17 12:38:47 +0100
commite7aeb481697a2b295b8c1f49102642caec11a34a (patch)
tree5414ea79774924c5214dd486df01072d8b154335
parent58d322242a6b43770cf697d9726448a46235504f (diff)
downloaddokka-e7aeb481697a2b295b8c1f49102642caec11a34a.tar.gz
dokka-e7aeb481697a2b295b8c1f49102642caec11a34a.tar.bz2
dokka-e7aeb481697a2b295b8c1f49102642caec11a34a.zip
fix link extensions in kotlin-website format
-rw-r--r--src/Formats/JekyllFormatService.kt8
-rw-r--r--src/Formats/KotlinWebsiteFormatService.kt2
-rw-r--r--src/Formats/MarkdownFormatService.kt8
-rw-r--r--src/Formats/StructuredFormatService.kt5
4 files changed, 14 insertions, 9 deletions
diff --git a/src/Formats/JekyllFormatService.kt b/src/Formats/JekyllFormatService.kt
index 75684ac2..f81257d6 100644
--- a/src/Formats/JekyllFormatService.kt
+++ b/src/Formats/JekyllFormatService.kt
@@ -2,9 +2,11 @@ package org.jetbrains.dokka
import com.google.inject.Inject
-public open class JekyllFormatService @Inject constructor(locationService: LocationService,
- signatureGenerator: LanguageService)
-: MarkdownFormatService(locationService, signatureGenerator) {
+open class JekyllFormatService
+ @Inject constructor(locationService: LocationService,
+ signatureGenerator: LanguageService,
+ linkExtension: String = "md")
+: MarkdownFormatService(locationService, signatureGenerator, linkExtension) {
override fun appendNodes(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>) {
to.appendln("---")
diff --git a/src/Formats/KotlinWebsiteFormatService.kt b/src/Formats/KotlinWebsiteFormatService.kt
index 25491cb3..4eda7910 100644
--- a/src/Formats/KotlinWebsiteFormatService.kt
+++ b/src/Formats/KotlinWebsiteFormatService.kt
@@ -4,7 +4,7 @@ import com.google.inject.Inject
public class KotlinWebsiteFormatService @Inject constructor(locationService: LocationService,
signatureGenerator: LanguageService)
-: JekyllFormatService(locationService, signatureGenerator) {
+: JekyllFormatService(locationService, signatureGenerator, "html") {
private var needHardLineBreaks = false
override fun appendFrontMatter(nodes: Iterable<DocumentationNode>, to: StringBuilder) {
diff --git a/src/Formats/MarkdownFormatService.kt b/src/Formats/MarkdownFormatService.kt
index 29a9f5c4..f694ae3e 100644
--- a/src/Formats/MarkdownFormatService.kt
+++ b/src/Formats/MarkdownFormatService.kt
@@ -3,9 +3,11 @@ package org.jetbrains.dokka
import com.google.inject.Inject
-public open class MarkdownFormatService @Inject constructor(locationService: LocationService,
- signatureGenerator: LanguageService)
-: StructuredFormatService(locationService, signatureGenerator, "md") {
+public open class MarkdownFormatService
+ @Inject constructor(locationService: LocationService,
+ signatureGenerator: LanguageService,
+ linkExtension: String = "md")
+: StructuredFormatService(locationService, signatureGenerator, "md", linkExtension) {
override public fun formatBreadcrumbs(items: Iterable<FormatLink>): String {
return items.map { formatLink(it) }.joinToString(" / ")
}
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt
index 6bc28522..32a2b68a 100644
--- a/src/Formats/StructuredFormatService.kt
+++ b/src/Formats/StructuredFormatService.kt
@@ -12,8 +12,9 @@ enum class ListKind {
abstract class StructuredFormatService(locationService: LocationService,
val languageService: LanguageService,
- override val extension: String) : FormatService {
- val locationService: LocationService = locationService.withExtension(extension)
+ override val extension: String,
+ val linkExtension: String = extension) : FormatService {
+ val locationService: LocationService = locationService.withExtension(linkExtension)
abstract fun appendBlockCode(to: StringBuilder, line: String, language: String)
abstract fun appendHeader(to: StringBuilder, text: String, level: Int = 1)