rxd_txd
306 subscribers
479 photos
25 videos
22 files
2.71K links
[
{
"channel":"rxd_txd",
"info":"my bookmarks",
"feedback":"@flsixtyfour",
"topics":[
"devops",
"linux",
"sci",
"music",
"go",
"/dev/null"
]
}
]
Download Telegram
Jinja2 Tutorial
Text documents are the final result of rendering templates. Depending on the end consumer of these documents whitespace placement could be significant. One of the major niggles in Jinja2, in my opinion, is the way control statements and other elements affect whitespace output in the end documents.

To put it bluntly, mastering whitespaces in Jinja2 is the only way of making sure your templates generate text exactly the way you intended.

Now we know the importance of the problem, time to understand where it originates, to do that we’ll have a look at a lot of examples. Then we'll learn how we can control rendering whitespaces in Jinja2 templates.

- part1: Introduction and variable substitution
- part2: Loops and conditionals
- part3: Whitespace control
- part4: Template filters
- part5: Macros
- part6: Include and Import
- J2Live - Online Jinja2 Parser

#jinja #jinja2 #tutorial