-
Notifications
You must be signed in to change notification settings - Fork 9
Make order of options from argument_specs.yml configurable #253
Comments
The only two tools I am aware of that render argument_specs.yml are ansible-doc (part of ansible-core) and antsibull-docs. Both tools always sort options (and sub-options and return values etc.) alphabetically. The only exception are positional arguments for test and filter plugins when rendered by antsibull-docs, these are in the order specified (there is a field
Right now antsibull-docs obtains the documentation for plugins, modules, and roles from the ansible-doc JSON output, in which every dictionary is sorted by key name. |
Ignoring the above, I like the idea of being able to group options by topic. Especially roles can have a large amount of options, due to many things that can be fine-tuned. On the other hand, one could also argue that things that require too many inputs are not well designed and should be broken up into smaller parts. And there's also the argument that allowing to specify the order freely would allow roles to have a messy order that makes it harder for folks to find what they are looking for. (Which was one of the reasons why the options are ordered by alphabet - I think they weren't always; at least the ones for modules.) |
I would definitely second a way for grouping options by topic, and not just for roles. The Grouping would be perfect for this. |
Yes, grouping would be fine. Inside the groups the parameters then can be sorted alphabetically again, the groups themselves should also have some kind of identifier/name. |
From the WG meeting: - This one requires core involvement, and probably first a proper proposal - especially if it should also cover plugins and modules (cause of docs fragments) |
This issue looks stale, so let's close it. If it's something we should work on, I suggest to open a topic in the forum. |
Summary
When docs for ansible roles with argument_specs.yml files are built, the options of the argument_specs are always displayed in alphabetical order in the output html. Sometimes it would be better to be able to specify a different order, for example with deeply nested parameter structures.
To solve this problem, I propose that a new configuration option in argument_specs should be introduced to be able to configure the order. One option should be to configure it so the output html will be ordered the same as it is written in the argument_specs.yml. The other (default) option should be to leave it in alphabetical order.
Thoughts?
Additional Information
No response
The text was updated successfully, but these errors were encountered: