aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-26 12:46:04 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-26 12:46:04 +0100
commit9849287541fc23ef130729bd5e1e908a47b97ac3 (patch)
tree4ce54f3a60b6e3d8e64d288c3bd3564f0ed75c44
parent8ae8cb7f37dba7d2f6969a92768e135538b52252 (diff)
downloaddokka-9849287541fc23ef130729bd5e1e908a47b97ac3.tar.gz
dokka-9849287541fc23ef130729bd5e1e908a47b97ac3.tar.bz2
dokka-9849287541fc23ef130729bd5e1e908a47b97ac3.zip
use correct extension in links for jekyll and kotlin-website docs
-rw-r--r--src/Formats/JekyllFormatService.kt2
-rw-r--r--src/Locations/FoldersLocationService.kt4
-rw-r--r--src/main.kt4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/Formats/JekyllFormatService.kt b/src/Formats/JekyllFormatService.kt
index 93ba4704..e4c3ccd5 100644
--- a/src/Formats/JekyllFormatService.kt
+++ b/src/Formats/JekyllFormatService.kt
@@ -4,8 +4,6 @@ public open class JekyllFormatService(locationService: LocationService,
signatureGenerator: LanguageService)
: MarkdownFormatService(locationService, signatureGenerator) {
- override fun link(from: DocumentationNode, to: DocumentationNode): FormatLink = link(from, to, "html")
-
override fun appendNodes(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>) {
to.appendln("---")
appendFrontMatter(nodes, to)
diff --git a/src/Locations/FoldersLocationService.kt b/src/Locations/FoldersLocationService.kt
index ce202cfe..2e9a9cd5 100644
--- a/src/Locations/FoldersLocationService.kt
+++ b/src/Locations/FoldersLocationService.kt
@@ -4,7 +4,9 @@ import java.io.File
public fun FoldersLocationService(root: String): FoldersLocationService = FoldersLocationService(File(root), "")
public class FoldersLocationService(val root: File, val extension: String) : FileLocationService {
- override fun withExtension(newExtension: String): LocationService = FoldersLocationService(root, newExtension)
+ override fun withExtension(newExtension: String): LocationService {
+ return if (extension.isEmpty()) FoldersLocationService(root, newExtension) else this
+ }
override fun location(qualifiedName: List<String>, hasMembers: Boolean): FileLocation {
return FileLocation(File(root, relativePathToNode(qualifiedName, hasMembers)).appendExtension(extension))
diff --git a/src/main.kt b/src/main.kt
index 242ac85a..3192d711 100644
--- a/src/main.kt
+++ b/src/main.kt
@@ -141,8 +141,8 @@ class DokkaGenerator(val logger: DokkaLogger,
htmlFormatService to htmlFormatService
}
"markdown" -> MarkdownFormatService(locationService, signatureGenerator) to null
- "jekyll" -> JekyllFormatService(locationService, signatureGenerator) to null
- "kotlin-website" -> KotlinWebsiteFormatService(locationService, signatureGenerator) to
+ "jekyll" -> JekyllFormatService(locationService.withExtension("html"), signatureGenerator) to null
+ "kotlin-website" -> KotlinWebsiteFormatService(locationService.withExtension("html"), signatureGenerator) to
YamlOutlineService(locationService, signatureGenerator)
else -> {
logger.error("Unrecognized output format ${outputFormat}")