overview icon indicating copy to clipboard operation
overview copied to clipboard

How to generate collection docs from module docs?

Open amarao opened this issue 4 years ago • 5 comments

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?

amarao avatar Jul 27 '20 07:07 amarao

Just for example, here is my current collection I'm working with: https://github.com/amarao/collection_ip

amarao avatar Jul 27 '20 07:07 amarao

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

rhysmeister avatar Jul 27 '20 08:07 rhysmeister

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/

felixfontein avatar Jul 27 '20 08:07 felixfontein

@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.

gundalow avatar Jul 27 '20 12:07 gundalow

See: https://github.com/ansible/galaxy/issues/2225

geerlingguy avatar Jul 27 '20 12:07 geerlingguy