diff --git a/open_api_framework/templates/open_api_framework/env_config.rst b/open_api_framework/templates/open_api_framework/env_config.rst index 6f67f1f..6847434 100644 --- a/open_api_framework/templates/open_api_framework/env_config.rst +++ b/open_api_framework/templates/open_api_framework/env_config.rst @@ -11,17 +11,13 @@ Available environment variables {% for group_name, group_vars in vars %} {{group_name}} -{{group_name|repeat_char:"-"}} - -{% for subgroup_name, subgroup_vars in group_vars %} +{{group_name|repeat_char:"-"}}{% for subgroup_name, subgroup_vars in group_vars %} {% if subgroup_name is not null %} {{subgroup_name}} {{subgroup_name|repeat_char:"^"}} {% endif %} - {% for var in subgroup_vars %}* ``{{var.name}}``: {% if var.help_text %}{{var.help_text|safe|ensure_endswith:"."}}{% endif %}{% if var.auto_display_default and not var.default|is_undefined %} Defaults to: ``{{var.default|to_str|safe}}``.{% endif %} -{% endfor %} -{% endfor %} +{% endfor %}{% endfor %} {% endfor %} {% block extra %}{% endblock %} diff --git a/testapp/settings.py b/testapp/settings.py index 9aecf64..4beac76 100644 --- a/testapp/settings.py +++ b/testapp/settings.py @@ -75,6 +75,14 @@ ROOT_URLCONF = "testapp.urls" +NOTIF_CONFIG_ENABLE = config( + "NOTIF_CONFIG_ENABLE", + default=False, + group="Setup Configuration", + sub_group="Notification Configuration", + help_text="Enable Notification Configuration", +) + # These are excluded from generate_envvar_docs test by their group VARIABLE_TO_BE_EXCLUDED = config("VARIABLE_TO_BE_EXCLUDED1", "foo", group="Excluded") VARIABLE_TO_BE_EXCLUDED = config("VARIABLE_TO_BE_EXCLUDED2", "bar", group="Excluded") diff --git a/tests/test_generate_envvar_docs.py b/tests/test_generate_envvar_docs.py index 62d69b0..fcc66bc 100644 --- a/tests/test_generate_envvar_docs.py +++ b/tests/test_generate_envvar_docs.py @@ -31,6 +31,15 @@ Defaults to the inverse of ``DEBUG``. +Setup Configuration +------------------- + +Notification Configuration +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* ``NOTIF_CONFIG_ENABLE``: Enable Notification Configuration. Defaults to: ``False``. + +