Backport/2.6/docs default lists (#56666)

* Improve rendering of default lists (#56041)

(cherry picked from commit 53ed1bfc49)

* Add compat tojson filter for jinja2 versions missing it (#56596)

(cherry picked from commit 3f4a22d8ef)
pull/56826/head
Alicia Cozine 7 years ago committed by GitHub
parent e61a089b5e
commit 674980afcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -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 %}
<b>Default:</b><br/><div style="color: blue">@{ value.default | escape }@</div>
<b>Default:</b><br/><div style="color: blue">@{ value.default | tojson | escape }@</div>
{% endif %}
</td>
{# configuration #}

Loading…
Cancel
Save