diff --git a/doerg/src/net/deertopia/doerg/element.clj b/doerg/src/net/deertopia/doerg/element.clj index 404651a..ab85af3 100644 --- a/doerg/src/net/deertopia/doerg/element.clj +++ b/doerg/src/net/deertopia/doerg/element.clj @@ -209,5 +209,35 @@ rest)] (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] - ) + ())