Pitmairen / hamlish-jinja

A haml-ish syntax for jinja2 templates
BSD 3-Clause "New" or "Revised" License
131 stars 11 forks source link

Comment tag request #3

Open freewind opened 14 years ago

freewind commented 14 years ago

It seems we can use to write the comments, but sometimes it's not enough. I hope there is a "multi-line" comment tag.

It's useful when debuging and testing. Without it, I have to cut these code to a notepad, and paste it when finish debuging.

Pitmairen commented 14 years ago

I have added single line comments to the syntax now. To comment out a line you start the line with a semicolon (;). Its not a multi line tag, but most editors can be configured to comment and uncomment multiple lines in one go.

You can also use the normal jinja comment tag like this:

%div
    {#
    %div
        %p << Some text
    \#}

The end tag has to be on its own line and you have to escape the "#" because of the id shortcut.

You can do the same with html comment:

%div
    <!--
    %div
        %p << Some text
    \-->

Again you have to escape the end tag because jinja tags uses "-".