-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Documentation rendering default value lists #43901
Comments
Files identified in the description: If these files are inaccurate, please update the |
Hi @LindsayHill, Thank you for the issue, just so you are aware we have a dedicated Working Group for network. |
Interesting. This looks correct back in the 2.5 docs: https://docs.ansible.com/ansible/2.5/modules/dellos10_facts_module.html#dellos10-facts-module |
I thought you might have been onto something there - but check out this cdd21e2#diff-34b216cf1a4209713450c4ef05a6a77a - the reason it looks OK in 2.5, but not 2.6 is because the underlying module had some cleanups, replacing the |
@LindsayHill oh, fascinating. So it "looks" correct but only because the underlying data was different, not because we were rendering it differently. We have done a lot of cleanup on the defaults in the module docs, but the look could definitely be improved. I've added this to the agenda for tomorrow's docs working group meeting - see ansible/community#389 (comment). Thanks for the PR - if we reach consensus that showing the |
SUMMARY
Lists in docstrings are rendered in HTML and
ansible-doc
with Python Unicode-notation, e.g.[u'!config']
. I believe it is more human-readable to render it as['!config']
ISSUE TYPE
COMPONENT NAME
dellos10_facts
ANSIBLE VERSION
CONFIGURATION
Not relevant - this appears in public docs site, e.g. https://docs.ansible.com/ansible/devel/modules/dellos10_facts_module.html#dellos10-facts-module
OS / ENVIRONMENT
N/A
STEPS TO REPRODUCE
NB: This applies to multiple modules, I am just using dellos10_facts as an example here.
1/ Create docstring section in Ansible module, containing a default value that is a list. For example https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/dellos10/dellos10_facts.py#L38
The
gather_subset
parameter has default value:default: [ '!config' ]
2/ View rendered HTML documentation or output of
ansible-doc dellos10_facts
.Look at the
gather_subset
section of the HTML or ansible-doc output.EXPECTED RESULTS
I expected the results to contain a
[!config]
line for the default value forgather_subset
, e.g.:I expected the HTML output to contain
['!config']
ACTUAL RESULTS
Note it looks like this:
Or in the HTML output:
The text was updated successfully, but these errors were encountered: