diff options
author | Błażej Kardyś <bkardys@virtuslab.com> | 2020-11-02 04:22:57 +0100 |
---|---|---|
committer | Błażej Kardyś <bkardys@virtuslab.com> | 2020-11-27 03:15:02 +0100 |
commit | e6ce96cef610cab0163c669ab4a9de0c259904cc (patch) | |
tree | ee54e7053dba70b30de187925d6c41a76eff8385 /plugins/all-module-page | |
parent | ed56e7bcdceac7a13eae851e02f642c0762aaf40 (diff) | |
download | dokka-e6ce96cef610cab0163c669ab4a9de0c259904cc.tar.gz dokka-e6ce96cef610cab0163c669ab4a9de0c259904cc.tar.bz2 dokka-e6ce96cef610cab0163c669ab4a9de0c259904cc.zip |
Fixing tests after moving SingleGeneration to base
Diffstat (limited to 'plugins/all-module-page')
-rw-r--r-- | plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt b/plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt index e609397b..92f39779 100644 --- a/plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt +++ b/plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt @@ -31,15 +31,14 @@ class DirectiveBasedTemplateProcessingStrategy(private val context: DokkaContext val document = withContext(IO) { Jsoup.parse(input, "UTF-8") } document.outputSettings().indentAmount(0).prettyPrint(false) document.select("dokka-template-command").forEach { - val command = parseJson<Command>(it.attr("data")) - when (command) { + when (val command = parseJson<Command>(it.attr("data"))) { is ResolveLinkCommand -> resolveLink(it, command, output) is AddToNavigationCommand -> navigationFragments[command.moduleName] = it is SubstitutionCommand -> substitute(it, TemplatingContext(input, output, it, command)) else -> context.logger.warn("Unknown templating command $command") } } - withContext(IO) { Files.writeString(output.toPath(), document.outerHtml()) } + withContext(IO) { Files.write(output.toPath(), listOf(document.outerHtml())) } } } else { launch(IO) { @@ -102,7 +101,7 @@ class DirectiveBasedTemplateProcessingStrategy(private val context: DokkaContext } withContext(IO) { - Files.writeString(output.resolve("navigation.html").toPath(), node.outerHtml()) + Files.write(output.resolve("navigation.html").toPath(), listOf(node.outerHtml())) } node.select("a").forEach { a -> @@ -110,9 +109,9 @@ class DirectiveBasedTemplateProcessingStrategy(private val context: DokkaContext } navigationFragments.keys.forEach { withContext(IO) { - Files.writeString( + Files.write( output.resolve(it).resolve("navigation.html").toPath(), - node.outerHtml() + listOf(node.outerHtml()) ) } } |