This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-12
Channels
- # admin-announcements (2)
- # aleph (2)
- # arachne (16)
- # beginners (33)
- # boot (20)
- # bristol-clojurians (6)
- # capetown (4)
- # cider (50)
- # clojure (74)
- # clojure-austin (4)
- # clojure-canada (1)
- # clojure-china (2)
- # clojure-czech (1)
- # clojure-greece (1)
- # clojure-poland (4)
- # clojure-quebec (5)
- # clojure-russia (5)
- # clojure-spec (34)
- # clojure-uk (45)
- # clojurescript (131)
- # cursive (4)
- # datascript (2)
- # datomic (9)
- # editors (2)
- # emacs (2)
- # hoplon (173)
- # jobs (5)
- # lein-figwheel (3)
- # leiningen (1)
- # off-topic (1)
- # om (44)
- # onyx (8)
- # proton (10)
- # re-frame (81)
- # reagent (23)
- # untangled (57)
- # vim (2)
- # yada (8)
@madstap: https://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html#read(byte[],%20int,%20int)
@madstap: http://stackoverflow.com/questions/20155829/how-do-i-read-the-last-n-bytes-of-a-file-in-java
that should get you going 🙂
Sorry if this is very basic, I’m new to Clojurescript and I’m trying to configure cljsjs/marked
and cljsjs/highlight
. I’m attempting to use marked.setOptions
to send in an options
object. This is a fairly common js pattern so there must be something I’m missing.
marked.setOptions({
highlight: function (code) {
return require('highlight.js').highlightAuto(code).value;
}
});
Hey @davin 👋
(.setOptions js/marked (js-obj "highlight" (fn [code] (.highlightAuto js/highlight code))))
No, perfectly fine
You can try #js {}
instead of js-obj
which is easier to read imho but I think both should work
Actually the error is Uncaught ReferenceError: highlight is not defined
called from inside marked
CLJSJS packages don't expose any globals like js/highlight
on their own, instead they just load a library's file which usually defines the global. In the case of highlight.js the global seems to be called hljs
so try js/hljs
maybe
not quite rendering correctly, it renders out [object Object]
. Must be a way to convert that to a str.
But this is internal to my configuration. Thanks for the help @martinklepsch!
@davin I think you might be missing the .value
thing from the JS snippet
working now, thanks again @martinklepsch
`(System/setProperty "archaius.configurationSource.defaultFileName" "archaius.properties")` , where should I put this sort of init code while generating uberjar?
quick question: I have a record A which is a relatively big data structure that has other records in it, for example:
#A{:some "fields" :another-record #B{:a b :c d} ...}
I want to transform it all into a simple map, what would be a nice way to do that?
I thought of recursively applying (into {} ...)
to all the records (internals and external), but I guess there should be a better way