Use definition lists, not tables
Definition lists are a far better fit for config reference and produce easier-to-parse output. Let's use them. Change-Id: I7a4087c77e3aab8ddead4b30c5aa4e3b31b56704
This commit is contained in:
parent
4b8f06405b
commit
3716af8e07
|
@ -536,8 +536,6 @@ def write_files(package_name, options, target, output_format):
|
||||||
file_path = ("%(target)s/%(package_name)s-%(cat)s.%(ext)s" %
|
file_path = ("%(target)s/%(package_name)s-%(cat)s.%(ext)s" %
|
||||||
{'target': target, 'package_name': package_name,
|
{'target': target, 'package_name': package_name,
|
||||||
'cat': cat, 'ext': ext})
|
'cat': cat, 'ext': ext})
|
||||||
# TODO(stephenfin): This template should be using definition lists
|
|
||||||
# rather than multiple tables
|
|
||||||
tmpl_file = os.path.join(os.path.dirname(__file__),
|
tmpl_file = os.path.join(os.path.dirname(__file__),
|
||||||
'templates/autohelp.%s.j2' % output_format)
|
'templates/autohelp.%s.j2' % output_format)
|
||||||
with open(tmpl_file) as fd:
|
with open(tmpl_file) as fd:
|
||||||
|
|
|
@ -10,31 +10,28 @@
|
||||||
|
|
||||||
.. _{{ table_label }}:
|
.. _{{ table_label }}:
|
||||||
|
|
||||||
.. list-table:: Description of {{ nice_cat }} configuration options
|
{{ nice_cat }}
|
||||||
:header-rows: 1
|
-----------------------------------------------------------------------
|
||||||
:class: config-ref-table
|
|
||||||
|
|
||||||
* - Configuration option = Default value
|
|
||||||
- Description
|
|
||||||
{% for group in groups %}
|
{% for group in groups %}
|
||||||
* - **[{{ group }}]**
|
|
||||||
-
|
{{ group }}
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
{% for item in items[loop.index0] %}
|
{% for item in items[loop.index0] %}
|
||||||
{% if item[1] is equalto '' %}
|
|
||||||
* - ``{{ item[0] }}`` =
|
``{{ item[0] }}`` ({{ item[1] }})
|
||||||
{% else %}
|
{% if item[2] is not equalto '' %}
|
||||||
* - ``{{ item[0] }}`` = ``{{ item[2] }}``
|
|
||||||
|
Default: ``{{ item[2] }}``
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for paragraph in item[3] %}
|
{% for paragraph in item[3] %}
|
||||||
{% if loop.first %}
|
|
||||||
- ({{ item [1] }}) {{ paragraph }}
|
|
||||||
{% else %}
|
|
||||||
{{ paragraph }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
{{ paragraph }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for flagname, flagdesc in item[4] %}
|
{% for flagname, flagdesc in item[4] %}
|
||||||
|
|
||||||
- **{{ flagname }}**
|
- **{{ flagname }}**
|
||||||
|
|
||||||
{{ flagdesc }}
|
{{ flagdesc }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in New Issue