Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/breuleux/earl-quaint
Q macro to embed Quaint in Earl Grey
https://github.com/breuleux/earl-quaint
Last synced: 9 days ago
JSON representation
Q macro to embed Quaint in Earl Grey
- Host: GitHub
- URL: https://github.com/breuleux/earl-quaint
- Owner: breuleux
- Created: 2015-10-02T01:39:15.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-02T03:26:31.000Z (about 9 years ago)
- Last Synced: 2024-10-18T18:54:35.533Z (28 days ago)
- Size: 125 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
earl-quaint
===========This packages defines the `Q` macro which allows the embedding of
[Quaint](https://breuleux.github.io/quaint)
markup in
[Earl Grey](http://earl-grey.io).```earlgrey
require-macros:
earl-quaint ->
QQ"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:```earlgrey
require-macros:
earl-quaint ->
Qrequire: /html
html(Q"Hello __everyone!") ;; => "Hello everyone"
```Alternatively, you can specify a format to convert to directly:
```earlgrey
require-macros:
earl-quaint ->
Q(format = "html")Q"Hello __everyone!" ;; => % "Hello everyone"
```Earl Grey expressions can be interpolated inside `{}`s.
```earlgrey
favorites = {
animal = "zebra"
food = "poutine"
}Q"My favorite animal is the {favorites.animal}"
```Finally, it is possible to alias `Q` to the single quote:
```earlgrey
require-macros:
earl-quaint ->
Q(format = "html") as "'"'Hello __world' ;; => "Hello world"
```