aboutsummaryrefslogtreecommitdiff
path: root/plugins/mathjax
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-08-31 20:16:01 +0200
committerGitHub <noreply@github.com>2023-08-31 20:16:01 +0200
commit02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 (patch)
tree66f6d6f089a93b863bf1144666491eca6729ad05 /plugins/mathjax
parent6a181a7a2b03ec263788d137610e86937a57d434 (diff)
downloaddokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.gz
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.bz2
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.zip
Enable explicit API mode (#3139)
Diffstat (limited to 'plugins/mathjax')
-rw-r--r--plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt18
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt b/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt
index 0af9606c..2a7ed6a4 100644
--- a/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt
+++ b/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt
@@ -16,15 +16,17 @@ import org.jetbrains.dokka.pages.RootPageNode
import org.jetbrains.dokka.pages.WithDocumentables
import org.jetbrains.dokka.plugability.DokkaPlugin
import org.jetbrains.dokka.plugability.DokkaPluginApiPreview
+import org.jetbrains.dokka.plugability.Extension
import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement
import org.jetbrains.dokka.transformers.pages.PageTransformer
-class MathjaxPlugin : DokkaPlugin() {
- val transformer by extending {
+public class MathjaxPlugin : DokkaPlugin() {
+
+ public val transformer: Extension<PageTransformer, *, *> by extending {
CoreExtensions.pageTransformer with MathjaxTransformer
}
- val mathjaxTagContentProvider by extending {
+ public val mathjaxTagContentProvider: Extension<CustomTagContentProvider, *, *> by extending {
plugin<DokkaBase>().customTagContentProvider with MathjaxTagContentProvider order {
before(plugin<DokkaBase>().sinceKotlinTagContentProvider)
}
@@ -38,8 +40,9 @@ class MathjaxPlugin : DokkaPlugin() {
private const val ANNOTATION = "usesMathJax"
internal const val LIB_PATH = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-AMS_SVG&latest"
-object MathjaxTransformer : PageTransformer {
- override fun invoke(input: RootPageNode) = input.transformContentPagesTree {
+public object MathjaxTransformer : PageTransformer {
+
+ override fun invoke(input: RootPageNode): RootPageNode = input.transformContentPagesTree {
it.modified(
embeddedResources = it.embeddedResources + if (it.isNeedingMathjax) listOf(LIB_PATH) else emptyList()
)
@@ -50,9 +53,10 @@ object MathjaxTransformer : PageTransformer {
.flatMap { it.children }
.any { (it as? CustomTagWrapper)?.name == ANNOTATION } }
}
-object MathjaxTagContentProvider : CustomTagContentProvider {
- override fun isApplicable(customTag: CustomTagWrapper) = customTag.name == ANNOTATION
+public object MathjaxTagContentProvider : CustomTagContentProvider {
+
+ override fun isApplicable(customTag: CustomTagWrapper): Boolean = customTag.name == ANNOTATION
override fun DocumentableContentBuilder.contentForDescription(
sourceSet: DokkaConfiguration.DokkaSourceSet,