A Clojure library for converting data structures into html and opening them in a browser for inspection. It's very similar to clojure.inspector/inspect-tree but more readable to my eyes.
[data-to-html "0.1.3-SNAPSHOT"]
Import the project and its two functions
(ns weather.core
(require [data-to-html.core :refer [convert open-in-browser inspect]]))
Define some data
(def my-data {:temperature 27 :forecast #{:cloudy :rain :thunder}})
Run the data through convert to turn it into a html string. Use open-in-browser to save the string into a html page and make your OS open it in a browser.
(-> my-data
convert
open-in-browser)
You can also use inspect to do it all in one function call
(inspect my-data)
inspect also returns the data again so that you can insert it in the middle of a threading macro
(-> my-data
:forecast
inspect ; opens browser!
:cloudy
boolean) ; => true
- Use tree walk instead
- Add foldable nodes to the tree (jquery)
- Make sure lazy seqs and symbols work properly
Copyright © 2013 Erik Svedäng
Distributed under the Eclipse Public License, the same as Clojure.