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
webdocs: Differentiate between type and required #42888
Conversation
Now that parameters have their (non-string) type indicated in the module docs, it becomes harder to tell which parameter is required, and what is the type. (Mostly because both are red and positioned similarly). Furthermore, if a non-string parameter is required, both are now indicated subsequently. This change makes required parameters stand out by adding asterisks to the parameter name (in red) with an explanation at the bottom.
IMO I like |
I agree that the current version looks ugly (especially when both How about changing the styles instead? (I think we should also start using CSS classes instead of directly formatting everything inline :) ) An idea: use different colors for types and |
You have to consider that the first cell holds 4 pieces of information currently:
I only noticed myself recently that someone added parameter type (with the same color) to the first cell, just like was already practice for result values. So the usability problems are:
So the easiest to make a parameter stand out is using asterisks (this is a common convention, using asterisks means a required field). This doesn't break the visual convention because it's positioned elsewhere. That's why it was done like this, to keep things consistent. |
@felixfontein We should be using CSS, however we were told earlier nobody was allowed to touch the CSS styles, so we started doing it like this (eventually it being turned into CSS by @dharmabumstead). |
Someone proposed adding another column, but it used to be like that and more columns is not the best use of screen-estate. See:
|
making the name of required fields bold or red (both?) should work, as long as on top of the table we have 'X means the field is required' .. which is a pretty common pattern in docs. |
@dagwieers I think I added the type name, following a suggestion by you (see #41999 and #41905). I fully agree that having another column is not good either :) @bcoca I wouldn't make it red, because we already use red for parameter types. But bold seems like a good idea as well (essentially what @dagwieers proposed, except that it is bold instead of having an asterisk). Maybe we should make it both bold and add an asterisk? |
Coming back to this. When a parameter is required, it does not have a default. |
This is superseded by #49966. |
SUMMARY
Now that parameters have their (non-string) type indicated in the module
docs, it becomes harder to tell which parameter is required, and what is
the type. (Mostly because both are red and positioned similarly).
Furthermore, if a non-string parameter is required, both are now
indicated subsequently.
This change makes required parameters stand out by adding asterisks to
the parameter name (in red) with an explanation at the bottom.
ISSUE TYPE
COMPONENT NAME
Module docs
ANSIBLE VERSION
v2.7