Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi Module documentation, requires README.md, and includes of file with duplicate content. #1265

Closed
KotlinIsland opened this issue Aug 5, 2020 · 7 comments · Fixed by #1387
Assignees
Labels
enhancement An issue for a feature or an overall improvement runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Milestone

Comments

@KotlinIsland
Copy link

If you want to document a module within a multi module project, you have to add a README.md file to each module, but also add and includes a modules.md file with the same(presumably) content for it to be included in the non-modules doc view:
image

This seems a little redundant, messy and inconsistent.

@KotlinIsland KotlinIsland added the enhancement An issue for a feature or an overall improvement label Aug 5, 2020
@KotlinIsland
Copy link
Author

Maybe if multimodule, automatically add the documentation of the modules to the individual module view.

@floscher
Copy link

floscher commented Aug 7, 2020

@KotlinIsland AFAICS it seems possible to add the module description at the very beginning of the README.md of the subprojects:

# Module ‹name of the module›

‹one paragraph of module description›

Note: If there is anything before the heading, Dokka currently throws an java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at

it[1].split(Regex("\n"), 2) // Matches new line after fully qualified name

Then in the Gradle build script:

tasks.withType(DokkaTask::class) {
  dokkaSourceSets {
    configureEach {
      includes = listOf("README.md", "packages.md")
    }
  }
}

But I don't particularly like this solution. In my opinion, Dokka should (as you suggested) rather pull the module description from the modules.md or packages.md (as described in https://kotlinlang.org/docs/reference/kotlin-doc.html#module-and-package-documentation).

Then packages.md/modules.md would be files with a fixed structure from which Dokka can pull the descriptions and the developers could format the README.md however they want, without Dokka enforcing a certain formatting.

@sellmair
Copy link
Member

@KotlinIsland: Very fair point. Agree with you.
We will probably merge #1194 first and I will try to make this easier/more intuitive afterwards!

@sellmair sellmair added this to the 1.4.10 milestone Aug 10, 2020
@sellmair sellmair added the runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin label Aug 10, 2020
@sellmair
Copy link
Member

I think #1136 should also be tackled together with this.
Will start working on evaluating proposals soon.

@sellmair
Copy link
Member

Dokka Multi-Module will not require any module description files anymore! If you specified any includes in the project, those will be automatically included ☺️

@zach-klippenstein
Copy link

Was the README issue fixed as well? I'm using version 1.4.0 and Dokka still seems to require README files in every module.

@sellmair
Copy link
Member

This will be available in 1.4.10 ☺️ 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue for a feature or an overall improvement runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants