   (:require [clojure.tools.logging :as log])
   (:gen-class))
 
-(def ^:private template-filename "test/test.docx")
-(def ^:private output-filename "test/testoutput.safetodelete.docx")
+(def ^:private test-filename "test/test.docx")
+(def ^:private test-output-filename "test/testoutput.safetodelete.docx")
 (def ^:private bookmark-map { "BM_Text"             "#THIS TEXT WAS INSERTED INTO BOOKMARK \"BM_Text\"#",
                               "BM_NoText"           "#THIS TEXT WAS INSERTED INTO BOOKMARK \"BM_NoText\"#",
                               "BM_InTable"          "#THIS TEXT WAS INSERTED INTO BOOKMARK \"BM_InTable\"#",

  ;; work around dangerous default behaviour in Clojure
  (alter-var-root #'*read-eval* (constantly false))

  (populate-bookmarks! template-filename output-filename bookmark-map))

  [input-document
   output-document
   bookmark-map]
  (let [template-document (org.docx4j.Docx4J/load input-document)]
    (replace-bookmark-text! template-document bookmark-map)
    (org.docx4j.Docx4J/save template-document (clojure.java.io/file output-document) org.docx4j.Docx4J/FLAG_SAVE_ZIP_FILE)))

(defn -main
