From e7aeb481697a2b295b8c1f49102642caec11a34a Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 17 Nov 2015 12:38:47 +0100 Subject: fix link extensions in kotlin-website format --- src/Formats/JekyllFormatService.kt | 8 +++++--- src/Formats/KotlinWebsiteFormatService.kt | 2 +- src/Formats/MarkdownFormatService.kt | 8 +++++--- src/Formats/StructuredFormatService.kt | 5 +++-- 4 files changed, 14 insertions(+), 9 deletions(-) (limited to 'src') 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) { 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, 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): 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) -- cgit