dokkatoo, How do you add a md file stored in your ...
# dokka
h
dokkatoo, How do you add a md file stored in your project root, without a kotlin plugin applied? With dokka, I used this:
Copy code
tasks.dokkaHtmlMultiModule {
  includes.from("README.md")
}
and I used the partial tasks to add (sub) project
README.md
files using
dokkaSourceSets.configureEach { includes.from(file("README.md"))
. The latter is already possible.
a
take a look at this example project https://github.com/adamko-dev/dokkatoo/tree/v1.3.0/examples/gradle-example/dokkatoo with Dokkatoo you shouldn’t need to adjust the tasks directly, so you can add a file from the
dokkatoo {}
extension, so this should work:
Copy code
dokkatoo {
  dokkatooSourceSets.configureEach {
    includes.from("README.md")
  }
}
h
Yes, I used this setup in each sub project. but does this also include the Readme located at the project root?
Because at root, there are no sourcesets
a
hmmm okay, I’m not sure how that would work off the top of my head
the
includes.from(...)
path must be relative to the
build.gradle.kts
, so if each subproject has a README.md then each one will be picked up
h
Yes, this is expected. Ideally, I just need to adjust the merger task to contain another readme file.
Which should be added to the index html
a
I’m short on time today so I can’t dig through to give a proper answer, but at a guess, try adding a file to the publication
Copy code
dokkatoo {
  dokkatooPublications.configureEach { 
    includes.from("README.md")
  }
}
h
Wow, yes, this works, nice, thank you.
🐕 1
a
I haven’t written down the model yet (because I’m still puzzling over some parts of Dokka and wondering how Dokkatoo should work, but the rough idea is this: • Dokka Modules are analogous to ‘Dokka Partials’. They’re specific for a single format (HTML, Markdown, etc) • Dokkatoo Source Sets are independent of a format, and describe the source code and its dependencies • Dokkatoo Publications are specific per format, and have two modes: multiple modules (where all the modules are combined into separate packages), or flat (the code from multiple subprojects is smushed together to appear as one singular project)
i
Dokka Modules are analogous to ‘Dokka Partials’. They’re specific for a single format (HTML, Markdown, etc)
Yeah, in the current Gradle plugin there are some specific scenarios in which you'd want to configure the parent MultiModule task only... For instance, setting
DokkaMultiModuleTask#moduleName
should change the name of the project used in the header. Setting it only for the partial tasks will not be enough now, I think
268 Views