When writing HTML comments in SLIM:
/! The first line of comments
/! The second line of comments
The output becomes
<!-- The first line of comments --><!-- The second line of comments -->
All the other generated HTML is properly formatted and indented because I set pretty
equal to true
I'm writing templates for other people to use so I need comments with line breaks for readability.
What's Slim? Slim is a page-templating language that minimizes markup and syntax. It removes most of the extra "programming-like" symbols from HTML so that your code looks cleaner. Slim also adds if-else statements, loops, includes, and more.
Slim is a fast, lightweight templating engine with support for Rails 3 and later. It has been heavily tested on all major ruby implementations.
You can achieve a single multi-line comment in Slim like this:
/!
The first line of comments
The second line of comments
Which should output this:
<!-- The first line of comments
The second line of comments -->
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With