2018-09-11 18:51:47 +02:00
:orphan:
2018-10-24 17:14:01 +02:00
.. _testing_module_documentation:
2018-09-07 15:57:36 +02:00
2018-10-24 17:14:01 +02:00
***** ***** ***** ***** ***** ***
Testing module documentation
***** ***** ***** ***** ***** ***
2018-09-07 15:57:36 +02:00
2018-10-24 17:14:01 +02:00
Before you submit a module for inclusion in the main Ansible repo, you must test your module documentation for correct HTML rendering and to ensure that the argspec matches the documentation in your Python file. The community pages offer more information on :ref: `testing reStructuredText documentation <testing_documentation_locally>` .
2018-09-07 15:57:36 +02:00
To check the HTML output of your module documentation:
2019-05-01 22:19:03 +02:00
#. Ensure working :ref: `development environment <environment_setup>` .
#. Install required Python packages (drop '--user' in venv/virtualenv):
2018-09-07 15:57:36 +02:00
2019-05-01 22:19:03 +02:00
.. code-block :: bash
2018-09-07 15:57:36 +02:00
2019-05-01 22:19:03 +02:00
pip install --user -r requirements.txt
pip install --user -r docs/docsite/requirements.txt
2018-09-07 15:57:36 +02:00
2019-05-01 22:19:03 +02:00
#. Ensure your module is in the correct directory: `` lib/ansible/modules/$CATEGORY/mymodule.py `` .
#. Build HTML from your module documentation: `` MODULES=mymodule make webdocs `` .
#. To build the HTML documentation for multiple modules, use a comma-separated list of module names: `` MODULES=mymodule,mymodule2 make webdocs `` .
#. View the HTML page at `` file:///path/to/docs/docsite/_build/html/modules/mymodule_module.html `` .
2018-09-07 15:57:36 +02:00
2019-05-01 22:19:03 +02:00
To ensure that your module documentation matches your `` argument_spec `` :
#. Install required Python packages (drop '--user' in venv/virtualenv):
.. code-block :: bash
pip install --user -r test/runner/requirements/sanity.txt
#. run the `` validate-modules `` test::
2019-08-05 23:56:05 +02:00
ansible-test sanity --test validate-modules mymodule