-
Notifications
You must be signed in to change notification settings - Fork 418
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
Add All Types
page generation
#3267
Conversation
Superb work, thank you for the description and the screenshots!
Huh, we indeed forgot about this corner case. I wonder if "no documentation" is better than "some documentation", even if "some documentation" is not complete. What I mean is: right now, if @ilya-g do you have any thoughts on that? Maybe some stdlib cases come to mind where it would be beneficial or undesirable?
Is there a way to avoid the whitespace in the filename, and maybe have a different filename altogether? That is, have the page be "All Types", but the html file be |
This is also a bit of a technical limitation, right? If I remember correctly, the navigation tree resets (or even throws an error) if you visit an html page that has no line in the navigation sidemenu. If this is the case, then removing the |
Regarding documentation block selection:
Found how to fix this in rather simple way, will do, thanks for pointing on it! |
Yes and no I believe. Because |
In the old dokka it was hard coded to something like "if there's no common documentation, use the one from JVM". I think too that in this case it would be better to show some summary (e.g. common documentation). |
Update:
|
plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
Outdated
Show resolved
Hide resolved
typelike.descriptions[sourceSet]?.let { sourceSet to it } | ||
}.distinctBy { it.second }.singleOrNull() | ||
|
||
val customTags = typelike.customTags.values.mapNotNull { sourceSetTag -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to show all custom tags, e.g. author
, throws
and so on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I see from code, author and throws are not custom tags.
In our codebase there are 2 custom tags provider: SinceKotlin and Mathjax
Still, may be we really need to show SinceKotlin only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I see from code, author and throws are not custom tags.
Oh, sorry, I forgot(
Still, may be we really need to show SinceKotlin only
I think it should be consistent with a list of types in a regular page (package, classlike ..) so showing all custom tags is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks as if it can get SinceKotlin
and the description from different source sets, which might be misleading, as there might be cases when a type's actual was added later (like ConcurrentModificationException)
I think the logic here needs to be predetermined and intentional. I can think of two solutions, but both have drawbacks
- Get
SinceKotlin
from the same source set as the description. Drawback: if the description is taken from JVM, common'sSinceKotlin
might be lower/higher. - Get the earliest
SinceKotlin
. Drawback: it might be inconsistent with the text in the description.
Wouldn't hurt consulting Ilya about this
Still, may be we really need to show SinceKotlin only
I don't think it's a problem for now, and hardcoding it is less than ideal, so I'd leave it as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ilya-g what are your thoughts regarding comment above about best (more correct) way of showing SinceKotlin
/description when they are different per source set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd propose to do the same as in the old dokka: showing the minimum version among those remained after filtering with platform selector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Now we take minimum SinceKotlin
version in All Types page. Implemented in d744e49
Though, it's not affected by platform selector and will only show minimum version based on all platforms, as it looks like it's not possible to show different content based on different set of platform selectors.
Also I've checked how current stdlib documentation behaves, and looks like it doesn't show SinceKotlin
at all if they are different per sourceSet + no changes after filtering by platform.
Here is an example for kotlin.ConcurrentModificationException:
So I would propose to go for now without additional filtering based on selected platforms. And implement it later if needed. @ilya-g WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this question with Oleg, and it looks like we indeed don't have the technical ability to change the value dynamically based on platform selectors.
Implementing it would take considerable time, and it doesn't seem to be that critical for the initial release, so let's just merge the PR with the currently implemented and consistent logic: always show the earliest version
We can change it later on if it becomes apparent that it's misleading or is a problem
plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
Outdated
Show resolved
Hide resolved
plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed most of these in voice, so I didn't go into too much detail. Leaving the comments to not forget about something
plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
Outdated
Show resolved
Hide resolved
plugins/base/src/main/kotlin/renderers/html/NavigationDataProvider.kt
Outdated
Show resolved
Hide resolved
plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
Outdated
Show resolved
Hide resolved
plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt
Outdated
Show resolved
Hide resolved
typelike.descriptions[sourceSet]?.let { sourceSet to it } | ||
}.distinctBy { it.second }.singleOrNull() | ||
|
||
val customTags = typelike.customTags.values.mapNotNull { sourceSetTag -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks as if it can get SinceKotlin
and the description from different source sets, which might be misleading, as there might be cases when a type's actual was added later (like ConcurrentModificationException)
I think the logic here needs to be predetermined and intentional. I can think of two solutions, but both have drawbacks
- Get
SinceKotlin
from the same source set as the description. Drawback: if the description is taken from JVM, common'sSinceKotlin
might be lower/higher. - Get the earliest
SinceKotlin
. Drawback: it might be inconsistent with the text in the description.
Wouldn't hurt consulting Ilya about this
Still, may be we really need to show SinceKotlin only
I don't think it's a problem for now, and hardcoding it is less than ideal, so I'd leave it as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job and thank you for addressing so many review comments!
...a-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/pages/AllTypesPageNode.kt
Show resolved
Hide resolved
...a-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/pages/AllTypesPageNode.kt
Show resolved
Hide resolved
Co-authored-by: Ignat Beresnev <ignat.beresnev@jetbrains.com>
Co-authored-by: Ignat Beresnev <ignat.beresnev@jetbrains.com>
Platform.wasm to SinceKotlinVersion("1.8"), | ||
) | ||
|
||
fun minSinceKotlinVersionOfPlatform(platform: Platform): SinceKotlinVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: since this was moved into SinceKotlinVersion
, I think it can be renamed to be just minVersionOfPlatform
, so that the call looks like SinceKotlinVersion.minVersionOfPlatform()
instead of duplicating SinceKotlinVersion.minSinceKotlinVersionOfPlatform()
// the structure of custom tag content for SinceKotlin should be in sync | ||
// with how DefaultPageCreator.contentForAllTypes reads it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also not that critical, but if the two parts must be in sync, it makes sense to have them in a single place. For instance,
// inside one class or file and next to each other, maybe inside SinceKotlinVersion
fun createSinceKotlinCustomTag(): CustomTagWrapper { ... }
fun extractSinceKotlinFromCustomTag(customTagWrapper: CustomTagWrapper): SinceKotlinVersion? {}
The benefit of having these two things next to each other is that you see clearly the correlation between the two, and if one changes - it'll be easier to find and remember to change the other. And you'll be able to reference it in the KDoc
Fixes #2887
Notes:
Packages
block on module page for all formats**/htmlMultiModule/kotlinx-coroutines-core/index.html
**/htmlMultiModule/kotlinx-coroutines-core/all-types.html
Preview of how it will look like with kotlinx-coroutines codebase:
All Types page
Link to All Types page on module page
When there are no types in module
Since Kotlin