From da498f50eabfad8969eb7795a535e97f7e25ca58 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Wed, 21 Oct 2020 09:01:07 +0200 Subject: Remove hard coded svg-s from renderer --- .../src/main/kotlin/renderers/html/HtmlRenderer.kt | 55 ++-------------------- .../kotlin/renderers/html/htmlPreprocessors.kt | 7 ++- 2 files changed, 10 insertions(+), 52 deletions(-) (limited to 'plugins/base/src/main/kotlin') diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 2a10bdd5..05eda494 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -132,29 +132,13 @@ open class HtmlRenderer( } private fun FlowContent.copyButton() = span(classes = "top-right-position") { - span("copy-icon") { - unsafe { - raw( - """ - - """.trimIndent() - ) - } - } + span("copy-icon") copiedPopup("Content copied to clipboard", "popup-to-left") } private fun FlowContent.copiedPopup(notificationContent: String, additionalClasses: String = "") = div("copy-popup-wrapper $additionalClasses") { - unsafe { - raw( - """ - - - - """.trimIndent() - ) - } + span("copy-popup-icon") span { text(notificationContent) } @@ -629,16 +613,6 @@ open class HtmlRenderer( span(classes = "anchor-wrapper") { span(classes = "anchor-icon") { attributes["pointing-to"] = pointingTo - unsafe { - raw( - """ - - - - - """.trimIndent() - ) - } } copiedPopup("Link copied to clipboard") } @@ -796,34 +770,13 @@ open class HtmlRenderer( content() div(classes = "footer") { span("go-to-top-icon") { - a(href = "#container") { - unsafe { - raw( - """ - - - - - """.trimIndent() - ) - } - } + a(href = "#container") } span { text("© 2020 Copyright") } span("pull-right") { span { text("Sponsored and developed by dokka") } a(href = "https://github.com/Kotlin/dokka") { - span(classes = "padded-icon") { - unsafe { - raw( - """ - - - - """.trimIndent() - ) - } - } + span(classes = "padded-icon") } } } diff --git a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt index fdb5be3c..93fe8221 100644 --- a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt +++ b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt @@ -121,7 +121,12 @@ object AssetsInstaller : PageTransformer { private val imagesPages = listOf( "images/arrow_down.svg", "images/docs_logo.svg", - "images/logo-icon.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", ) override fun invoke(input: RootPageNode) = input.modified( -- cgit