0

Is is possible to define new operators using jade?

Similar to the abbreviations in emmet.

I would like to define something like

 k=v

to be

<op key="k" value="v"/>

and

k eq 1

to be

<find value="k = 1"/>

(While I like zencoding / emmet I sometimes find it to be too terse.)

If not Jade maybe something similar?

csta
  • 2,423
  • 5
  • 26
  • 34

1 Answers1

0

No, Emmet doesn’t support custom operators. And, in case of your examples, it requires completely different parser which you’ll likely have to write by yourself.

However, you can utilize Emmet syntax to create something similar. For example, with this snippet definition:

"op": "<op key=\"${id}\" value=\"${class}\" />"

you can expand op#k.v abbreviation to get desired result.

Sergey Chikuyonok
  • 2,626
  • 14
  • 13