overview
overview copied to clipboard
How to generate collection docs from module docs?
SUMMARY
Is there a way to add module docs in the web-interface of galaxy.ansible.com?
ISSUE TYPE
- Bug?
- Doc request?
- Feature request?
Details
I have a collection with few modules. Modules are written in accordance to guidelines for modules (for Ansible 2.9+). They have docstrings (DOCUMENTATION
, EXAMPLES
, RETURN
).
I want to add them to the user-visible docs for modules at galaxy.ansible.com. Are there any good practices for that? Can it be done automatically by galaxy, or should I extract those docs at build time and add to the Readme?
Just for example, here is my current collection I'm working with: https://github.com/amarao/collection_ip
Hello @amarao,
Funnily enough I've been working on something like this over the weekend. I publish to github pages rather than galaxy but you could probably adapt it for your own needs. See here https://ansible-collections.github.io/community.mongodb/
The workflow that generates these pages can be found at https://github.com/ansible-collections/community.mongodb/blob/master/.github/workflows/documentation.yml
Cheers,
Rhys
I'm not aware of plans to automatically generate docs on galaxy (at least nothing in the near future). The tooling to create docs from modules and plugins is currently under development, but already usable. This article describes how it can be done: https://www.die-welt.net/2020/07/building-documentation-for-ansible-collections-using-antsibull/
@rhysmeister Mongodb docs are now here (along with all docs included in Ansible 2.10) https://docs.ansible.com/ansible/2.10/collections/index.html
See https://github.com/ansible-collections/overview/issues/45#issuecomment-663181420 for background.
See: https://github.com/ansible/galaxy/issues/2225