diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-11-20 16:17:57 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-11-20 16:17:57 +0100 |
commit | 9b1d5e260aab6f691fa3e2b39704334364a53fa3 (patch) | |
tree | 182133694cdef3eabac1d6bcb3346d44459f276d /src/mulk/benki/util.clj | |
parent | bbb70dee15c88612ddc35565af6b2b9940357e8d (diff) |
Make Wiki editable.
Diffstat (limited to 'src/mulk/benki/util.clj')
-rw-r--r-- | src/mulk/benki/util.clj | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/mulk/benki/util.clj b/src/mulk/benki/util.clj index 5b2e484..c2729f9 100644 --- a/src/mulk/benki/util.clj +++ b/src/mulk/benki/util.clj @@ -1,6 +1,7 @@ (ns mulk.benki.util (:refer-clojure) - (:use [hiccup core page-helpers] + (:use [hiccup core page-helpers] + [clojure.core.match.core :only [match]] noir.core)) @@ -21,6 +22,27 @@ ;; defpartial is just defn + html. (defpartial layout [title & content] (html5 - [:head [:title title]] + [:head + [:title title] + ;; jQuery + [:script {:type "text/javascript" + :src (resolve-uri "/3rdparty/jquery/jquery-1.7.min.js")}] + ;; Aloha Editor + [:link {:rel "stylesheet" + :href (resolve-uri "/3rdparty/alohaeditor/aloha/css/aloha.css")}] + [:script {:type "text/javascript" + :src (resolve-uri "/3rdparty/alohaeditor/aloha/lib/aloha.js") + :data-aloha-plugins "common/format,common/highlighteditables,common/list,common/link,common/undo,common/paste,common/block"}] + ;; JavaScript + [:script {:type "text/javascript" + :src (resolve-uri "/js/wiki.js")}]] [:body [:h1 title] content])) + + +(defn fresolve [s & args] + (resolve-uri (apply fmt nil s args))) + +(defn link [& args] + (match [(vec args)] + [[:wiki title & xs]] (fresolve "/wiki/~a~@[?~a~]" title (name (first xs))))) |