Last active
October 20, 2023 16:27
-
-
Save pyhedgehog/7d6e3cd9c344a0ea4ea7b04469387c26 to your computer and use it in GitHub Desktop.
vym2json.sh
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
unzip -p 20231020.vym map.xml \ | |
| xq . \ | |
| jq ' | |
def branches: | |
if type=="array" then . else [.] end| | |
map(.key=.heading["#text"]| | |
.value=(.branch? // []|branches))| | |
if length==0 then null | |
elif all(.value|length==0) then map(.key) | |
else from_entries end | |
; | |
.vymmap.mapcenter|branches' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment