arnaud-lb / MtHaml

Multi target HAML (HAML for PHP, Twig, <your language here>)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Helpers (succeed, surround etc.)

dbulic opened this issue · comments

I can't find a way to do equivalent of ruby's
= succeed "." do
%strong last words of a sentence
= surround '(', ')' do
%strong something inside parens

http://haml.info/docs/yardoc/Haml/Helpers.html

Is this supported?

Not yet :)

This kind of things should be the responsibility of the target language (Twig or PHP). Translating this syntax to Twig/PHP is not obvious however, as there is no anonymous functions (Twig), or no short syntax for anonymous functions.

Alternatives:

Using "<":

-# The "<" tells HAML not to output whitespaces before/after the strong tag
%strong< last words of a sentence
.

Using inline HTML:

<strong>last words of a sentence</strong>.