I've been learning Slim lately and I was wondering if there's a way to format or beautify my code in it. I have been wary of using newlines(pressing Enter) because it causes errors.
The reason I want to format it is because most of my code can't fit the single line of my text editor and what usually happens is that it continues to the next line, which usually ends up to be unreadable for me.
This is usually in just one line:li #{author.first_name} #{author.last_name} <a href="/">View</a><a href="/">Edit</a><a href="/">Delete</a>
Is there a way or a character to denote a line continuation? I want the links to used the next line so that it would be more readable for me.
Your example can been broken into smaller parts:
li
=#{author.first_name} #{author.last_name}
a href="/" View
a href="/" Edit
a href="/" Delete
You can also use an attributes wrapper to span multiple lines
div[id="#my-id"
class="my-class"
data-author="George Washington"
data-date="2013-08-21"]
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