"""
Silique (https://www.silique.fr)
Copyright (C) 2025-2026

This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

from ..utils import _


def get_rougail_config(
    *,
    backward_compatibility=True,
) -> dict:
    if backward_compatibility:
        main_namespace_default = "rougail"
    else:
        main_namespace_default = "null"
    options = f"""
main_structural_strings:
  description: {_("Structural files contents")}
  help: {_("This variable is a list of string with YAML file format")}
  multi: true
  disabled:
    jinja: >-
      {{% if 'string' not in _.step.structural %}}
        true
      {{% elif cli is defined and cli.versions is defined and cli.versions %}}
        true
      {{% else %}}
        false
      {{% endif %}}
    return_type: boolean
    description: {_('string is not in "_.step.structural"')}

extra_namespaces:

  strings:
    description: {_("Extra structural contents")}
    help: {_("This variable is a list of string with YAML file format")}
    alternative_name: xc
    multi: true
    disabled:
      jinja: >-
        {{{{ 'string' not in __.step.structural }}}}
      return_type: boolean
      description: {_('string is not in "__.step.structural"')}
"""
    return {
        "name": "string",
        "process": "structural",
        "options": options,
        "level": 15,
    }


__all__ = "get_rougail_config"
