diff options
-rw-r--r-- | src/Formats/JekyllFormatService.kt | 8 | ||||
-rw-r--r-- | src/Formats/KotlinWebsiteFormatService.kt | 2 | ||||
-rw-r--r-- | src/Formats/MarkdownFormatService.kt | 8 | ||||
-rw-r--r-- | src/Formats/StructuredFormatService.kt | 5 |
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) |