A clojure wrapper for the Beautify-Web JavaScript library that prettifies HTML.
If you have spent time trying to find the magical combination of JTidy options that will make your markup pretty without messing something up, or fought with pretty-printing XML, or gotten frustrated at the results of "prettify HTML java" on StackOverflow, then this library is for you. I feel your pain.
Leiningen/Boot
[px0/beautify-web "0.1.1"]
Clojure CLI/deps.edn
px0/beautify-web {:mvn/version "0.1.1"}
This library exposes 3 functions:
beautify-html
beautify-css
beautify-js
Each takes a string, and returns a prettily formatted string. Couldn't be easier!
Example
(require '[beautify-web.core :as bw])
(bw/beautify-html "<ul class=\"nav navbar-nav\"><li class=\"active\"><a href=\"/\">Hauptseite</a></li><li><a href=\"/preise\">Preise</a></li><li><a href=\"/kontakt\">Kontakt</a></li></ul>")
;=> "<ul class=\"nav navbar-nav\">
;=> <li class=\"active\"><a href=\"/\">Hauptseite</a></li>
;=> <li><a href=\"/preise\">Preise</a></li>
;=> <li><a href=\"/kontakt\">Kontakt</a></li>
;=> </ul>"
Copyright © 2018 Max Gerlach
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close