Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs clarification on naming jinja filters file #692

Merged
merged 2 commits into from Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion nautobot/docs/plugins/development.md
Expand Up @@ -589,7 +589,7 @@ template_extensions = [SiteAnimalCount]

Plugins can define custom Jinja2 filters to be used when rendering templates defined in computed fields. Check out the [official Jinja2 documentation](https://jinja.palletsprojects.com/en/3.0.x/api/#custom-filters) on how to create filter functions.

In the file that defines your filters, you must import the `library` module from the `django_jinja` library. Filters must then be decorated with `@library.filter`. See an example below that defines a filter called `leet_speak`.
In the file that defines your filters (by default `jinja_filters.py`, but configurable in the [PluginConfig](#pluginconfig-attributes) if desired), you must import the `library` module from the `django_jinja` library. Filters must then be decorated with `@library.filter`. See an example below that defines a filter called `leet_speak`.

```python
from django_jinja import library
Expand Down
2 changes: 1 addition & 1 deletion nautobot/docs/release-notes/version-1.1.md
Expand Up @@ -44,7 +44,7 @@ Please see the MySQL setup guides for [Ubuntu](../installation/ubuntu.md#mysql-s

#### Plugin Defined Jinja2 Filters

Plugins can now define custom Jinja2 filters to be used when rendering templates defined within computed fieldssor custom links. To register your own filters, you may add a `jinja_filters.py` to your plugin and any filters defined there will be automatically registered and globally usable.
Plugins can now define custom Jinja2 filters to be used when rendering templates defined within computed fields or custom links. To register your own filters, you may add a `jinja_filters.py` to your plugin and any filters defined there will be automatically registered and globally usable.

Please see the [plugin development documentation on including Jinja2 filters](../plugins/development.md#including-jinja2-filters) to get started.

Expand Down