Closed borkdude closed 4 years ago
notes: keep default in format as clj hiccup. Expose stdin as stream *in*
for other conversions like html input here. something like bootleg -d -e '(convert-to *in* :hiccup)' <<< '<html></html>'
Reads script from stdin when no file is passed in and no -e flag
$ bootleg <<< '[:p 1]'
<p>1</p>
*in*
is bound to clojure.lang.LineNumberingPushbackReader
on stdin as it is in clojure. So you need to slurp
it:
echo -n "<html></html>" | bootleg -d -e '(-> *in* slurp (convert-to :hiccup))'
[:html {}]
Need to be careful of trailing newlines in <<<
pipe.
$ bootleg -d -e '(-> *in* slurp (convert-to :hiccup))' <<< '<html></html>'
"\n"
$ bootleg -d -e '(-> *in* slurp (convert-to :hiccup-seq))' <<< '<html></html>'
([:html {}] "\n")
new related issue: https://github.com/retrogradeorbit/bootleg/issues/53