klipse 2017-01-18

core.async is avaliable inside KLIPSE

@viebel I'm trying to integrate klipse with cryogen, but I can't figure out how I'm supposed to include codemirror themes

Am I supposed to replace the app.klipse.tech/css/codemirror.css with the custom theme, or link to the costom theme as well as the standard one?

Neither seems to work

1. What are you going to blog about?

2. There are detailed explanations about codemirror styling here: https://github.com/viebel/klipse#styling

Yeah, I downloaded the themes from the page in that link... looking at the css, it seems like I need to include both the app.klipse.tech one and a theme, but nothing happens...

1. I giong to blog about random clojure stuff, but I'm trying to make a PR to cryogen for automatic klipse integration

In cryogen you blog in markdown, and on the top of the post you put a map of post metadata, like {:title "stuff", :tags ["clojure"]}

And I want to put a key in there like {:klipse {:config {:selector ".clojure"}, :js :non-min}

That makes a lot of sense

(BTW I’m using jekyll and ghost for my 2 blogs)

for the css issue, have you taken a look at exupero’s blog page source?

@madstap does it help ⬆️ ?

Yeah, linking directly to his css worked

Some issue with relative links I guess...

Cool!

Have you followed the recent developments in klipse: reagent, om.next, core.async?

And it loads pretty fast because the ns analysis is cached @madstap

Yeah, I've looked at the klipse blog from time to time, I saw the core.async announcement today

I can’t wait to discover your stuff...

Here's the docstring for the function that includes klipse

Takes a nested map of klipse configuration and generates a html string that configures and includes klipse for the page. The map requires :config and :js and optionally :https?, :css-base and :css-theme. :config Will be put in window.klipse_settings as json. kebab-cased keywords can be used, they will be transformed into snake_case and camelCase strings as necessary. :js Can either be one of :min or :non-min to include minified or non-minified js hosted by klipse, or it can be a string uri to the js hosted elsewhere. :https? Defaults to true. The official klipse js and codemirror css are hosted on different domains depending on whether your site is http or https. If you're hosting the js and css yourself you can ignore this. :css-base The uri to the css to style the codemirror editor. Defaults to the standard codemirror css hosted by klipse. :css-theme The uri to a codemirror theme. Defaults to nil.

That's basically how I'm imagining it will work, what do you think?

Nice!

I think you can get rid of the :https? option

and always serve from https

Also, I’d put a link to https://github.com/viebel/klipse#page-level-configuration for the :config option

Yeah, this is just the docstring to the function, I'm still gonna write actual user-facing documentation

And I'll include the link there

Oh I see

Did you find a way in markdown to parametrize the <code> element inside the <pre>

kramdown doesn’t support it

but maybe in cryogen it is supported

cryogen uses markdown-clj

I haven't really looked at it yet, figured if all else fails I can just put literal <pre><code> tags

Also, I’d add an explanation about min and non-min explaining that for clojure snippet it *must* be non-min

what default will you have for :js? min or non-min?

I was actually thinking of doing that programatically, default to :non-min if the :config map includes :selector :selector-reagent etc

oh! that’d be great!

the only risk is that when a new kind of clojure snippet is added to klipse, you will have to update your code

Yeah, that's a drawback

but it doesn’t happen every week 🙂

What kinds of clojure snippets are there anyways? :selector and :selector-reagent are the ones I see in the readme

Wasn't there an om one as well?

no (not yet)

There should only be new snippets for react wrappers and stuff like that, right? Other libraries are just a (require 'lib)

exactly

so - your solution is fine!