Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liquidz/mint
A proof of concept for simple template engine using threading macros
https://github.com/liquidz/mint
babashka clojure clojurescript nbb template-engine
Last synced: 8 days ago
JSON representation
A proof of concept for simple template engine using threading macros
- Host: GitHub
- URL: https://github.com/liquidz/mint
- Owner: liquidz
- License: other
- Created: 2022-10-29T21:54:49.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T06:22:01.000Z (10 months ago)
- Last Synced: 2024-10-18T06:16:58.208Z (19 days ago)
- Topics: babashka, clojure, clojurescript, nbb, template-engine
- Language: Clojure
- Homepage:
- Size: 24.4 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Mint
image:https://github.com/liquidz/mint/workflows/test/badge.svg["GitHub Actions for test workflow", link="https://github.com/liquidz/mint/actions?query=workflow%3Atest"]
image:https://github.com/liquidz/mint/workflows/lint/badge.svg["GitHub Actions for lint workflow", link="https://github.com/liquidz/mint/actions?query=workflow%3Alint"]
image:https://img.shields.io/badge/babashka-compatible-brightgreen["Babashka", link="https://github.com/babashka/babashka"]
image:https://img.shields.io/badge/nbb-compatible-brightgreen["nbb", link="https://github.com/babashka/nbb"]A simple single-line template engine like Mustache and Clojure.
== Concept
* Similar mustache, but Clojure like style
** `{{foo}}`
** `{{-> v f (g "foo")}}`
** `{{->> v f (g "foo")}}`
* No dependencies== Usage
image:https://img.shields.io/clojars/v/com.github.liquidz/mint["Clojars Project", link="https://clojars.org/com.github.liquidz/mint"]
[source,clojure]
----
(require '[mint.core :as mint])
;; => nil(mint/render "{{-> name greet}}!"
{:name "world" :greet #(str "Hello " %)})
;; => "Hello world!"(mint/render "{{->> name (str \"Hello \")}}!"
{:name "world" :str str})
;; => "Hello world!"
----== Supported functions
* `->`, `->>`, `some->`, `some->>`
* `when`== License
Copyright © 2022-2024 https://scrapbox.io/uochan/uochan[Masashi Iizuka]
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License, v. 2.0 are satisfied: GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or (at your
option) any later version, with the GNU Classpath Exception which is available
at https://www.gnu.org/software/classpath/license.html.