Is there an easy way to parameterize Dokka <module...
# dokka
k
Is there an easy way to parameterize Dokka module documentation? I have a section of my docs that looks something like this in the getting started section:
Copy code
[versions]
cardiologist = "0.3.1"

[libraries]
cardiologist = { module = "io.github.kevincianfarini.cardiologist:cardiologist", version.ref = "cardiologist" }
I want to parameterize the version number
0.3.1
so that I can inject it from my
gradle.properties
file. Is that possible?
k
I'm not sure this is quite the same thing as what I'm asking. I declare the version of the library I author in
gradle.properties
and would like to be able to inject that into module documentation. Essentially, I want to template module documentation in dokka.
a
Are you using DGPv1 or v2? For v2 you could create a Gradle task that pre-processes the module file before you pass it to Dokka, and replaces placeholder version with the actual value. kotlin-wrappers does something similar https://github.com/JetBrains/kotlin-wrappers/blob/f5faf9ce4339b5fbd343ed36b6820ac111779bac/build-logic/src/main/kotlin/wrappersbuild.dokka-conventions.gradle.kts#L42
k
I was afraid that might be the answer, but I suppose that will do!