Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/idorobots/s-html
A library of composable HTML generators.
https://github.com/idorobots/s-html
clojure functional html html-generation
Last synced: 3 days ago
JSON representation
A library of composable HTML generators.
- Host: GitHub
- URL: https://github.com/idorobots/s-html
- Owner: Idorobots
- License: epl-1.0
- Created: 2015-12-26T23:29:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-03T17:57:53.000Z (over 7 years ago)
- Last Synced: 2024-10-11T01:18:54.981Z (25 days ago)
- Topics: clojure, functional, html, html-generation
- Language: Clojure
- Size: 110 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# s-html [![Build Status](https://travis-ci.org/Idorobots/s-html.svg?branch=master)](https://travis-ci.org/Idorobots/s-html) [![Clojars Project](https://img.shields.io/clojars/v/s-html.svg)](https://clojars.org/s-html)
A library of composable, S-expression-based HTML generators.
## Usage
[API docs.](https://idorobots.github.io/s-html/) Use provided functions to compose HTML documents:
``` clojure
(require '[s-html.tags.html :refer [body div head html h1 h2 h3 h4 h5 h6 title]])(def container (partial div {:class :container}))
(defn hello-world-div [tag]
(container (tag "Hello world!")))(defn hello-world [title-str]
(html (head (title title-str)
(body (map hello-world-div
[h1 h2 h3 h4 h5 h6])))))(require '[s-html.print :refer [html->str]])
(html->str (hello-world "Hi!"))
```## License
Copyright © 2015-2016 Kajetan Rzepecki
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.