Skip to content

Instantly share code, notes, and snippets.

@pyhedgehog
Last active October 20, 2023 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyhedgehog/7d6e3cd9c344a0ea4ea7b04469387c26 to your computer and use it in GitHub Desktop.
Save pyhedgehog/7d6e3cd9c344a0ea4ea7b04469387c26 to your computer and use it in GitHub Desktop.
vym2json.sh
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