The following are equivalent:
h1 Lorem
Ipsum
h1
| Lorem
| Ipsum
h1
| Lorem
Ipsum
The following works, since everything after '=' is just Ruby:
h1 = lorem_ipsum_helper
...until it contains a comment:
h1 = lorem_ipsum_helper # this comment will break Slim
Here's an example of attributes in Slim:
h1 class="foo" Foo
The cool thing is, the bit after the '=' is really just Ruby. So the following would call a 'foo' method:
h1 class=foo Foo
Arrays work as well:
h1 class=["foo", "bar"] Foo
But don't go too crazy with Ruby, because this won't work:
h1 class=["foo"]+["bar"] Foo
This will print both words without any whitespace between them:
| Foo
| Bar
This is how you append a single whitespace to some plain text:
' Foo
This is how you do it in a Ruby evaluation line:
=' foo_method
But if you just want to use an element with plain text, it's impossible. The following will not work:
span' Foo
- Slim "Ugly" and Slim "Pretty" produce semantically different output (since "ugly" strips all whitespace, even between span-level elements.)
Please add some notes about performance!