summaryrefslogtreecommitdiffstats
path: root/docs/templates
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2019-07-09 21:47:25 +0200
committerGitHub <noreply@github.com>2019-07-09 21:47:25 +0200
commitb6791e6ae3891951fc38518fdb52d53219987498 (patch)
treef12c627f014d78fd1043bdc23a973c9eab323d13 /docs/templates
parentBug fixes for GCP modules (#58848) (diff)
downloadansible-b6791e6ae3891951fc38518fdb52d53219987498.tar.xz
ansible-b6791e6ae3891951fc38518fdb52d53219987498.zip
ansible-galaxy: add collection sub command (#57106)
* ansible-galaxy: add collection init sub command * Fix changelog and other sanity issues * Slim down skeleton structure, fix encoding issue on template * Fix doc generation code to include sub commands * Added build step * Tidy up the build action * Fixed up doc changes and slight testing tweaks * Re-organise tests to use pytest * Added publish step and fixed up issues after working with Galaxy * Unit test improvments * Fix unit test on 3.5 * Add remaining build tests * Test fixes, make the integration tests clearer to debug on failures * Removed unicode name tests until I've got further clarification * Added publish unit tests * Change expected length value * Added collection install steps, tests forthcoming * Added unit tests for collection install entrypoint * Added some more tests for collection install * follow proper encoding rules and added more tests * Add remaining tests * tidied up tests and code based on review * exclude pre-release versions from galaxy API
Diffstat (limited to 'docs/templates')
-rw-r--r--docs/templates/cli_rst.j225
1 files changed, 24 insertions, 1 deletions
diff --git a/docs/templates/cli_rst.j2 b/docs/templates/cli_rst.j2
index 52a9f964bf..824843d86b 100644
--- a/docs/templates/cli_rst.j2
+++ b/docs/templates/cli_rst.j2
@@ -14,7 +14,7 @@
.. contents::
:local:
- :depth: 2
+ :depth: {{content_depth}}
.. program:: {{cli_name}}
@@ -84,6 +84,29 @@ Actions
{% endfor %}
{% endif %}
+{% for sub_action in actions[action]['actions'] %}
+
+
+.. program:: {{cli_name}} {{action}} {{sub_action}}
+.. _{{cli_name|replace('-','_')}}_{{action}}_{{sub_action}}:
+
+{{ action + " " + sub_action }}
+{{ '+' * (action|length + sub_action|length + 1) }}
+
+{{ (actions[action]['actions'][sub_action]['desc']|default(' '))}}
+
+{% if actions[action]['actions'][sub_action]['options'] %}
+
+
+{% for option in actions[action]['actions'][sub_action]['options']|sort(attribute='options') %}
+.. option:: {% for switch in option['options'] if switch in actions[action]['actions'][sub_action]['option_names'] %}{{switch}} {% if option['arg'] %} <{{option['arg']}}>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}
+
+ {{ (option['desc']) }}
+{% endfor %}
+{% endif %}
+
+{% endfor %}
+
{% endfor %}
.. program:: {{cli_name}}
{% endif %}