All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.dokka.gfm.templateProcessing.GfmTemplateProcessingPlugin.kt Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
/*
 * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

package org.jetbrains.dokka.gfm.templateProcessing

import org.jetbrains.dokka.allModulesPage.AllModulesPagePlugin
import org.jetbrains.dokka.allModulesPage.MultimoduleLocationProvider
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory
import org.jetbrains.dokka.gfm.GfmPlugin
import org.jetbrains.dokka.gfm.location.MarkdownLocationProvider
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.templates.TemplateProcessingStrategy
import org.jetbrains.dokka.templates.TemplatingPlugin

public class GfmTemplateProcessingPlugin : DokkaPlugin() {

    private val allModulesPagePlugin by lazy { plugin() }
    private val templateProcessingPlugin by lazy { plugin() }
    private val gfmPlugin by lazy { plugin() }
    private val dokkaBase by lazy { plugin()}

    public val gfmTemplateProcessingStrategy: Extension by extending {
        (templateProcessingPlugin.templateProcessingStrategy
                providing ::GfmTemplateProcessingStrategy
                order { before(templateProcessingPlugin.fallbackProcessingStrategy) })
    }

    public val gfmLocationProvider: Extension by extending {
        dokkaBase.locationProviderFactory providing MultimoduleLocationProvider::Factory override listOf(gfmPlugin.locationProvider, allModulesPagePlugin.multimoduleLocationProvider)
    }

    public val gfmPartialLocationProvider: Extension by extending {
        allModulesPagePlugin.partialLocationProviderFactory providing MarkdownLocationProvider::Factory override allModulesPagePlugin.baseLocationProviderFactory
    }

    @OptIn(DokkaPluginApiPreview::class)
    override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement =
        PluginApiPreviewAcknowledgement
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy