Fork me on GitHub
#klipse
<
2017-01-18
>
Yehonathan Sharvit09:01:46

core.async is avaliable inside KLIPSE

madstap14:01:20

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

madstap14:01:36

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?

madstap14:01:55

Neither seems to work

Yehonathan Sharvit14:01:14

1. What are you going to blog about?

Yehonathan Sharvit14:01:33

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

madstap14:01:29

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

madstap14:01:34

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

madstap14:01:49

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

madstap14:01:14

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

Yehonathan Sharvit14:01:41

That makes a lot of sense

Yehonathan Sharvit14:01:58

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

Yehonathan Sharvit14:01:15

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

madstap14:01:39

Yeah, linking directly to his css worked

madstap14:01:17

Some issue with relative links I guess...

Yehonathan Sharvit14:01:56

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

Yehonathan Sharvit14:01:43

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

madstap14:01:00

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

madstap14:01:27

pretty sweet

Yehonathan Sharvit14:01:31

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

madstap14:01:42

Here's the docstring for the function that includes klipse

madstap14:01:42

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.

madstap14:01:33

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

Yehonathan Sharvit14:01:55

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

Yehonathan Sharvit14:01:02

and always serve from https

madstap14:01:27

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

madstap14:01:39

And I'll include the link there

Yehonathan Sharvit14:01:23

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

Yehonathan Sharvit14:01:37

kramdown doesn’t support it

Yehonathan Sharvit14:01:59

but maybe in cryogen it is supported

madstap14:01:08

cryogen uses markdown-clj

madstap14:01:11

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

Yehonathan Sharvit14:01:26

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

Yehonathan Sharvit14:01:03

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

madstap14:01:53

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

Yehonathan Sharvit14:01:09

oh! that’d be great!

Yehonathan Sharvit14:01:41

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

madstap14:01:26

Yeah, that's a drawback

Yehonathan Sharvit14:01:54

but it doesn’t happen every week 🙂

madstap14:01:39

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

madstap14:01:56

Wasn't there an om one as well?

madstap14:01:04

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

Yehonathan Sharvit14:01:01

so - your solution is fine!