diff --git a/docs/bin/plugin_formatter.py b/docs/bin/plugin_formatter.py index 12a034f62e9..ff381a36766 100755 --- a/docs/bin/plugin_formatter.py +++ b/docs/bin/plugin_formatter.py @@ -29,7 +29,7 @@ import os import re import sys import warnings -from collections import defaultdict +from collections import defaultdict, Sequence from distutils.version import LooseVersion from pprint import PrettyPrinter @@ -132,6 +132,12 @@ def rst_xline(width, char="="): return char * width +# NOTE: The existing Jinja2 'sequence' tests matches strings and dictionaries +def test_list(value): + ''' Return true if objects is a list or tupple ''' + return isinstance(value, Sequence) + + def write_data(text, output_dir, outputname, module=None): ''' dumps module output to a file or the screen, as requested ''' @@ -304,6 +310,9 @@ def jinja2_environment(template_dir, typ, plugin_type): env.filters['html_ify'] = html_ify env.filters['fmt'] = rst_fmt env.filters['xline'] = rst_xline + + env.tests['list'] = test_list + templates['plugin'] = env.get_template('plugin.rst.j2') if plugin_type == 'module': diff --git a/docs/templates/plugin.rst.j2 b/docs/templates/plugin.rst.j2 index 35bf13e41b1..c146389a98f 100644 --- a/docs/templates/plugin.rst.j2 +++ b/docs/templates/plugin.rst.j2 @@ -108,12 +108,10 @@ Parameters