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

Setup Dokka to generate html docs and document most our external functions and properties #52

Merged
merged 7 commits into from
Feb 12, 2024

Conversation

maxme
Copy link
Contributor

@maxme maxme commented Feb 8, 2024

Setup Dokka to generate html docs and document most our external functions and properties

Dokka and gradle configuration cache are not compatible. We could disable gradle configuration cache or add a workaround, I picked the latter solution and added notCompatibleWithConfigurationCache() when required.

A few notes:

  • I tried to use Gravatar with a capital "G" everywhere in the documentation and public messages (eg. error logs).
  • Obvious but we should make methods and classes internal or private to hide them from users and also hide them in the docs.
  • When possible (eg. default avatars) I picked the text from docs.gravatar.com to make sure it was consistent.
  • All our docs should end up in docs/. Generated documentation should be git ignored. I'm not sure yet where we'll store the generated docs, probably under docs.gravatar.com, so let's try to avoid duplicates.

@maxme maxme requested a review from hamorillo February 8, 2024 14:35
@hamorillo
Copy link
Contributor

Obvious but we should make methods and classes internal or private to hide them from users and also hide them in the docs.

Aggree, it's obvious but it's not so evident when working on the code. It's out of the scope of this PR but we should take a look a the Explicit API mode. I've made a quick test and I think it's exactly what we need.

For example, right now, we are generating doc for the HttpResponseCode which doesn't make sense because it's something internal. With the explicitAPI enabled, we'll see compilating error:

image

I'll create a ticket for working on it next week and discuss over a PR.

Copy link
Contributor

@hamorillo hamorillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ Awesome work!

build.gradle.kts Outdated
Comment on lines 17 to 20
tasks.withType<DokkaTask>().configureEach {
notCompatibleWithConfigurationCache("https://github.com/Kotlin/dokka/issues/2231")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Why do we need this in the project build.gradle? We only want to apply it to the SDK module.

Copy link
Member

@mlumeau mlumeau Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want to apply it to the SDK module.

And ultimately, every library module if/when we split the SDK in separate components. The only module where we won't need it is the test app.

Copy link
Contributor Author

@maxme maxme Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this in the project build.gradle?

That's a remainder of the configuration cache issues and workaround. I tried to move everything to the sub-module and it seems to work fine, so I'll move it there. We can change it later: when we add more modules or if it's still causing issues.

@maxme
Copy link
Contributor Author

maxme commented Feb 12, 2024

I'll create a ticket for working on it next week and discuss over a PR.

Sounds good!

Copy link
Contributor

@hamorillo hamorillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Awesome!

@maxme maxme merged commit 9a2aea8 into trunk Feb 12, 2024
2 checks passed
@maxme maxme deleted the maxime/33-generate-html-docs-via-dokka branch February 12, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants