Skip to content

Instantly share code, notes, and snippets.

@cannibalox
Last active May 16, 2021 01:06
Show Gist options
  • Save cannibalox/b89d14f0fee192d877a89f306de65e96 to your computer and use it in GitHub Desktop.
Save cannibalox/b89d14f0fee192d877a89f306de65e96 to your computer and use it in GitHub Desktop.
convert logseq 0.0.20 to LS-Canary
# convert logseq to LS-Canary v20210516
for file in *.md **/*.md **/**/*.md
do
# filepath=""$file""
# file_name=$(basename "$file")
echo "PROCESSING....... "$file"..."
# queryb='#+BEGIN_QUERY'
# querye='#+END_QUERY'
# ls properties
sed -i '/^:heading:/d;
/^:PROPERTIES:/d;
/^:END:/d;
s/^:custom_id:/id::/;
s/^:id:/id::/;
s/^:background_color:/background_color::/;
s/^:template:/template::/;
s/^:todo:/todo::/;
s/^:doing:/doing::/;
s/^:done:/done::/;
s/^:later:/later::/;
s/^:now:/now::/;
s/^:including-parent:/including-parent::/;
# my custom properties
s/^:year:/year::/;
s/^:real:/real::/;
s/^:cast:/cast::/;
s/^:dp:/dp::/;
s/^:writer:/writer::/;
s/^:director:/director::/;
s/^:genre:/genre::/;
s/^:rating:/rating::/;
s/^### year:/year::/;
s/^### genre:/genre::/;
s/^### country:/country::/;
s/^### director:/director::/;
s/^### cast:/cast::/;
s/^### actors:/actors::/;
s/^### tags:/tags::/;
s/^### rating:/rating::/;
/^### watched:/d;
s/^### similar to:/similar-to::/;
s/^### STORYLINE:/storyline::/;
s/^### GOOD:/good::/;
s/^### BAD:/bad::/;
s/^:players:/players::/;
s/^:weight:/weight::/;
s/^:playing time:/playing-time::/;
# bullets
s/^##########/\t\t\t\t\t\t\t\t-/;
s/^#########/\t\t\t\t\t\t\t-/;
s/^########/\t\t\t\t\t\t-/;
s/^#######/\t\t\t\t\t-/;
s/^######/\t\t\t\t-/;
s/^#####/\t\t\t-/;
s/^####/\t\t-/;
s/^###/\t-/;
s/^##/-/' "$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment