diff options
Diffstat (limited to 'plugins/base')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt | 23 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 4 |
2 files changed, 3 insertions, 24 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt index 1b187984..925767ce 100644 --- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt @@ -142,34 +142,13 @@ abstract class DefaultRenderer<T>( } } - // reimplement this as preprocessor - open fun renderPackageList(root: ContentPage) = - getPackageNamesAndPlatforms(root) - .keys - .joinToString("\n") - .also { - runBlocking { - outputWriter.write("${root.name}/package-list", it, "") - } - } - - open fun getPackageNamesAndPlatforms(root: PageNode): Map<String, List<PlatformData>> = - root.children - .map { getPackageNamesAndPlatforms(it) } - .fold(emptyMap<String, List<PlatformData>>()) { e, acc -> acc + e } + - if (root is PackagePageNode) { - mapOf(root.name to root.platforms()) - } else { - emptyMap() - } - override fun render(root: RootPageNode) { val newRoot = preprocessors.fold(root) { acc, t -> t(acc) } locationProvider = context.plugin<DokkaBase>().querySingle { locationProviderFactory }.getLocationProvider(newRoot) - runBlocking { + runBlocking(Dispatchers.Default) { renderPages(newRoot) } } diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 796d6483..205897a4 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -285,8 +285,8 @@ open class HtmlRenderer( override fun render(root: RootPageNode) { super.render(root) - runBlocking { - launch(Dispatchers.IO) { + runBlocking(Dispatchers.Default) { + launch { outputWriter.write("scripts/pages", "var pages = [\n${pageList.joinToString(",\n")}\n]", ".js") } } |