Skip to content

Documentation: Add dynamic choice generation and checking examples to mkdocs. #2078

Open
@wolfiex

Description

@wolfiex

Actual Situation

The ability to dynamically create choices is really useful and it should be given as an example in the documentation.

my_collection:
    type: str
    help: A collection of items
    choices: |
        {%- for my_item in items %}
        - {{my_item}}
        {%- endfor %}

And executed with

run_copy(copier_loc, out_dir, data = { "items": ['a','b','c'] } )

I am happy to add it to the mkdocs markdown, but am unsure where it would best live. Just following the Jinja/Macro templates subheading possibly? https://copier.readthedocs.io/en/stable/configuring/#importing-jinja-templates-and-macros

Desired Situation

More people are aware of the functionality.

Proposed solution

I add this to the documentation and it gets merged?

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