Skip to content

Commit 9bcb260

Browse files
committed
feat: autoconfval now supports multiple lines default value
1 parent 7ce9d89 commit 9bcb260

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/sphinxnotes/project/templates/autoconfval.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
{% set opt = load_extra('env').config.values[name] %}
2+
{% set default = opt.default | string %}
23

34
.. role:: py(code)
45
:language: Python
56

67
.. confval:: {{ name }}
78
:type: {{ opt.valid_types | autoconfval_types | join(', ') }}
8-
:default: :py:`{{ opt.default | pprint }}`
9+
{% if '\n' not in default %}:default: :py:`{{ opt.default | pprint }}`{% endif %}
10+
11+
..
12+
13+
{% if '\n' in default %}
14+
:default:
15+
.. code-block::
16+
17+
{% for _line in default.split('\n') -%}
18+
{{ _line }}
19+
{% endfor %}
20+
{% endif %}
921
1022
{%- for line in opt.description.split('\n') %}
1123
{{ line }}

0 commit comments

Comments
 (0)