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

Add option to define arbitrary annotations #785

Open
pat-s opened this issue Oct 4, 2024 · 4 comments
Open

Add option to define arbitrary annotations #785

pat-s opened this issue Oct 4, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@pat-s
Copy link

pat-s commented Oct 4, 2024

It looks like the sub-types are hard-coded in

"subtypes": ["value", "example", "description", "type", "deprecated"],
. Adding another one to a custom template is not getting picked up by the parser.

In case I am right and it is not possible - would be a great feature :)

@xoxys
Copy link
Member

xoxys commented Oct 4, 2024

That is correct, and I don't think we should allow adding user-defined ones. Maybe you can explain your use-case a bit more. In general, Ansible roles and collections should be self-explaining anyway, and the project was meant to be used to add some useful context that can be rendered out to an overview page. If you have pretty complex roles, writing a detailed documentation from scratch might be the better choice.

@xoxys
Copy link
Member

xoxys commented Oct 4, 2024

Implementing #763 might help as well, but also doesn't allow arbitrary fields.

@xoxys xoxys changed the title Defining arbitrary annotations? Add option to define arbitrary annotations Oct 4, 2024
@xoxys xoxys added the enhancement New feature or request label Oct 4, 2024
@pat-s
Copy link
Author

pat-s commented Oct 4, 2024

I wanted to add another column that shows whether a variable is required or optional.
I document both variables in the variable table (i.e. also the ones that are not defined). I prefer not defining them instead of setting them to "" as I like to use the is defined pattern.
Hence, I add them to defaults/main.yml and comment them out (but still add tags for them so that they get processed by ansible-doctor). TBH I was missing this for a long time in ansible and think that the lack of a proper documentation skeleton is a big downside (hence I was very happy to stumble across ansible-doctor now - just need to tweak it a bit ;)).

While I could also add this information implicitly inside the variable name itself somehow, having a dedicated table that lists both required and optional vars with a column stating this respectively, seems like a good default.

I understand that it is not feasible to add custom columns every now and then, also everyone might have a different opinion on naming etc. So allowing to specify them in an array in a custom template seems like a good solution?

@xoxys
Copy link
Member

xoxys commented Jan 13, 2025

I'm fine to implement a required annotation subtype for vars as I think it makes sense, but Im against adding an option for user configured subtypes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants