Add support for cljx reader tags #+clj and #+cljs to make it possible to generate marginalia docs in projects using cljx to target Clojure and ClojureScript.
This commit is contained in:
parent
a21cd992c4
commit
0e43f515a9
1 changed files with 10 additions and 3 deletions
|
@ -391,9 +391,16 @@
|
|||
(defn cljs-file? [filepath]
|
||||
(.endsWith (lower-case filepath) "cljs"))
|
||||
|
||||
(defn cljx-file? [filepath]
|
||||
(.endsWith (lower-case filepath) "cljx"))
|
||||
|
||||
(def cljx-data-readers {'+clj identity
|
||||
'+cljs identity})
|
||||
|
||||
(defn parse-file [file]
|
||||
(let [readers (if (cljs-file? file)
|
||||
(->> default-data-readers (merge *cljs-data-readers*))
|
||||
(let [readers (merge {}
|
||||
(when (cljs-file? file) *cljs-data-readers*)
|
||||
(when (cljx-file? file) cljx-data-readers)
|
||||
default-data-readers)]
|
||||
(binding [*data-readers* readers
|
||||
*comments-enabled* (atom true)]
|
||||
|
|
Loading…
Reference in a new issue