Skip to content

Commit

Permalink
added support for page-break, clear-double-page
Browse files Browse the repository at this point in the history
  • Loading branch information
yogthos committed Jan 10, 2016
1 parent 7296ab9 commit eeec157
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 34 deletions.
33 changes: 0 additions & 33 deletions src/app/repl.clj

This file was deleted.

9 changes: 8 additions & 1 deletion src/app/views.clj
Expand Up @@ -2,6 +2,7 @@
(:use [hiccup core page form] cheshire.core markdown.core)
(:require [clj-pdf.core :as pdf]
[app.md :as md]
[clojure.walk :refer [prewalk]]
[ring.util.response :as response]
[clojure.java.io :as io])
(:import [java.io File StringWriter]
Expand Down Expand Up @@ -56,4 +57,10 @@
(generate-pdf (partial md/md-to-pdf md-input)))

(defn json-to-pdf [json-input]
(generate-pdf (partial pdf/pdf (parse-string json-input true))))
(generate-pdf (partial pdf/pdf (prewalk
(fn [node]
(case node
["pagebreak"] [:pagebreak]
["clear-double-page"] [:clear-double-page]
node))
(parse-string json-input true)))))

0 comments on commit eeec157

Please sign in to comment.