earl-quaint

0.0.0 • Public • Published

earl-quaint

This packages defines the Q macro which allows the embedding of Quaint markup in Earl Grey.

require-macros:
   earl-quaint ->
      Q

Q"Hello __everyone!"  ;; => % {"Hello", strong % "everyone"}

The result is an ENode, the same data structure that the % operator returns in Earl Grey. An ENode can be converted to HTML:

require-macros:
   earl-quaint ->
      Q

require: /html

html(Q"Hello __everyone!")  ;; => "Hello <strong>everyone</strong>"

Alternatively, you can specify a format to convert to directly:

require-macros:
   earl-quaint ->
      Q(format = "html")

Q"Hello __everyone!"  ;; => % "Hello <strong>everyone</strong>"

Earl Grey expressions can be interpolated inside {}s.

favorites = {
   animal = "zebra"
   food = "poutine"
}

Q"My favorite animal is the {favorites.animal}"

Finally, it is possible to alias Q to the single quote:

require-macros:
   earl-quaint ->
      Q(format = "html") as "'"

'Hello __world'  ;; => "Hello <strong>world</strong>"

Readme

Keywords

none

Package Sidebar

Install

npm i earl-quaint

Weekly Downloads

1

Version

0.0.0

License

MIT

Last publish

Collaborators

  • breuleux