Skip to content

Commit

Permalink
fixup! docs: Document the context hook extension
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Apr 24, 2022
1 parent e078499 commit 4c370de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion docs/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,8 @@ on them, so they are always installed when Copier is installed.

- [`copier_templates_extensions.TemplateExtensionLoader`](https://github.com/copier-org/copier-templates-extensions):
enhances the extension loading mecanism to allow templates writers to put their
extensions directly in their templates. It also allows to modify the context before
extensions directly in their templates. It also allows to modify the rendering context
(the Jinja variables that you can use in your templates) before
rendering templates, see [using a context hook](../faq#how-can-i-alter-the-context-before-rendering-the-project).
- [`jinja_markdown.MarkdownExtension`](https://github.com/jpsca/jinja-markdown):
provides a `markdown` tag that will render Markdown to HTML using
Expand Down
16 changes: 8 additions & 8 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ _jinja_extensions:
```
Following this example, you are supposed to provide a `context.py` file in the
`extensions` folder at the root of your template to modify the context. If for
example your `copier.yaml` contains a multiple-choice variable like this:
`extensions` folder at the root of your template to modify the context. If for example
your `copier.yaml` contains a multiple-choice variable like this:

```yaml title="copier.yaml"
flavor:
type: str
choices:
- Docker
- Instances
- Kubernetes
- None
type: str
choices:
- Docker
- Instances
- Kubernetes
- None
```

The `context.py` file contains your context hook which could look like:
Expand Down

0 comments on commit 4c370de

Please sign in to comment.