Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 662 Bytes

generate-html-from-hiccup.md

File metadata and controls

23 lines (18 loc) · 662 Bytes

Clojure for HTML generation with Hiccup


(require '[reagent.core :as r])

A simple piece of HTML (for web pages)

[:div
  [:h1 "This is HTML code generated by Clojure"]
  [:p "Hiccup is a simple way to write HTML in Clojure, without all those angle brackets"]
  [:a {:href "https://github.com/weavejester/hiccup"}
  "Read more about Hiccup at its Github repository"]]

We can also create HTML for displaying images

[:img
 {:src "https://avatars1.githubusercontent.com/u/9254615?v=3&s=150"}]