Jane Lee
01/23/2024, 12:07 AMJane Lee
01/23/2024, 1:04 AMOleg Yukhnevich
01/23/2024, 1:39 PMJane Lee
01/23/2024, 5:57 PMJane Lee
01/23/2024, 11:50 PMData
has some files and then Presentation
has some more files (which I'm assuming are just folders within a project). This however was just an image I found online. I'm using the dokka CLI also. Is this possible using the CLI?Jane Lee
01/23/2024, 11:51 PMDokkaTaskPartial
and DokkaMultiModuleTask
but I have no actual visibility in how it was implementedOleg Yukhnevich
01/24/2024, 8:38 AMpluginsClasspath
as any other plugin) - https://kotlinlang.org/docs/dokka-cli.html
Im not sure, that Im following on what do you want to achieve π
Can you please provide an example on what do you want in the end?
F.e. I do want my navigation panel to look like this:
- Data
- Presentation
- com.devbase.presentation
- com.devbase.presentation.base
- ...
- com.devbase.presentation.recyclerview
- DevItemViewHolder
- DevRecyclerViewAdapter
- com.devbase.presentation.recyclerview.endless
- ...
Jane Lee
01/24/2024, 5:34 PMData
, Presentation
and AnotherTopLevelFolder
are all folders in my root project
- Data
- com.mypackage.main
- com.anotherpackage.base
- Presentation
- com.devbase.presentation
- com.devbase.presentation.base
- ...
- com.devbase.presentation.recyclerview
- DevItemViewHolder
- DevRecyclerViewAdapter
- com.devbase.presentation.recyclerview.endless
- AnotherTopLevelFolder
- com.morepackages.base
I can use the CLI right now to reference multiple top level folders and render the documentation with the packages inside those folders but I end up with one long navigation that has all of the packages in a list and this is very hard to navigate and read, so i'm trying to organize the packages based on their top level folders.
Thank you again for the help - much appreciated!Jane Lee
01/24/2024, 5:35 PM- Root
- com.mypackage.main
- com.anotherpackage.base
- com.devbase.presentation
- com.devbase.presentation.base
- com.devbase.presentation.recyclerview
- com.devbase.presentation.recyclerview.endless
- com.morepackages.base
Oleg Yukhnevich
01/24/2024, 6:39 PMJane Lee
01/24/2024, 6:50 PM- Root
- com.mypackage.main
- com.anotherpackage.base
- com.devbase.presentation
- com.devbase.presentation.base
- com.devbase.presentation.recyclerview
- com.devbase.presentation.recyclerview.endless
- com.morepackages.base
java -jar dokka-cli-1.9.10.jar \
-pluginsClasspath "./dokka-base-1.9.10.jar;./analysis-kotlin-descriptors-1.9.10.jar;./kotlinx-html-jvm-0.8.0.jar;./freemarker-2.3.31.jar" \
-sourceSet "-src /Users/jane/Projects/dokka-test/Data -src /Users/jane/Projects/dokka-test/Presentation"\
-outputDir "./documentation/dokka/html"
Oleg Yukhnevich
01/24/2024, 7:19 PMjson
(https://kotlinlang.org/docs/dokka-cli.html#run-with-json-configuration)
2. the workflow is that first you will need to run dokka cli over each project/module and then run dokka one more time with aggregated results
3. I will attach 2 JSON configurations from my project (cryptography-kotlin), I've omitted some details regarding multiplatform, so may be you will need to add/remove/changes some values there.
4. When running dokka for projects you will need to set delayTemplateSubstitution=true
in json (example in core.json
)
5. When running dokka for aggregation you will need to provide an array modules
with names/paths to outputs of dokka execution results from previous steps ; delayTemplateSubstitution=false
(example in multimodule.json
)
Hope this helps! feel free to ask additional questions, I will try to help πJane Lee
01/25/2024, 1:47 AM{
"moduleName": "dokka-test",
"moduleVersion": "0.1",
"outputDir": "/Users/jane/Projects/dokka-test/documentation",
"pluginsClasspath": [
"./dokka-base-1.9.10.jar",
"./kotlinx-html-jvm-0.8.0.jar",
"./analysis-kotlin-descriptors-1.9.10.jar",
"./freemarker-2.3.31.jar"
],
"pluginsConfiguration": [],
"modules": [
{
"name": "data",
"relativePathToOutputDirectory": "data",
"includes": [
"/Users/jane/Projects/dokka-test/data/README.md"
],
"sourceOutputDirectory": "/Users/jane/Projects/dokka-test/data/build/dokka/htmlPartial"
},
{
"name": "presentation",
"relativePathToOutputDirectory": "presentation",
"includes": [
"/Users/jane/Projects/dokka-test/presentation/parentProjectA/ModuleA.md"
],
"sourceOutputDirectory": "/Users/jane/Projects/dokka-test/presentation/build/dokka/htmlPartial"
}
],
"failOnWarning": false,
"delayTemplateSubstitution": false,
"suppressObviousFunctions": true,
"suppressInheritedMembers": false,
"finalizeCoroutines": true
}
where data and presentation are folders at the root of my projectOleg Yukhnevich
01/25/2024, 9:06 AMI didn't see any references to the above in any of the docsSad, but no, there is no documentation for building multi-module documentation via CLI π Regarding your issue - totally forgot - you need also to add dokka
all-modules-page-plugin
(which enabled multi-module behaviour) and templating-plugin
jars when running aggregate taskOleg Yukhnevich
01/25/2024, 2:56 PMJane Lee
01/26/2024, 12:53 AMOleg Yukhnevich
01/26/2024, 12:17 PMmultimodule.json
in modules
array, field name
is case-sensitive π
Now you modules have names Source
and Apps
(in apps/source json), but in multimodule.json
you use source
and apps
I've changed them to be the same and everything works now!Jane Lee
01/26/2024, 5:09 PM- Data
- Source
- AnotherFolder
- demo
- OneMoreFolder
- main
Where Source has 2 folders within it, AnotherFolder
and OneMoreFolder
Thanks again for your help πOleg Yukhnevich
01/26/2024, 5:50 PMpluginClasspath
(but not sure, that every format will work fine with multi-module setup) What format do you want? And out of curiosity, why do you need other format? π
2. not right now. now it's possible only to have module-package-[class]-declarations
(class is optional, as there are top-level declarations). But feel free to create in issue on GitHub, with use-case why do you need this featureJane Lee
01/29/2024, 5:00 PMWhat format do you want? And out of curiosity, why do you need other format? π
I was more wondering about markdown as an alternative format, we have a use case to include some previously generated markdown files in the documentation that will explain some other parts of the system 1. not right now. now it's possible only to have
module-package-[class]-declarations
(class is optional, as there are top-level declarations). But feel free to create in issue on GitHub, with use-case why do you need this feature
Thanks, Iβll get this submitted
Thanks again for your help really appreciate it πJane Lee
01/30/2024, 10:48 PMgfm
plugin with the all-modules
plugin but there seems to be a conflict. Is there a way around this by any chance? Couldn't find any references in the docs or slack history unfortunately.
Exception in thread "main" java.lang.IllegalStateException: Conflicting overrides: [Extension: org.jetbrains.dokka.allModulesPage.AllModulesPagePlugin/multimoduleLocationProvider, Extension: org.jetbrains.dokka.gfm.GfmPlugin/locationProvider]
"pluginsClasspath": [
"./dokka/dependencies/dokka-base-1.9.10.jar",
"./dokka/dependencies/analysis-kotlin-descriptors-1.9.10.jar",
"./dokka/dependencies/freemarker-2.3.31.jar",
"./dokka/dependencies/all-modules-page-plugin-1.9.10.jar",
"./dokka/dependencies/templating-plugin-1.9.10.jar",
"./dokka/dependencies/gfm-plugin-1.9.10.jar"
],
As always appreciate the help πJane Lee
01/30/2024, 10:54 PMjava -jar ./dokka/dependencies/dokka-cli-1.9.10.jar \
-pluginsClasspath "./dokka/dependencies/dokka-base-1.9.10.jar;./dokka/dependencies/analysis-kotlin-descriptors-1.9.10.jar;./dokka/dependencies/kotlinx-html-jvm-0.8.0.jar;./dokka/dependencies/freemarker-2.3.31.jar;./dokka/dependencies/gfm-plugin-1.9.10.jar;" \
-sourceSet "-src /Users/jane/Projects/dokka-test/apps/demo/diagrams -src /Users/jane/Projects/dokka-test/apps/demo/linking" \
-outputDir "/Users/jane/Projects/dokka-test/dokka/build/docs"
But cannot use the json approach java -jar ./dokka/dependencies/dokka-cli-1.9.10.jar ./dokka/config/multimodule.json
Oleg Yukhnevich
02/05/2024, 11:34 AMgfm-template-processing-plugin
when generating multi-module documentation with GFMOleg Yukhnevich
02/05/2024, 11:35 AMJane Lee
02/06/2024, 1:22 AM# Module name_of_module
at the top of each readme and that matches the name of the source set mentioned (and case sensitive). I did however notice that the first line of the readme is displayed in the 'all-modules' screen but when clicking into the package itself the rest of the readme isn't shown. Would you have any idea what I'm missing here? This is the last thing i'm looking to solve so almost there π Thanks again for the help with everythingJane Lee
02/06/2024, 1:28 AM{
"moduleName": "App",
"moduleVersion": "0.1",
"outputDir": "/Users/jane/Projects/dokka-test/docs",
"pluginsClasspath": [
"./dokka/dependencies/dokka-base-1.9.10.jar",
"./dokka/dependencies/analysis-kotlin-descriptors-1.9.10.jar",
"./dokka/dependencies/freemarker-2.3.31.jar",
"./dokka/dependencies/all-modules-page-plugin-1.9.10.jar",
"./dokka/dependencies/templating-plugin-1.9.10.jar",
"./dokka/dependencies/annotations-24.1.0.jar",
"./dokka/dependencies/kotlin-stdlib-1.9.22.jar",
"./dokka/dependencies/gfm-template-processing-plugin-1.9.10.jar",
"./dokka/dependencies/gfm-plugin-1.9.10.jar",
"./dokka/dependencies/kotlin-stdlib-common-1.9.22.jar",
"./dokka/dependencies/kotlinx-html-jvm-0.8.0.jar"
],
"pluginsConfiguration": [],
"modules": [
{
"name": "demo-diagrams",
"relativePathToOutputDirectory": "apps/demo/diagrams",
"includes": [
"/Users/jane/Projects/dokka-test/apps/demo/diagrams/README.md"
],
"sourceOutputDirectory": "/Users/jane/Projects/dokka-test/dokka/build/docs/diagrams"
},
{
"name": "Extensions",
"relativePathToOutputDirectory": "apps/demo/extensions",
"includes": [],
"sourceOutputDirectory": "/Users/jane/Projects/dokka-test/dokka/build/docs/extensions"
},
{
"name": "linking",
"relativePathToOutputDirectory": "apps/demo/linking",
"includes": [
"/Users/jane/Projects/dokka-test/apps/demo/linking/README.md"
],
"sourceOutputDirectory": "/Users/jane/Projects/dokka-test/dokka/build/docs/linking"
}
],
"failOnWarning": false,
"delayTemplateSubstitution": false,
"suppressObviousFunctions": true,
"includes": [],
"suppressInheritedMembers": false,
"finalizeCoroutines": true
}
Oleg Yukhnevich
02/06/2024, 11:19 AMI did however notice that the first line of the readme is displayed in the 'all-modules' screen but when clicking into the package itself the rest of the readme isn't shown.This means, that
includes
which are passed into multimodule.json
are resolved correctly (and you see first line), but includes
are not resolved on side of the modules.
So in multi-module
case you will need to provide same files in includes
in both multimodule.json
and in projects configurations. For projects it should be in sourceSets.[i].includes
(example here: https://kotlinlang.org/docs/dokka-cli.html#source-set-configuration)Jane Lee
02/06/2024, 11:52 PMException in thread "main" java.lang.IllegalStateException: Unexpected classifier: "#", expected either "Module" or "Package".
though and adding it to the end of the file does not include it in the generated docs π€
For reference:
(no errors but not showing)
{
"moduleName": "linking",
"moduleVersion": "0.1",
"outputDir": "/Users/jane/Projects/dokka-test/dokka/build/docs/linking",
"sourceSets": [
{
"displayName": "linking",
"sourceSetID": {
"scopeId": ":linking:dokkaHtmlPartial",
"sourceSetName": "linking"
},
"classpath": [],
"sourceRoots": [
"/Users/jane/Projects/dokka-test/apps/demo/linking"
],
"samples": [
"/Users/jane/Projects/dokka-test/apps/samples"
],
"includeNonPublic": false,
"reportUndocumented": false,
"skipEmptyPackages": true,
"skipDeprecated": false,
"jdkVersion": 8,
"languageVersion": null,
"apiVersion": null,
"noStdlibLink": false,
"noJdkLink": false,
"suppressedFiles": [],
"analysisPlatform": "jvm",
"documentedVisibilities": [
"PUBLIC"
]
}
],
"pluginsClasspath": [
"./dokka/dependencies/dokka-base-1.9.10.jar",
"./dokka/dependencies/kotlinx-html-jvm-0.8.0.jar",
"./dokka/dependencies/suppress-undocumented-dokka-plugin-1.1.jar",
"./dokka/dependencies/analysis-kotlin-descriptors-1.9.10.jar",
"./dokka/dependencies/freemarker-2.3.31.jar",
"./dokka/dependencies/html-mermaid-dokka-plugin-0.4.6-javadoc.jar"
],
"pluginsConfiguration": [],
"modules": [],
"failOnWarning": true,
"delayTemplateSubstitution": true,
"suppressObviousFunctions": true,
"suppressInheritedMembers": true,
"finalizeCoroutines": true,
"includes": ["README.md"] -> tried absolute path here too
}
(error described above)
{
"moduleName": "linking",
"moduleVersion": "0.1",
"outputDir": "/Users/jane/Projects/dokka-test/dokka/build/docs/linking",
"sourceSets": [
{
"displayName": "linking",
"sourceSetID": {
"scopeId": ":linking:dokkaHtmlPartial",
"sourceSetName": "linking"
},
"classpath": [],
"sourceRoots": [
"/Users/jane/Projects/dokka-test/apps/demo/linking"
],
"samples": [
"/Users/jane/Projects/dokka-test/apps/samples"
],
"includes": ["README.md"],
"includeNonPublic": false,
"reportUndocumented": false,
"skipEmptyPackages": true,
"skipDeprecated": false,
"jdkVersion": 8,
"languageVersion": null,
"apiVersion": null,
"noStdlibLink": false,
"noJdkLink": false,
"suppressedFiles": [],
"analysisPlatform": "jvm",
"documentedVisibilities": [
"PUBLIC"
]
}
],
"pluginsClasspath": [
"./dokka/dependencies/dokka-base-1.9.10.jar",
"./dokka/dependencies/kotlinx-html-jvm-0.8.0.jar",
"./dokka/dependencies/suppress-undocumented-dokka-plugin-1.1.jar",
"./dokka/dependencies/analysis-kotlin-descriptors-1.9.10.jar",
"./dokka/dependencies/freemarker-2.3.31.jar",
"./dokka/dependencies/html-mermaid-dokka-plugin-0.4.6-javadoc.jar"
],
"pluginsConfiguration": [],
"modules": [],
"failOnWarning": true,
"delayTemplateSubstitution": true,
"suppressObviousFunctions": true,
"suppressInheritedMembers": true,
"finalizeCoroutines": true,
"includes": ["README.md"] -> tried absolute path here too
}
Oleg Yukhnevich
02/07/2024, 10:02 AM"includes": ["README.md"]
in root of the json doesn't work and will be silently ignored as it's used only for multi-module case as a root page
So you need to put it inside sourceSet.
Could you share README.md
(at least it structure)?
You can take a look on the structure which is supported: https://kotlinlang.org/docs/dokka-module-and-package-docs.html
so here you will need to have something like:
# Module linking
here goes docs
And as you have first paragraphs in multi-module, that means, that it's recognized there, could you try to provide the same file for project generation :
"includes": ["/Users/jane/Projects/dokka-test/apps/demo/linking/README.md"]
Jane Lee
02/08/2024, 12:20 AMreadme
I try to embed in the sourceSet I get this error Exception in thread "main" java.lang.IllegalStateException: Unexpected classifier: "#", expected either "Module" or "Package".
so the only place I can embed it is in the root of the json. It doesn't matter whether I use just the filename or the absolute path. So this structure does not work due to the error:
{
"moduleName": "linking",
"moduleVersion": "0.1",
"outputDir": "/Users/jane/Projects/dokka-test/dokka/build/docs/linking",
"sourceSets": [
{
"displayName": "linking",
"sourceSetID": {
"scopeId": ":linking:dokkaHtmlPartial",
"sourceSetName": "linking"
},
"classpath": [],
"sourceRoots": [
"/Users/jane/Projects/dokka-test/apps/demo/linking"
],
"samples": [
"/Users/jane/Projects/dokka-test/apps/samples"
],
"includes": ["/Users/jane/Projects/dokka-test/apps/demo/linking/README.md"],
"includeNonPublic": false,
"reportUndocumented": false,
"skipEmptyPackages": true,
"skipDeprecated": false,
"jdkVersion": 8,
"languageVersion": null,
"apiVersion": null,
"noStdlibLink": false,
"noJdkLink": false,
"suppressedFiles": [],
"analysisPlatform": "jvm",
"documentedVisibilities": [
"PUBLIC"
]
}
],
"pluginsClasspath": [
"./dokka/dependencies/dokka-base-1.9.10.jar",
"./dokka/dependencies/kotlinx-html-jvm-0.8.0.jar",
"./dokka/dependencies/suppress-undocumented-dokka-plugin-1.1.jar",
"./dokka/dependencies/analysis-kotlin-descriptors-1.9.10.jar",
"./dokka/dependencies/freemarker-2.3.31.jar",
"./dokka/dependencies/html-mermaid-dokka-plugin-0.4.6-javadoc.jar"
],
"pluginsConfiguration": [],
"modules": [],
"failOnWarning": true,
"delayTemplateSubstitution": true,
"suppressObviousFunctions": true,
"suppressInheritedMembers": true,
"finalizeCoroutines": true,
}
Jane Lee
02/08/2024, 12:22 AM"includes" : []
and it seems to be picking it up properly now π€·ββοΈ Either way it looks good to go - thank you again for all of the help πOleg Yukhnevich
02/08/2024, 10:20 AMJane Lee
02/08/2024, 3:22 PMJane Lee
03/11/2024, 4:41 AMsourceRoots
and multimodule outputDir
using the approach we discussed above? I see there's support for relative paths In certain scenarios but I'm hoping to be able to use it for all module generation so each member of the team doesn't have to manually change/specify this on their endOleg Yukhnevich
03/11/2024, 8:22 AMsourceRoots