diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-04-22 10:07:06 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-04-22 13:10:48 +0200 |
commit | df980fe67ba49b959163ae96c54711550368d153 (patch) | |
tree | d529dd84622c608295119eb68a95704c4d8d9abd /plugins/base/src | |
parent | 5a72f4a7e63d96f98072bf3989373592c2b906c2 (diff) | |
download | dokka-df980fe67ba49b959163ae96c54711550368d153.tar.gz dokka-df980fe67ba49b959163ae96c54711550368d153.tar.bz2 dokka-df980fe67ba49b959163ae96c54711550368d153.zip |
Fix dispatcher
Diffstat (limited to 'plugins/base/src')
-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") } } |