From e6ce96cef610cab0163c669ab4a9de0c259904cc Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Mon, 2 Nov 2020 04:22:57 +0100 Subject: Fixing tests after moving SingleGeneration to base --- .../main/kotlin/templates/DirectiveBasedTemplateProcessing.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt') 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(it.attr("data")) - when (command) { + when (val command = parseJson(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()) ) } } -- cgit