Browse Source

switched to pegdown plugin

master
Christian Mueller 14 years ago
parent
commit
e05e93784b
  1. 2
      project.clj
  2. 25
      src/NoteHub/views/common.clj
  3. 6
      src/NoteHub/views/pages.clj

2
project.clj

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
:dependencies [[org.clojure/clojure "1.4.0"]
[hiccup "1.0.0"]
[cssgen "0.2.6"]
[markdown-clj "0.8"]
[org.pegdown/pegdown "1.1.0"]
[noir "1.3.0-beta1"]]
:plugins [[lein-cljsbuild "0.1.10"]]
:cljsbuild {

25
src/NoteHub/views/common.clj

@ -5,20 +5,20 @@ @@ -5,20 +5,20 @@
[hiccup.page :only [include-js html5]]
[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
(css
(rule ".centerized"
: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"
:box-shadow [0 :2px :5px :#aaa]
:text-decoration :none
@ -50,6 +50,7 @@ @@ -50,6 +50,7 @@
(rule "*:focus"
:outline [:0px :none :transparent])
(rule "textarea"
:width "900px"
:font-family :Courier
:font-size :1.3em
:border :none
@ -68,7 +69,11 @@ @@ -68,7 +69,11 @@
:margin-bottom :5em
:margin-left "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]
(html5

6
src/NoteHub/views/pages.clj

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
(ns NoteHub.views.pages
(:require [NoteHub.views.common :as common])
(:use [noir.core :only [defpage]]
[hiccup.form]
[markdown :only [md-to-html-string]]))
[hiccup.form])
(:import [org.pegdown PegDownProcessor]))
(defpage "/" {}
(common/layout "Free Markdown Hosting"
@ -25,4 +25,4 @@ @@ -25,4 +25,4 @@
(defpage [:post "/preview-note"] {:keys [draft]}
(common/layout "Preview of ..."
[:article.central-body
(md-to-html-string draft)]))
(.markdownToHtml (PegDownProcessor.) draft)]))

Loading…
Cancel
Save