1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-07 07:05:48 +00:00

Update links to jinja2 docs

This commit is contained in:
dotiful
2020-09-15 21:58:33 +03:00
parent 50b54171fd
commit 28568d80fd
7 changed files with 13 additions and 13 deletions

View File

@@ -1,13 +1,13 @@
# Templating
Dotdrop leverage the power of [jinja2](http://jinja.pocoo.org/) to handle the
templating of dotfiles. See [jinja2 template doc](http://jinja.pocoo.org/docs/2.9/templates/)
Dotdrop leverage the power of [jinja2](https://jinja.pocoo.org/) to handle the
templating of dotfiles. See [jinja2 template doc](https://jinja.pocoo.org/docs/2.9/templates/)
or the below sections for more information on how to template your dotfiles.
## Delimiters
Dotdrop uses different delimiters than
[jinja2](http://jinja.pocoo.org/)'s defaults:
[jinja2](https://jinja.pocoo.org/)'s defaults:
* block/statement start = `{%@@`
* block/statement end = `@@%}`
@@ -85,7 +85,7 @@ The above aliases load all the variables from `~/dotfiles/.env`
## Template methods
Beside [jinja2 global functions](http://jinja.pocoo.org/docs/2.10/templates/#list-of-global-functions)
Beside [jinja2 global functions](https://jinja.pocoo.org/docs/2.11/templates/#list-of-global-functions)
the following methods can be used within the templates:
* `exists(path)`: return true when path exists
@@ -140,7 +140,7 @@ this should exist
## Template filters
Beside [jinja2 builtin filters](https://jinja.palletsprojects.com/en/2.10.x/templates/#builtin-filters)
Beside [jinja2 builtin filters](https://jinja.palletsprojects.com/en/2.11.x/templates/#builtin-filters)
custom user-defined filter functions can be loaded using the config entry `filter_file`:
Example:
@@ -163,7 +163,7 @@ dotfile content
```
For more information on how to create filters,
see [jinja2 official doc](https://jinja.palletsprojects.com/en/2.10.x/api/#writing-filters).
see [jinja2 official doc](https://jinja.palletsprojects.com/en/2.11.x/api/#writing-filters).
## Import macros
@@ -190,7 +190,7 @@ The header can be automatically added with:
```
Properly commenting the header in templates is the responsibility of the user
as [jinja2](http://jinja.pocoo.org/) has no way of knowing what is the proper char(s) used for comments.
as [jinja2](https://jinja.pocoo.org/) has no way of knowing what is the proper char(s) used for comments.
Either prepend the directive with the commenting char(s) used in the dotfile
(for example `# {{@@ header() @@}}`) or provide it as an argument `{{@@ header('# ') @@}}`.
The result is equivalent.