python3 bear_export_sync.py --out ~/Bear/notes --backup ~/Bear/backup note-link-janitor ~/Bear/notes python3 bear_export_sync.py --out ~/Bear/notes --backup ~/Bear/backup
A huge thanks to Andy. This is only possible because of his Open-source work on Github.
Lucky enough, I found
Bear-Markdown-Export scripts from Andy, which help Bear sync its notes and add backlinks to it.
We first need to clone the repo.
git clone email@example.com:andymatuschak/Bear-Markdown-Export.git
And then install note-link-janitor globally.
yarn global add @andymatuschak/note-link-janitor
Bear markdown export needs a directory where all the notes get exported to, as markdown files.
python3 bear_export_sync.py --out ~/Bear/notes --backup ~/Bear/backup
To these markdown files, note-link-janitor can add backlinks.
And then, when you run the first script again, these changes are synced back to Bear.
As the intermediate level is markdown files, which end up being the source if truth, this can be saved on the cloud using Dropbox or GDrive. And you can edit them outside the Apple ecosystem. For me it is iA writer on Android.
An easy way to run this regularly is to create a bash script with those 3 lines, so we can execute all of them in one go.