@@ -209,5 +209,35 @@
|
|||||||
rest)]
|
rest)]
|
||||||
(assoc node :children new-children)))
|
(assoc node :children new-children)))
|
||||||
|
|
||||||
|
(defn- neighbourly-mapcat [coll f]
|
||||||
|
(let [rest-coll (rest coll)]
|
||||||
|
(map f
|
||||||
|
coll
|
||||||
|
rest-coll
|
||||||
|
(concat (rest rest-coll) [nil]))))
|
||||||
|
|
||||||
|
(comment
|
||||||
|
(-> [1 2 3 4]
|
||||||
|
(neighbourly-mapcat prn) )
|
||||||
|
(def doc (read-string (slurp some-org-file)))
|
||||||
|
|
||||||
|
(let [r (atom [])
|
||||||
|
blah
|
||||||
|
(sp/transform
|
||||||
|
[postorder-walker
|
||||||
|
(sp/must :children)
|
||||||
|
(sp/collect-one sp/VAL)
|
||||||
|
sp/INDEXED-VALS
|
||||||
|
#_
|
||||||
|
#(of-type? (second %) "latex-environment")
|
||||||
|
#_
|
||||||
|
sp/ALL
|
||||||
|
#_
|
||||||
|
sp/INDEXED-VALS]
|
||||||
|
(fn [siblings x]
|
||||||
|
x)
|
||||||
|
doc)]
|
||||||
|
@r))
|
||||||
|
|
||||||
(defn gather-latex-paragraphs [node]
|
(defn gather-latex-paragraphs [node]
|
||||||
)
|
())
|
||||||
|
|||||||
Reference in New Issue
Block a user