Created
October 12, 2024 12:27
-
-
Save dtomvan/3d1844d0e008828285181e6e76141b91 to your computer and use it in GitHub Desktop.
Planify converter from JSON backup file to markdown
This file contains hidden or 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
.projects as $p | |
| .sections as $s | |
| .items | |
| map(select(.completed_at == "")) | |
| group_by(.project_id) | |
| map([ | |
"# \(.[0].project_id as $id | $p | map(select(.id == $id))[0].name)", | |
(group_by(.section_id) | | |
map( | |
[ | |
"## \(.[0].section_id as $id | $s | (map(select($id == .id))[0] // {name: "No Section"}).name)", | |
(map("### \(.content)\n\(.description)\n\n[due::\(.due | fromjson | .date)]") | join("\n\n")) | |
] | join("\n") | |
) | join("\n\n") | |
)] | join("\n") | |
) | join("\n\n") |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -euxo pipefail | |
jq -rf ./planify-json-export.jq "$1" | nvim +'set ft=markdown buftype=nofile' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment