aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-08-25 14:54:34 +0200
committerGitHub <noreply@github.com>2021-08-25 14:54:34 +0200
commit742f96bdf5c0b842e68dfaf43f4ab3446e87e3df (patch)
tree8c8553f21f8175f298ace4005973d482b1f0be13 /plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
parent06650909dbce632bd92d3a10c2887b69555edbfc (diff)
downloaddokka-742f96bdf5c0b842e68dfaf43f4ab3446e87e3df.tar.gz
dokka-742f96bdf5c0b842e68dfaf43f4ab3446e87e3df.tar.bz2
dokka-742f96bdf5c0b842e68dfaf43f4ab3446e87e3df.zip
Dark mode (#2081)
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt33
1 files changed, 1 insertions, 32 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
index 992c5eba..9faf4d17 100644
--- a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
@@ -49,37 +49,6 @@ abstract class NavigationDataProvider {
}
}
-open class NavigationSearchInstaller(val context: DokkaContext) : NavigationDataProvider(), PageTransformer {
- private val mapper = jacksonObjectMapper()
-
- open fun createSearchRecordFromNode(node: NavigationNode, location: String): SearchRecord =
- SearchRecord(name = node.name, location = location)
-
- override fun invoke(input: RootPageNode): RootPageNode {
- val page = RendererSpecificResourcePage(
- name = "scripts/navigation-pane.json",
- children = emptyList(),
- strategy = RenderingStrategy.DriLocationResolvableWrite { resolver ->
- val content = navigableChildren(input).withDescendants().map {
- createSearchRecordFromNode(it, resolveLocation(resolver, it.dri, it.sourceSets).orEmpty())
- }
- if (context.configuration.delayTemplateSubstitution) {
- mapper.writeValueAsString(AddToSearch(context.configuration.moduleName, content.toList()))
- } else {
- mapper.writeValueAsString(content)
- }
- })
-
- return input.modified(children = input.children + page)
- }
-
- private fun resolveLocation(locationResolver: DriResolver, dri: DRI, sourceSets: Set<DisplaySourceSet>): String? =
- locationResolver(dri, sourceSets).also { location ->
- if (location.isNullOrBlank()) context.logger.warn("Cannot resolve path for $dri and sourceSets: ${sourceSets.joinToString { it.name }}")
- }
-
-}
-
open class NavigationPageInstaller(val context: DokkaContext) : NavigationDataProvider(), PageTransformer {
override fun invoke(input: RootPageNode): RootPageNode =
@@ -152,13 +121,13 @@ class StylesInstaller(private val dokkaContext: DokkaContext) : PageTransformer
object AssetsInstaller : PageTransformer {
private val imagesPages = listOf(
"images/arrow_down.svg",
- "images/arrow_down_white.svg",
"images/logo-icon.svg",
"images/go-to-top-icon.svg",
"images/footer-go-to-link.svg",
"images/anchor-copy-button.svg",
"images/copy-icon.svg",
"images/copy-successful-icon.svg",
+ "images/theme-toggle.svg",
)
override fun invoke(input: RootPageNode) = input.modified(