This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-05
Channels
- # announcements (23)
- # babashka (23)
- # beginners (48)
- # calva (41)
- # clj-kondo (41)
- # cljs-dev (75)
- # cljsrn (5)
- # clojure (85)
- # clojure-europe (46)
- # clojure-nl (2)
- # clojure-spec (70)
- # clojure-uk (4)
- # clojurescript (52)
- # core-async (2)
- # cursive (16)
- # datahike (2)
- # datomic (4)
- # emacs (15)
- # figwheel-main (2)
- # fulcro (5)
- # gratitude (5)
- # helix (14)
- # introduce-yourself (2)
- # jackdaw (13)
- # keyboards (2)
- # lsp (8)
- # luminus (5)
- # malli (3)
- # meander (12)
- # nextjournal (52)
- # off-topic (19)
- # other-languages (1)
- # overtone (3)
- # pathom (4)
- # podcasts-discuss (1)
- # re-frame (6)
- # reitit (1)
- # releases (2)
- # ring (3)
- # sci (22)
- # shadow-cljs (3)
- # specter (1)
- # testing (3)
- # tools-deps (100)
- # uncomplicate (2)
Morning!
Morgen!
Does anyone else find themselves missing some kind of Closeable protocol in Clojure?
I recently did, I think. Would be nice to have one, and with-open
working with that. I can impl the java interface but that is not as convenient.
We've ended up creating our own protocol, so we can extend it to things we want, and our own with-resources
macro that's very reminiscent of with-open
in it's implementation.
It handles java AutoCloseable things too
Moarning! Another blog: https://blog.michielborkent.nl/better-clojure-highlighting.html https://twitter.com/borkdude/status/1456603111762579460
a neat trick you can do with emacs : use htmlize on the cli on clj files direclty, then you get basically what emacs would show you, and it's fully static, no js involved
I used to do this for presentations when I didn't want to bother using more heavy solutions
@U050SC7SV hmm, that sounds familiar, I'll take a look.
package htmlize, you can test it with htmlize-region, it opens a buffer with html with css inlined
I think I used that way back when I wrote a course in clojure and published the course material using org mode
it would be even easier to include the code-mirror itself but I suppose that you don't want users to pay a download cost?
@U04V5V0V4 you mean load these libs from a CDN + a small JS script? yeah that's also possible perhaps
but this is going to double the size of the downloads since I'm using only about half of codemirror and in the future probably even less
just saying, download size is probably not going to be the thing that pisses off your users :)
or did you see anything obvious in my blog that will piss people off, that I missed myself? :-D
I know everything has a price ... that's also my point: there is a cost to break something apart and take care of it yourself. In this case you were happy to pay that price and that's cool.
I don't expect this JS file to have many changes in the future and I wanted to get a better grasp of this library anyway, so it was fun to do :)
I got it down to 200kb (79kb gzipped) now. Updated blog post. https://blog.michielborkent.nl/better-clojure-highlighting.html