add debugging output options
This commit is contained in:
parent
b7676fcab1
commit
9a1b0d9ed6
|
@ -41,6 +41,8 @@
|
||||||
(let [html (read-html-string in)
|
(let [html (read-html-string in)
|
||||||
html-doc (Jsoup/parse html)]
|
html-doc (Jsoup/parse html)]
|
||||||
(o/inject-options-into-html! html-doc options)
|
(o/inject-options-into-html! html-doc options)
|
||||||
|
(if (get-in options [:debug :display-html?])
|
||||||
|
(println (str html-doc)))
|
||||||
html-doc))
|
html-doc))
|
||||||
|
|
||||||
(defn write-pdf!
|
(defn write-pdf!
|
||||||
|
@ -55,7 +57,7 @@
|
||||||
|
|
||||||
(defn ->pdf
|
(defn ->pdf
|
||||||
[in out & [options]]
|
[in out & [options]]
|
||||||
(let [options (merge o/default-options options)
|
(let [options (o/get-final-options options)
|
||||||
html-doc (prepare-html in options)]
|
html-doc (prepare-html in options)]
|
||||||
(configure-logging! options)
|
(configure-logging! options)
|
||||||
(write-pdf! html-doc (o/->base-uri options) out)))
|
(write-pdf! html-doc (o/->base-uri options) out)))
|
||||||
|
|
|
@ -15,6 +15,13 @@
|
||||||
:orientation :portrait
|
:orientation :portrait
|
||||||
:margin "1.0in"}})
|
:margin "1.0in"}})
|
||||||
|
|
||||||
|
(defn get-final-options
|
||||||
|
[options]
|
||||||
|
(let [final-options (merge default-options options)]
|
||||||
|
(if (get-in final-options [:debug :display-options?])
|
||||||
|
(clojure.pprint/pprint final-options))
|
||||||
|
final-options))
|
||||||
|
|
||||||
(defn ->base-uri
|
(defn ->base-uri
|
||||||
[options]
|
[options]
|
||||||
(str (:base-uri options)))
|
(str (:base-uri options)))
|
||||||
|
|
Loading…
Reference in a new issue