diff options
Diffstat (limited to 'plugins/mathjax/src/main')
-rw-r--r-- | plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt b/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt index 6a00a3da..89c13202 100644 --- a/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt +++ b/plugins/mathjax/src/main/kotlin/MathjaxPlugin.kt @@ -16,6 +16,12 @@ class MathjaxPlugin : DokkaPlugin() { val transformer by extending { CoreExtensions.pageTransformer with MathjaxTransformer } + + val mathjaxTagContentProvider by extending { + plugin<DokkaBase>().customTagContentProvider with MathjaxTagContentProvider order { + before(plugin<DokkaBase>().sinceKotlinTagContentProvider) + } + } } private const val ANNOTATION = "usesMathJax" @@ -34,3 +40,15 @@ object MathjaxTransformer : PageTransformer { .orEmpty() .any { (it as? CustomTagWrapper)?.name == ANNOTATION } } + +object MathjaxTagContentProvider : CustomTagContentProvider { + + override fun isApplicable(customTag: CustomTagWrapper) = customTag.name == ANNOTATION + + override fun DocumentableContentBuilder.contentForDescription( + sourceSet: DokkaConfiguration.DokkaSourceSet, + customTag: CustomTagWrapper + ) { + comment(customTag.root, sourceSets = setOf(sourceSet)) + } +}
\ No newline at end of file |