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

Improve versioning plugin #2104

Merged
merged 4 commits into from
Sep 20, 2021
Merged

Improve versioning plugin #2104

merged 4 commits into from
Sep 20, 2021

Conversation

vmishenev
Copy link
Contributor

@vmishenev vmishenev commented Aug 31, 2021

  • support for single module projects
  • version navigator is on all pages
  • dropdown arrow for version navigator

NOTE
I removed versioning plugin dependency from multimodule plugin.

image

@vmishenev vmishenev force-pushed the versioning-plugin-single-module branch 4 times, most recently from e3ad4ab to 48bafab Compare August 31, 2021 23:09
@vmishenev vmishenev linked an issue Sep 1, 2021 that may be closed by this pull request
@vmishenev vmishenev force-pushed the versioning-plugin-single-module branch from 48bafab to e572f7c Compare September 1, 2021 02:52
- support for single module projects
- version navigator is on all pages
- dropdown arrow for version navigator
@vmishenev vmishenev force-pushed the versioning-plugin-single-module branch 2 times, most recently from 372ba3d to 7d8bdc9 Compare September 1, 2021 13:43
@vmishenev vmishenev force-pushed the versioning-plugin-single-module branch from 7d8bdc9 to 96a6647 Compare September 1, 2021 14:32
@vmishenev vmishenev requested a review from MarcinAman September 1, 2021 15:32
plugins/base/src/main/kotlin/DokkaBase.kt Outdated Show resolved Hide resolved
context.plugin<TemplatingPlugin>().query { templateProcessingStrategy }

override fun invoke() {
versioningHandler.previousVersions.onEach { (_, dirs) -> copyVersion(dirs.src, dirs.dst) }
Copy link
Contributor

Choose a reason for hiding this comment

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

.forEach? or drop .toMap()

Copy link
Contributor

Choose a reason for hiding this comment

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

also: why do you need a destination in previous versions rather than resolve this destination from outputDir + version number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use the version source to resolve a link in VersionsNavigationCreator . I check is there a needed file in the corresponding version source folder to avoid generating the invalid links (In the navigator such version will be strikethrough). At the copying (also creating navigator) moment the destination folder can't be used since not all version folder are copied.

@@ -9,6 +9,7 @@ data class VersioningConfiguration(
var olderVersions: List<File>? = defaultOlderVersions,
var versionsOrdering: List<String>? = defaultVersionsOrdering,
var version: String? = defaultVersion,
var isOnlyOnRootPage: Boolean? = defaultIsOnlyOnRootPage
Copy link
Contributor

Choose a reason for hiding this comment

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

what is only on root page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default it supports the old behavior The navigator was only on root page in the old plugin.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, i know because i know how it worked in the past, but users won't have the same perspective. Maybe renderVersionsNavigationOnAllPages? Because i am not so sure that people will know what is a RootPage

@vmishenev vmishenev requested a review from MarcinAman September 2, 2021 17:16
@@ -9,6 +9,7 @@ data class VersioningConfiguration(
var olderVersions: List<File>? = defaultOlderVersions,
var versionsOrdering: List<String>? = defaultVersionsOrdering,
var version: String? = defaultVersion,
var isOnlyOnRootPage: Boolean? = defaultIsOnlyOnRootPage
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, i know because i know how it worked in the past, but users won't have the same perspective. Maybe renderVersionsNavigationOnAllPages? Because i am not so sure that people will know what is a RootPage

if (isExistsFile)
text(version)
else
strike { text(version) }
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if everyone will know why some versions are crossed out. Can we have some tooltip or any other form of informing documentation user that this is not present in certain version. Maybe Eugene / Mike will have a better idea for that

@vmishenev vmishenev force-pushed the versioning-plugin-single-module branch from 56ee58d to 119dc2f Compare September 9, 2021 23:17
@vmishenev
Copy link
Contributor Author

vmishenev commented Sep 9, 2021

I've set renderVersionsNavigationOnAllPages to true by default.
But important -- the plugin should be enabled in all submodules to render the navigator on all pages since it adds needed stylesheet in submodules pages. It can require to reconfigure existed multimodule projects.

@vmishenev vmishenev force-pushed the versioning-plugin-single-module branch from 119dc2f to 7fd9421 Compare September 9, 2021 23:45
@MarcinAman
Copy link
Contributor

I've set renderVersionsNavigationOnAllPages to true by default.
But important -- the plugin should be enabled in all submodules to render the navigator on all pages since it adds needed stylesheet in submodules pages. It can require to reconfigure existed multimodule projects.

Please write it in the docs

@vmishenev vmishenev force-pushed the versioning-plugin-single-module branch 2 times, most recently from 80550ae to e805aed Compare September 17, 2021 14:07
Copy link
Contributor

@MarcinAman MarcinAman left a comment

Choose a reason for hiding this comment

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

Minor comments, LGTM!

@vmishenev vmishenev force-pushed the versioning-plugin-single-module branch from e805aed to 24d41b3 Compare September 20, 2021 13:47
@vmishenev vmishenev merged commit c1efae4 into master Sep 20, 2021
vmishenev added a commit that referenced this pull request Sep 20, 2021
- support for single module projects
- version navigator is on all pages
- dropdown arrow for version navigator
@adam-enko adam-enko deleted the versioning-plugin-single-module branch September 30, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants