Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Jinja2 - How to com...
 
Notifications
Clear all

[Solved] Jinja2 - How to comment lines

1 Posts
1 Users
0 Reactions
8 Views
 Hans
(@hans)
Famed Member Admin
Joined: 13 years ago
Posts: 3147
Topic starter   [#1577]

Playing in the templates editor (Settings -> Tools/Developer -> Templates) I usually add comments so I know what the code is doing.

In Jinja2 this is quite easy:

# This is a comment

This approach however works for only one line.

Sometimes I want to comment out quite a few lines - especially when I want to comment out a piece of code.
To comment multiple lines we need to use this:

{# start line comment

....

#}


   
ReplyQuote
Share: