Created
September 7, 2018 10:50
-
-
Save monkeygroover/d0fde99a758d9fc676dadb097587d3ac to your computer and use it in GitHub Desktop.
hiccup templating
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns confluence-version-page-generator.table) | |
(require '[hiccup.core :refer [html]]) | |
(defn render [table-data] | |
(html [:table | |
[:tr | |
[:th "Service"] | |
[:th "SHA(s)"] | |
[:th "Nodes"]] | |
(for [{service "service" versions "versions"} table-data] | |
[:tr | |
(apply concat | |
(for [[sha nodes] versions] | |
[[:td service] | |
[:td sha] | |
[:td [:ul (for [node (sort nodes)] [:li node])]]]))])])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment