switched to pegdown plugin
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
:dependencies [[org.clojure/clojure "1.4.0"]
|
:dependencies [[org.clojure/clojure "1.4.0"]
|
||||||
[hiccup "1.0.0"]
|
[hiccup "1.0.0"]
|
||||||
[cssgen "0.2.6"]
|
[cssgen "0.2.6"]
|
||||||
[markdown-clj "0.8"]
|
[org.pegdown/pegdown "1.1.0"]
|
||||||
[noir "1.3.0-beta1"]]
|
[noir "1.3.0-beta1"]]
|
||||||
:plugins [[lein-cljsbuild "0.1.10"]]
|
:plugins [[lein-cljsbuild "0.1.10"]]
|
||||||
:cljsbuild {
|
:cljsbuild {
|
||||||
|
|||||||
@@ -5,20 +5,20 @@
|
|||||||
[hiccup.page :only [include-js html5]]
|
[hiccup.page :only [include-js html5]]
|
||||||
[hiccup.element :only [javascript-tag]]))
|
[hiccup.element :only [javascript-tag]]))
|
||||||
|
|
||||||
(defn gen-comma-list [fonts] (apply str (interpose "," fonts)))
|
(defn gen-comma-list [& fonts] (apply str (interpose "," fonts)))
|
||||||
|
(def helvetica-neue
|
||||||
|
(mixin
|
||||||
|
:font-weight 300
|
||||||
|
:font-family (gen-comma-list "'Helvetica Neue'"
|
||||||
|
"Helvetica"
|
||||||
|
"Arial"
|
||||||
|
"'Lucida Grande'"
|
||||||
|
"sans-serif")))
|
||||||
|
|
||||||
(def global-css
|
(def global-css
|
||||||
(css
|
(css
|
||||||
(rule ".centerized"
|
(rule ".centerized"
|
||||||
:text-align :center)
|
:text-align :center)
|
||||||
(def helvetica-neue
|
|
||||||
(mixin
|
|
||||||
:font-weight 300
|
|
||||||
:font-family (gen-comma-list ["'Helvetica Neue'"
|
|
||||||
"Helvetica"
|
|
||||||
"Arial"
|
|
||||||
"'Lucida Grande'"
|
|
||||||
"sans-serif"])))
|
|
||||||
(rule ".button"
|
(rule ".button"
|
||||||
:box-shadow [0 :2px :5px :#aaa]
|
:box-shadow [0 :2px :5px :#aaa]
|
||||||
:text-decoration :none
|
:text-decoration :none
|
||||||
@@ -50,6 +50,7 @@
|
|||||||
(rule "*:focus"
|
(rule "*:focus"
|
||||||
:outline [:0px :none :transparent])
|
:outline [:0px :none :transparent])
|
||||||
(rule "textarea"
|
(rule "textarea"
|
||||||
|
:width "900px"
|
||||||
:font-family :Courier
|
:font-family :Courier
|
||||||
:font-size :1.3em
|
:font-size :1.3em
|
||||||
:border :none
|
:border :none
|
||||||
@@ -68,7 +69,11 @@
|
|||||||
:margin-bottom :5em
|
:margin-bottom :5em
|
||||||
:margin-left "auto"
|
:margin-left "auto"
|
||||||
:margin-right "auto")
|
:margin-right "auto")
|
||||||
(rule "h1, h2, h3, h4" :font-family "'Noticia Text'")))
|
(rule "h1"
|
||||||
|
:font-size :2em)
|
||||||
|
(rule "h1, h2, h3, h4"
|
||||||
|
:font-family (gen-comma-list
|
||||||
|
"'Noticia Text'" "Georgia"))))
|
||||||
|
|
||||||
(defpartial layout [title & content]
|
(defpartial layout [title & content]
|
||||||
(html5
|
(html5
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
(ns NoteHub.views.pages
|
(ns NoteHub.views.pages
|
||||||
(:require [NoteHub.views.common :as common])
|
(:require [NoteHub.views.common :as common])
|
||||||
(:use [noir.core :only [defpage]]
|
(:use [noir.core :only [defpage]]
|
||||||
[hiccup.form]
|
[hiccup.form])
|
||||||
[markdown :only [md-to-html-string]]))
|
(:import [org.pegdown PegDownProcessor]))
|
||||||
|
|
||||||
(defpage "/" {}
|
(defpage "/" {}
|
||||||
(common/layout "Free Markdown Hosting"
|
(common/layout "Free Markdown Hosting"
|
||||||
@@ -25,4 +25,4 @@
|
|||||||
(defpage [:post "/preview-note"] {:keys [draft]}
|
(defpage [:post "/preview-note"] {:keys [draft]}
|
||||||
(common/layout "Preview of ..."
|
(common/layout "Preview of ..."
|
||||||
[:article.central-body
|
[:article.central-body
|
||||||
(md-to-html-string draft)]))
|
(.markdownToHtml (PegDownProcessor.) draft)]))
|
||||||
|
|||||||
Reference in New Issue
Block a user