Permalink
Browse files

Updated to newest version of clj-highlight.

  • Loading branch information...
1 parent 85c7203 commit 585f379e71059d209d76728507f3025a9188831c @Licenser Licenser committed May 20, 2010
Showing with 6 additions and 13 deletions.
  1. +1 −1 project.clj
  2. +5 −12 src/tryclojure/tutorial.clj
View
@@ -6,7 +6,7 @@
[ring/ring-jetty-adapter "0.2.0"]
[commons-lang/commons-lang "2.5"]
[clj-sandbox "0.3.7"]
- [clj-highlight "0.1.0-SNAPSHOT"]
+ [clj-highlight "0.1.1-SNAPSHOT"]
[hiccup "0.2.3"]
[clj-gist "1.0.0-SNAPSHOT"]]
:dev-dependencies [[swank-clojure "1.2.1"]
@@ -1,20 +1,13 @@
(ns tryclojure.tutorial
(:use hiccup.core
- clj-highlight.core))
+ clj-highlight.core
+ clj-highlight.syntax.clojure
+ clj-highlight.output.hiccup))
-(def clj-tokenizer
- (mangle-tokens
- :space
- (fn [k t s]
- [k (.replace t "\n" "<br/>") s])
- (mangle-tokens
- nil
- (fn [k t s]
- [k (escape-html t) s])
- (tokenizer clj-syntax))))
+(def clj-highlighter (highlighter clj-syntax (to-hiccup) html-escape-mangler newline-to-br-mangler))
(defn highlight [code]
- (html (to-html default-stype-map "code" (clj-tokenizer code))))
+ (html (clj-highlighter code)))
(defn code [s] (highlight s))

0 comments on commit 585f379

Please sign in to comment.