Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tatut/re-html-template
Generate hiccup (reagent/server rendering) components from HTML templates at compile time
https://github.com/tatut/re-html-template
Last synced: 3 months ago
JSON representation
Generate hiccup (reagent/server rendering) components from HTML templates at compile time
- Host: GitHub
- URL: https://github.com/tatut/re-html-template
- Owner: tatut
- Created: 2018-05-02T15:36:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-05T11:10:22.000Z (over 3 years ago)
- Last Synced: 2024-07-01T10:09:59.330Z (6 months ago)
- Language: Clojure
- Homepage:
- Size: 106 KB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# re-html-template
Re-html-template can create Reagent components (functions that return hiccup markup) from HTML
templates at compile time.See the macros `html-template` and `define-html-template`.
## Changes
### 2021-09-05
- Support :translate option to globally supply a translation form### 2021-08-31
- Support (experimental) for automatic reloading (and re-eval of code) when template file changes (`:reload? true`)
- Support merging global options as REPL convenience with `merge-global-options!`### 2021-08-15
- Support reusable transforms via macros### 2021-08-14
- Filter out empty classes
- Support custom matcher types (see `custom-match-element`)
- Support :remove-attributes transform (eg. to remove data- attribute used for matching purpose from output)
- Support :default-transformations that are run for all elements matched by any rule
- Support illegal (in clj keyword) chars in classes (represented in :class attribute instead)### 2021-01-12
- Add :wrap transform support
- Add `html` macro that does just expansion without generating a function### 2021-01-11
- Remove project.clj (last clojars version is 20180504)### 2021-01-10
- Support attr maps as rules
- Support global options that are merged with options given at call site
- New `html-template` that expands to an anonymous function and refactor
`define-html-template` to use that
- Usage as deps.edn git dependency
- `:wrap-hiccup` option to support different other approaches than returning hiccup## Goals
- Simple macro that outputs a function
- Both Clojure and ClojureScript support
- Zero runtime dependencies (outputs plain clojure code that doesn't need any libraries)## Usage
If you have the following HMTL file in your classpath `template.html`:
```html
My template