This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
(ns net.deertopia.doerg.common
|
(ns net.deertopia.doerg.common
|
||||||
(:require [babashka.process :as p]
|
(:require [babashka.process :as p]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[clojure.tools.logging :as l]))
|
[clojure.tools.logging :as l]
|
||||||
|
[clojure.java.io :as io])
|
||||||
|
(:import (java.io FilterInputStream)))
|
||||||
|
|
||||||
(defn deref-with-timeout [process ms]
|
(defn deref-with-timeout [process ms]
|
||||||
(let [p (promise)
|
(let [p (promise)
|
||||||
@@ -18,6 +20,17 @@
|
|||||||
:timed-out-after-milliseconds ms}))
|
:timed-out-after-milliseconds ms}))
|
||||||
@p)))
|
@p)))
|
||||||
|
|
||||||
|
#_
|
||||||
|
(defn tee-to-logs [input output]
|
||||||
|
(Thread. (fn []
|
||||||
|
(io/copy (l/log-stream :debug)))))
|
||||||
|
|
||||||
|
(defrecord TeeInputStream
|
||||||
|
[out]
|
||||||
|
FilterInputStream)
|
||||||
|
|
||||||
|
(extend)
|
||||||
|
|
||||||
(defn invoke [opts & cmd]
|
(defn invoke [opts & cmd]
|
||||||
(l/info (str/join " " (cons "$" cmd)))
|
(l/info (str/join " " (cons "$" cmd)))
|
||||||
(let [r (apply p/shell
|
(let [r (apply p/shell
|
||||||
|
|||||||
@@ -90,17 +90,6 @@
|
|||||||
(sp/view #(update % :children seq))
|
(sp/view #(update % :children seq))
|
||||||
sp/STAY))
|
sp/STAY))
|
||||||
|
|
||||||
#_
|
|
||||||
(defn- gather-footnotes [doc]
|
|
||||||
(->> doc
|
|
||||||
(sp/select
|
|
||||||
[element/children-walker element/footnotes-section?
|
|
||||||
element/children-walker
|
|
||||||
#(element/of-type? % "footnote-definition")
|
|
||||||
(sp/view (fn [d]
|
|
||||||
{(:label d) d}))])
|
|
||||||
(apply merge)))
|
|
||||||
|
|
||||||
(defn- contains-footnote-refs? [node]
|
(defn- contains-footnote-refs? [node]
|
||||||
(some #(element/of-type? % "footnote-reference")
|
(some #(element/of-type? % "footnote-reference")
|
||||||
(:children node)))
|
(:children node)))
|
||||||
|
|||||||
@@ -6,9 +6,12 @@
|
|||||||
|
|
||||||
;;; XeLaTeX
|
;;; XeLaTeX
|
||||||
|
|
||||||
(def scale-divisor 66873.46948423679)
|
(def ^:private scale-divisor 66873.46948423679)
|
||||||
|
|
||||||
(def font-size 10)
|
(def ^:private font-size 10)
|
||||||
|
|
||||||
|
(def ^:private tightpage-regexp
|
||||||
|
#"^Preview: Tightpage (-?[0-9]+)\s*(-?[0-9]+)\s*(-?[0-9]+)\s*(-?[0-9]+)")
|
||||||
|
|
||||||
(defn- invoke-xelatex [& {:keys [file output-dir]}]
|
(defn- invoke-xelatex [& {:keys [file output-dir]}]
|
||||||
(let [{:keys [out]} (common/invoke
|
(let [{:keys [out]} (common/invoke
|
||||||
|
|||||||
Reference in New Issue
Block a user