Skip to content
ChenYong edited this page Nov 22, 2017 · 4 revisions

This page is outdated, AGAIN. Latest solution is https://github.com/Cirru/cumulo-editor


This project is old, I've been using Boot for long and suggested way of using Cirru Sepal is combining it with there tool:


Actually we need lein-cirru-sepal, a plugin, to help compiling Sepal.clj code into Clojure. Here are the steps:

First, create project with lein new demo, use you own project name, I use demo for example, then add lein-cirru-sepal as plugin, notice its spelling:

:plugins [[cirru/lein-sepal "0.0.11"]]

We need to configure plugin so it recognizes our special folder. Make sure it contains cirru- as prefix:

:cirru-sepal {:paths ["cirru-src"]}

Now let's create a file in Cirru, the file structure is supposed to be the same as src/ folder. Notice core.clj.cirru, it's a bit long, you may use core.cljs.cirru if you want it to generate core.cljs:

mkdir -p cirru-src/demo/
touch cirru-src/demo/core.clj.cirru

Here's a short example how I will write about code.clj.cirru. You can already see the difference, it's indentation based-synax. [] here is a shorthand for writing vectors:

ns demo.core
  :require
    [] clojure.string :as string

defn greet ()
  println "|hello world!"

So let's compile it:

lein cirru-sepal

The you will find code generated at src/demo/core.clj, in which cirru- and .cirru are removed from the path.

There's a watching mode to listen file changes and compile:

lein cirru-sepal watch

That's all about how to use the plugin and now you can write Clojure in an indentation-based syntax.

Now it's time to read more examples and try by yourself.

Clone this wiki locally