I'm trying to add custom configuration to a dokka ...
# dokka
s
I'm trying to add custom configuration to a dokka plugin using DGPv2. there seems to be no documentation for how to do this, though I did find the
Copy code
fun DokkaPluginParametersContainer.pluginParameters(
    pluginFqn: String,
    configure: DokkaPluginParametersBuilder.() -> Unit
)
method, in
DokkaPluginParametersBuilder.kt
. However, this method does not work as it produces the following error:
Copy code
Cannot create a DokkaPluginParametersBuilder because this type is not known to this container. Known types are: DokkaHtmlPluginParameters, DokkaVersioningPluginParameters
creating my own class in my
build.gradle.kts
doesn't work either, due to
Copy code
Could not create domain object 'scripts' (DokkaScriptsPluginParameters)
> Could not create an instance of type Build_gradle$DokkaScriptsPluginParameters.
   > Class Build_gradle.DokkaScriptsPluginParameters is a non-static inner class.
the lack of support for configuring custom plugins is a serious issue imo. the current solution I have found to this is to manually register the
DokkaPluginParametersBuilder
using
Copy code
registerFactory(DokkaPluginParametersBuilder::class.java) { name ->
    objects.newInstance<DokkaPluginParametersBuilder>(name, name)
}
however, this still errors due to
jsonEncode()
being annotated with
@Internal
.
I've submitted a PR that fixes these issues here: https://github.com/Kotlin/dokka/pull/3870