Skip to content

Commit a4cb511

Browse files
authored
Remove/update incorrect docs building documentation (#1128)
* MODULES= and PLUGINS= haven't worked since ansible-base 2.10. * MODULES= no longer exists. * Fix dash. * Remove no longer correct parts. * Mention --docker option.
1 parent ab2d9e3 commit a4cb511

File tree

3 files changed

+16
-42
lines changed

3 files changed

+16
-42
lines changed

docs/docsite/Makefile

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,6 @@ ifndef POTDIR
2222
POTDIR = $(BUILDDIR)/gettext
2323
endif
2424

25-
# Backwards compat for separate VARS
26-
PLUGIN_ARGS=
27-
ifdef MODULES
28-
ifndef PLUGINS
29-
PLUGIN_ARGS = -l $(MODULES)
30-
else
31-
PLUGIN_ARGS = -l $(MODULES),$(PLUGINS)
32-
endif
33-
else
34-
ifdef PLUGINS
35-
PLUGIN_ARGS = -l $(PLUGINS)
36-
endif
37-
endif
38-
3925
ANSIBLE_VERSION_ARGS=
4026
ifdef ANSIBLE_VERSION
4127
ANSIBLE_VERSION_ARGS=--ansible-version=$(ANSIBLE_VERSION)
@@ -196,11 +182,11 @@ config: ../templates/config.rst.j2
196182
$(CONFIG_DUMPER) --template-file=../templates/config.rst.j2 --output-dir=rst/reference_appendices/ $(EXTRA_CONFIG_DUMPER_ARGS) ../../lib/ansible/config/base.yml
197183

198184
plugins:
199-
$(PLUGIN_FORMATTER) full -o rst $(ANSIBLE_VERSION_ARGS) $(EXTRA_PLUGIN_FORMATTER_ARGS) $(PLUGIN_ARGS)
185+
$(PLUGIN_FORMATTER) full -o rst $(ANSIBLE_VERSION_ARGS) $(EXTRA_PLUGIN_FORMATTER_ARGS)
200186

201187
# This only builds the plugin docs included with ansible-core
202188
core_plugins:
203-
$(PLUGIN_FORMATTER) core -o rst $(EXTRA_PLUGIN_FORMATTER_ARGS) $(PLUGIN_ARGS)
189+
$(PLUGIN_FORMATTER) core -o rst $(EXTRA_PLUGIN_FORMATTER_ARGS)
204190

205191
epub:
206192
(CPUS=$(CPUS) $(MAKE) -f Makefile.sphinx epub)

docs/docsite/rst/community/documentation_contributions.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,22 +175,18 @@ This process compiles all the links but provides minimal log output. If you're w
175175
Building all the rST pages
176176
^^^^^^^^^^^^^^^^^^^^^^^^^^
177177

178-
To build all the rST files without any module documentation:
178+
To build all the rST files with almost no module documentation:
179179

180180
.. code-block:: bash
181181
182-
MODULES=none make webdocs
182+
make coredocs
183+
184+
This is building effectively the ansible-core documentation, as opposed to the Ansible community package documentation, which includes documentation for many collections.
183185

184186
Building module docs and rST pages
185187
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
186188

187-
To build documentation for a few modules included in ``ansible/ansible`` plus all the rST files, use a comma-separated list:
188-
189-
.. code-block:: bash
190-
191-
MODULES=one_module,another_module make webdocs
192-
193-
To build all the module documentation plus all the rST files:
189+
To build all the module documentation for the Ansible community package plus all the rST files:
194190

195191
.. code-block:: bash
196192
@@ -207,7 +203,7 @@ Advanced users can build one or more rST files with the sphinx utility directly.
207203
208204
sphinx-build [options] sourcedir outdir [filenames...]
209205
210-
You can specify file names, or ``a`` for all files, or omit both to compile only new/changed files.
206+
You can specify file names, or ``-a`` for all files, or omit both to compile only new/changed files.
211207

212208
For example:
213209

docs/docsite/rst/dev_guide/testing_documentation.rst

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,9 @@ Testing plugin documentation
99

1010
A quick test while developing is to use ``ansible-doc -t <plugin_type> <name>`` to see if it renders, you might need to add ``-M /path/to/module`` if the module is not somewhere Ansible expects to find it.
1111

12-
Before you submit a plugin for inclusion in Ansible, you must test your documentation for correct HTML rendering and for modules to ensure that the argspec matches the documentation in your Python file.
13-
The community pages offer more information on :ref:`testing reStructuredText documentation <testing_documentation_locally>`.
12+
Before you submit a plugin for inclusion in ansible-core, you must run tests to ensure that the argspec matches the documentation in your Python file, and that the argspec's and documentation's structure is correct.
1413

15-
For example, to check the HTML output of your module documentation:
16-
17-
#. Ensure working :ref:`development environment <environment_setup>`.
18-
#. Install required Python packages (drop '--user' in venv/virtualenv):
19-
20-
.. code-block:: bash
21-
22-
pip install --user -r requirements.txt
23-
pip install --user -r docs/docsite/requirements.txt
24-
25-
#. Ensure your module is in the correct directory: ``lib/ansible/modules/mymodule.py`` or in a configured path.
26-
#. Build HTML from your module documentation: ``MODULES=mymodule make webdocs``.
27-
#. To build the HTML documentation for multiple modules, use a comma-separated list of module names: ``MODULES=mymodule,mymodule2 make webdocs``.
28-
#. View the HTML page at ``file:///path/to/docs/docsite/_build/html/modules/mymodule_module.html``.
14+
The community pages offer more information on :ref:`testing reStructuredText documentation <testing_documentation_locally>` if you extend the Ansible documentation with additional RST files.
2915

3016
To ensure that your module documentation matches your ``argument_spec``:
3117

@@ -41,4 +27,10 @@ To ensure that your module documentation matches your ``argument_spec``:
4127
4228
ansible-test sanity --test validate-modules mymodule
4329
30+
If you have Docker or Podman installed, you can also use them with the ``--docker`` option, which uses an image that already has all requirements installed:
31+
32+
.. code-block:: bash
33+
34+
ansible-test sanity --docker --test validate-modules mymodule
35+
4436
For other plugin types the steps are similar, just adjusting names and paths to the specific type.

0 commit comments

Comments
 (0)