klipse

Yehonathan Sharvit 2017-01-18T09:17:46.000358Z

core.async is avaliable inside KLIPSE

Yehonathan Sharvit 2017-01-18T09:17:47.000359Z

https://twitter.com/viebel/status/821623117403590656

2017-01-18T14:00:20.000362Z

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

Yehonathan Sharvit 2017-01-18T14:01:06.000363Z

hi @madstap

2017-01-18T14:02:36.000364Z

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?

2017-01-18T14:02:55.000365Z

Neither seems to work

Yehonathan Sharvit 2017-01-18T14:03:14.000366Z

1. What are you going to blog about?

Yehonathan Sharvit 2017-01-18T14:03:33.000367Z

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

2017-01-18T14:10:29.000369Z

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...

2017-01-18T14:11:34.000370Z

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

2017-01-18T14:13:49.000371Z

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"]}

2017-01-18T14:15:14.000372Z

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

Yehonathan Sharvit 2017-01-18T14:15:41.000373Z

That makes a lot of sense

Yehonathan Sharvit 2017-01-18T14:15:58.000374Z

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

Yehonathan Sharvit 2017-01-18T14:16:15.000375Z

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

Yehonathan Sharvit 2017-01-18T14:16:15.000376Z

view-source:http://exupero.org/hazard/post/islands/

Yehonathan Sharvit 2017-01-18T14:18:04.000379Z

@madstap does it help ⬆️ ?

2017-01-18T14:20:39.000380Z

Yeah, linking directly to his css worked

2017-01-18T14:21:17.000381Z

Some issue with relative links I guess...

Yehonathan Sharvit 2017-01-18T14:21:36.000382Z

Cool!

Yehonathan Sharvit 2017-01-18T14:21:56.000383Z

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

Yehonathan Sharvit 2017-01-18T14:22:43.000386Z

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

2017-01-18T14:24:00.000387Z

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

2017-01-18T14:24:27.000388Z

pretty sweet

Yehonathan Sharvit 2017-01-18T14:24:31.000389Z

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

2017-01-18T14:25:42.000390Z

Here's the docstring for the function that includes klipse

2017-01-18T14:25:42.000391Z

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.

2017-01-18T14:26:33.000392Z

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

Yehonathan Sharvit 2017-01-18T14:26:33.000393Z

Nice!

Yehonathan Sharvit 2017-01-18T14:26:55.000394Z

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

Yehonathan Sharvit 2017-01-18T14:27:02.000395Z

and always serve from https

Yehonathan Sharvit 2017-01-18T14:27:45.000396Z

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

2017-01-18T14:28:27.000400Z

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

2017-01-18T14:28:39.000401Z

And I'll include the link there

Yehonathan Sharvit 2017-01-18T14:28:55.000402Z

Oh I see

Yehonathan Sharvit 2017-01-18T14:29:23.000403Z

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

Yehonathan Sharvit 2017-01-18T14:29:28.000404Z

See this issue https://github.com/gettalong/kramdown/issues/403

Yehonathan Sharvit 2017-01-18T14:29:37.000405Z

kramdown doesn’t support it

Yehonathan Sharvit 2017-01-18T14:29:59.000406Z

but maybe in cryogen it is supported

2017-01-18T14:30:08.000407Z

cryogen uses markdown-clj

2017-01-18T14:31:11.000408Z

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

Yehonathan Sharvit 2017-01-18T14:31:26.000409Z

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

2017-01-18T14:31:34.000410Z

Yeah

Yehonathan Sharvit 2017-01-18T14:32:03.000411Z

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

2017-01-18T14:32:53.000412Z

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

Yehonathan Sharvit 2017-01-18T14:33:09.000413Z

oh! that’d be great!

Yehonathan Sharvit 2017-01-18T14:34:41.000414Z

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

2017-01-18T14:35:26.000415Z

Yeah, that's a drawback

Yehonathan Sharvit 2017-01-18T14:35:54.000416Z

but it doesn’t happen every week 🙂

2017-01-18T14:36:39.000417Z

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

2017-01-18T14:36:56.000418Z

Wasn't there an om one as well?

Yehonathan Sharvit 2017-01-18T14:37:12.000419Z

no (not yet)

2017-01-18T14:39:04.000420Z

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

Yehonathan Sharvit 2017-01-18T14:42:45.000421Z

exactly

Yehonathan Sharvit 2017-01-18T14:43:01.000422Z

so - your solution is fine!