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

Allow to specify order of modules in the multi-module documentation page in DokkaMultiModuleTask #2849

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilya-g
Copy link
Member

@ilya-g ilya-g commented Feb 6, 2023

Allow to specify order of modules in the multi-module documentation page in DokkaMultiModuleTask and then preserve that order of modules in other places.

…age in DokkaMultiModuleTask

And then preserve that order of modules in other places.

class AddToNavigationCommandHandler(val context: DokkaContext) : CommandHandler {
private val navigationFragments = ConcurrentHashMap<String, Element>()
private val navigationFragments = Collections.synchronizedList(mutableListOf<Pair<String, Element>>())
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know why a ConcurrentHashMap was there. Is it supposed to work in a multi-threaded context?

Comment on lines +55 to +57
@Internal
val moduleOrder: Property<DokkaMultiModuleOrder> = project.objects.safeProperty<DokkaMultiModuleOrder>()
.safeConvention(DokkaMultiModuleOrder.Default)
Copy link
Member Author

Choose a reason for hiding this comment

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

This has a problem that such property is not included in the cache key, therefore changing just the order won't rebuild the documentation.

@ilya-g
Copy link
Member Author

ilya-g commented Feb 6, 2023

Perhaps another approach for ordering would be to introduce some new property, Int or String, in the Dokka partial task, so that the modules will be sorted first by the specified property value (nulls last), and then by their relative path as they are sorted now.

@IgnatBeresnev
Copy link
Member

This has the potential to fix #1868

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.

2 participants