diff options
author | Mike Hearn <mike@plan99.net> | 2015-11-23 19:21:08 +0100 |
---|---|---|
committer | Mike Hearn <mike@plan99.net> | 2015-11-23 19:21:08 +0100 |
commit | 90cf2ebccd12073a55ff6f187e5a378a2e96e23b (patch) | |
tree | 2a8575d78618a8b374a35e6e8749968187583e29 /src/Generation | |
parent | 23e270b603eb32472b8ef4a5f44c01af57fd049f (diff) | |
download | dokka-90cf2ebccd12073a55ff6f187e5a378a2e96e23b.tar.gz dokka-90cf2ebccd12073a55ff6f187e5a378a2e96e23b.tar.bz2 dokka-90cf2ebccd12073a55ff6f187e5a378a2e96e23b.zip |
Copy style.css to the output directory when doing HTML and use relative paths.
Fixes the code so that the relative path to root is always available, breaking the requirement to use a local web server.
Diffstat (limited to 'src/Generation')
-rw-r--r-- | src/Generation/FileGenerator.kt | 6 | ||||
-rw-r--r-- | src/Generation/Generator.kt | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/Generation/FileGenerator.kt b/src/Generation/FileGenerator.kt index 810038fa..a762bae3 100644 --- a/src/Generation/FileGenerator.kt +++ b/src/Generation/FileGenerator.kt @@ -42,6 +42,12 @@ public class FileGenerator @Inject constructor(val locationService: FileLocation } } } + + override fun buildSupportFiles() { + FileOutputStream(locationService.location(listOf("style.css"), false).file).use { + javaClass.getResourceAsStream("/dokka/styles/style.css").copyTo(it) + } + } } private fun File.mkdirsOrFail() { diff --git a/src/Generation/Generator.kt b/src/Generation/Generator.kt index d7db1c52..ac10a6a5 100644 --- a/src/Generation/Generator.kt +++ b/src/Generation/Generator.kt @@ -3,11 +3,13 @@ package org.jetbrains.dokka public interface Generator { fun buildPages(nodes: Iterable<DocumentationNode>) fun buildOutlines(nodes: Iterable<DocumentationNode>) + fun buildSupportFiles() } fun Generator.buildAll(nodes: Iterable<DocumentationNode>) { buildPages(nodes) buildOutlines(nodes) + buildSupportFiles() } fun Generator.buildPage(node: DocumentationNode): Unit = buildPages(listOf(node)) |