diff --git a/docs/configuring.md b/docs/configuring.md index 3ac8b3d12..cfe0dbd1b 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -383,19 +383,7 @@ cannot use Jinja templating in your answers. The `copier.yml` file supports multiple documents as well as using the `!include` tag to include settings and questions from other YAML files. This allows you to split up a larger `copier.yml` and enables you to reuse common partial sections from your -templates. When multiple documents are used, care has to be taken with questions and -settings that are defined in more than one document: - -- A question with the same name overwrites definitions from an earlier document. -- Settings given in multiple documents for `exclude`, `skip_if_exists`, - `jinja_extensions` and `secret_questions` are concatenated. -- Other settings (such as `tasks` or `migrations`) overwrite previous definitions for - these settings. - -!!! hint - - You can use [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) - to sanely include shared code into templates. +templates. !!! example @@ -432,6 +420,36 @@ settings that are defined in more than one document: - "pyproject.toml" ``` +The syntax of a single include is: + +```yaml +--- +!include filename.yml +--- +``` + +the `---` on new lines are essential, but you don't need to duplicate them if you have +two `!include` directives. + +!!! hint + + When working with multiple documents, you can use [`exclude`][exclude] + to exclude them from the rendered project. + +When multiple documents are used, care has to be taken with questions and +settings that are defined in more than one document: + +- A question with the same name overwrites definitions from an earlier document. +- Settings given in multiple documents for `exclude`, `skip_if_exists`, + `jinja_extensions` and `secret_questions` are concatenated. +- Other settings (such as `tasks` or `migrations`) overwrite previous definitions for + these settings. + +!!! hint + + You can use [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) + to sanely include shared code into templates. + ## Conditional files and directories You can take advantage of the ability to template file and directory names to make them