aboutsummaryrefslogtreecommitdiff
path: root/src/Formats/HtmlTemplateService.kt
diff options
context:
space:
mode:
authorMike Hearn <mike@plan99.net>2015-11-23 19:21:08 +0100
committerMike Hearn <mike@plan99.net>2015-11-23 19:21:08 +0100
commit90cf2ebccd12073a55ff6f187e5a378a2e96e23b (patch)
tree2a8575d78618a8b374a35e6e8749968187583e29 /src/Formats/HtmlTemplateService.kt
parent23e270b603eb32472b8ef4a5f44c01af57fd049f (diff)
downloaddokka-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/Formats/HtmlTemplateService.kt')
-rw-r--r--src/Formats/HtmlTemplateService.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Formats/HtmlTemplateService.kt b/src/Formats/HtmlTemplateService.kt
index b9900757..ae42a31b 100644
--- a/src/Formats/HtmlTemplateService.kt
+++ b/src/Formats/HtmlTemplateService.kt
@@ -1,7 +1,9 @@
package org.jetbrains.dokka
+import java.nio.file.Path
+
public interface HtmlTemplateService {
- fun appendHeader(to: StringBuilder, title: String?)
+ fun appendHeader(to: StringBuilder, title: String?, basePath: Path)
fun appendFooter(to: StringBuilder)
companion object {
@@ -11,14 +13,15 @@ public interface HtmlTemplateService {
to.appendln("</BODY>")
to.appendln("</HTML>")
}
- override fun appendHeader(to: StringBuilder, title: String?) {
+ override fun appendHeader(to: StringBuilder, title: String?, basePath: Path) {
to.appendln("<HTML>")
to.appendln("<HEAD>")
if (title != null) {
to.appendln("<title>$title</title>")
}
if (css != null) {
- to.appendln("<link rel=\"stylesheet\" href=\"$css\">")
+ val cssPath = basePath.resolve(css)
+ to.appendln("<link rel=\"stylesheet\" href=\"$cssPath\">")
}
to.appendln("</HEAD>")
to.appendln("<BODY>")