-
-
Save Stvad/bb095babb3dbaa5e71fc4e101463f765 to your computer and use it in GitHub Desktop.
delete empty Roam blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
empty = roamAlphaAPI.q( | |
'[:find ?uid :where [?x :block/string ?content] [?x :block/uid ?uid] [(clojure.string/blank? ?content)]]') | |
empty.map(it=>block(it[0])).filter(it=>it.children.length === 0 ).forEach(it=>{ | |
roamAlphaAPI.deleteBlock({block: {uid: it.uid}}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires https://github.com/Stvad/iroam to run