-
Notifications
You must be signed in to change notification settings - Fork 1
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
Modules are not documented properly in Ansible Collection #161
Comments
We'll want to make sure that reference links from one piece of documentation to the other use the refence macros: https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html#format-macros-within-module-documentation |
I don't know if this docs/ format was ever conventional. If it was there may be scripts or helpers, like ansible-docs, to convert from the old format to the new. |
The examples and return blocks, which are currently found in the md files, would be documented in this format: https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html#examples-block |
My previously stated assumptions about why the collection documentation is not appearing in Ansible Galaxy seems incorrect: As we see here, the module is documented in the format described in the reference links. The problem and question remains - why is this not rendering correctly in Ansible Galaxy? |
@displague I looked around. We use ansible-specdoc to generate those docstrings, just like linode, and modules in their collection are not rendered properly either: I don't think we can regress to write the docs by hand, it's unfeasible at this point, so the way is to (help) fix it in ansible-specdoc. I will try to find out what the problem is. In the meantime I reported it in ansible-specdoc: I think this is the way to check the doc format:
Returns
|
I noticed that the only inventory or module that does appear in Galaxy is https://github.com/equinix-labs/ansible-collection-equinix/blob/main/docs/inventory/metal_device.rst, which uses Restructured text instead of Markdown (any other significant changes in how this is generated?) |
https://github.com/a10networks/a10-acos-axapi is an example of a project whose documentation is shown in Galaxy: https://galaxy.ansible.com/ui/repo/published/a10/acos_axapi/content/module/a10_aam_aaa_policy/ (given as the example only because they are alphabetically at the top of the list) |
I wonder if
|
problem seem to be the to
and call In short, RETURN must be clear and valid YAML. |
We have no docs generated for modules in ansible galaxy. It's because docstrings in module were not valid yaml. This PR fixes specdoc based on which docstrings are generated, and adds a check during docs generation, that ansible-doc can parse module docstrings. fixes #161
This issue has been resolved in version 0.4.1 🎉 |
SUMMARY
Per https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_documenting.html
Ansible collection documentation must be defined within each module,
https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html#module-documenting for more details.
What this project does today is include a docs/ directory (https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_structure.html#collections-doc-dir) and use https://github.com/linode/ansible-specdoc to generate the module documentation within the .py files.
Neither the docs/ documentation nor the representation of that documentation in the .py files appear in the Ansible Galaxy view:
https://galaxy.ansible.com/ui/repo/published/equinix/cloud/content/module/metal_device/
The one resource that uses the Ansible Galaxy compatible documentation approach is the inventory plugin for Metal Devices: https://galaxy.ansible.com/ui/repo/published/equinix/cloud/content/inventory/metal_device/.
Notice how every other documentation link is empty.
Move the documentation to the modules themselves.
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
The text was updated successfully, but these errors were encountered: