Skip to content

Commit

Permalink
fix attr code load
Browse files Browse the repository at this point in the history
  • Loading branch information
Takahiro Hozumi committed Oct 31, 2010
1 parent 4cff2a1 commit 6c026df
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/leiningen/hicv.clj
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
(reduce conj {}
(map (fn [[k v]]
[(if-let [[_ c] (re-matches
(Pattern/compile (str *attr-code-prefix* "(\\.*)"))
(Pattern/compile (str *attr-code-prefix* "(.*)"))
(name k))]
(read-from-str c) k)
(if-let [[_ c] (re-matches
(Pattern/compile (str *attr-code-prefix* "(\\.*)"))
(Pattern/compile (str *attr-code-prefix* "(.*)"))
v)]
(read-from-str c) v)]) attrs)))

Expand Down Expand Up @@ -243,18 +243,20 @@
(let [nodes (-> resource en/html-resource first :content)]
(map html2hic* nodes)))

(defn- html2hic-front []
(defn- html2hic-front [& [file-names]]
(doall (map pp/pprint
(filter #(not (and (string? %)
(re-matches #"\n\s*" %)))
(mapcat html2hic (.listFiles (io/file *hicv-dir-name*)))))))
(mapcat html2hic (if (empty? file-names)
(.listFiles (io/file *hicv-dir-name*))
(map #(str *hicv-dir-name* %) file-names)))))))

(defn hicv
[project & [first-arg &rest-args]]
[project & [first-arg & rest-args]]
(condp = first-arg
"2html" (hic2html (:source-path project) (:target-hiccup project))
"2htmls" (hic2htmls (:source-path project) (:target-hiccup project))
"2hic" (html2hic-front)
"2hic" (html2hic-front rest-args)
(println "Usage:
lein hicv 2html
lein hicv 2htmls
Expand Down

0 comments on commit 6c026df

Please sign in to comment.