Skip to content

Feature improvement request: support multiple inheritance #2624

Open

Description

@Guts

Regarding the configuration inheritance, it would be really interesting to support something like this in mkdocs.yml:

INHERIT:
  - ./config/0_md_extensions.yml
  - ./config/1_plugins.yml
  - ./config/2_extra.yml

Now, I have to "chain" the inheritance (<-- = inherit value): mkdocs.yml <-- ./config/0_md_extensions.yml <-- ./config/1_plugins.yml <-- ./config/2_extra.yml

But it's too hard to maintain.

Activity

  1. anb0s commented on Mar 14, 2022

    @anb0s

    Is multiple inheritance supported? can we use multiple INHERIT entries ?

  2. pawamoy commented on Apr 17, 2024

    @pawamoy
    Contributor

    This looks like a legit use-case. We need to rethink inheritance and make it more robust/flexible. Maybe using composition instead of inheritance is the way to go. This could also be solved by allowing users to add custom YAML tags, like an !include tag (for example Copier has such a feature). Maybe we should otherwise simply offload this to other tools like Ansible/Chef/etc. (I don't use them, forgive my probable ignorance), which IIUC use Jinja to build YAML.

  3. lovelydinosaur commented on Apr 17, 2024

    @lovelydinosaur
    Collaborator

    Unsurprisingly my view here is on the same page as #3331 with this.

    Single config file being a single config file is a reasonable constraint.
    Plenty of scope for users to do fancy compositions in their own toolchains if absolutely needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions