I have that latest joker on MacOS (installed via brew)
$ cat h.joke
(ns hu.evernode.test
"Hiccup test"
(:use [joker.hiccup]))
(println (html [:span {:class "foo"} "bar"]))
$ joker --lint h.joke
h.joke:5:11: Parse error: Unable to resolve symbol: html
however it works
$ joker h.joke
<span class="foo">bar</span>
$ joker -v
v0.14.0
should I file an issue on github?
Quoting from the README.md at https://github.com/candid82/joker:
If you use :refer :all Joker won't be able to properly resolve symbols because it doesn't know what vars are declared in the required namespace (i.e. clojure.test). There are generally three options here:
Since :use
is similar to :refer :all
, the advice pertains. Check out the three options listed in that file.oh, i forgot that. Thanks!
When using ns-sources
, why do you map a string for the namespace, rather than a symbol? Seems odd. Also, feels odd to put the ns-sources
before the ns
call, rather than inside it, ala :require, etc.
ANN: net.lewisship.multi v1.0.0
net.lewisship.multi
is a complement to joker.tools.cli that allows a single tool, a Joker script, to
contain multiple commands, each with its own command line options and arguments.
https://github.com/hlship/multi
I think the ns-sources
mechanism is promising, but I think it could be a bit easier; for instance, a special case for libraries that are available from github; maybe
(ns-sources {"net.lewisship.multi" {:github "hlship/multi" :version "v1.0.0"}})
would expand to <https://raw.githubusercontent.com/hlship/multi/v1.0.0/src/net/lewisship/multi.joke>
Woah! That ns-sources
looks awesome!
> {:github "hlship/multi" :version "v1.0.0"}
:version
here is a ref/tag?
That was just a strawman; right now only :url is supported, not :github. Maybe :tag would be more be more accurate than :version?
Yeah I thought :tag
/ :sha
would be good options for the github interface
I had originally gone down that route, only to realize that it was challenging at best (I couldn't find a suitable solution) to get to private repos
I had debated how much to do in go vs joker, but maybe there's a path where the ns-sources could be extended through a multimethod so you could support external libs from any number of foreign source