diff --git a/docs/bin/plugin_formatter.py b/docs/bin/plugin_formatter.py index 53433e373cc..e76b2d8b8d8 100755 --- a/docs/bin/plugin_formatter.py +++ b/docs/bin/plugin_formatter.py @@ -24,6 +24,7 @@ __metaclass__ = type import datetime import glob +import json import optparse import os import re @@ -334,6 +335,10 @@ def jinja2_environment(template_dir, typ, plugin_type): # Jinja < 2.10 env.filters['max'] = do_max + if 'tojson' not in env.filters: + # Jinja < 2.9 + env.filters['tojson'] = json.dumps + templates = {} if typ == 'rst': env.filters['convert_symbols_to_format'] = rst_ify diff --git a/docs/templates/plugin.rst.j2 b/docs/templates/plugin.rst.j2 index fc521614895..8caf13ee0bf 100644 --- a/docs/templates/plugin.rst.j2 +++ b/docs/templates/plugin.rst.j2 @@ -153,7 +153,7 @@ Parameters {% endif %} {# Show default value, when multiple choice or no choices #} {% if value.default is defined and value.default not in value.choices %} - Default:
@{ value.default | escape }@
+ Default:
@{ value.default | tojson | escape }@
{% endif %} {# configuration #}