Directly edit a note .md file

Hi. Really love Joplin - use it on iOS with a Pencil and it works great.

I am trying to use Joplin for a very specific task. I want to have a note which I add URLs to, where the URL is for a youtube video. e.g. "h**ps://". I then have a script running on my Synology NAS that checks the note for new lines, and when it finds a new line, the script downloads the yt video and updates the Joplin note by deleting that URL line.

I am trying to edit the note by directly editing the .md file for the note in the WebDav sync folder. I've done this using a python script, changing the updated_time field to reflect the time I make the update. Having done this, when I sync'd the iOS app, it pulled down the changes, but then subsequently, Joplin started to create duplicates of the note containing the pre-changed contents.

I have tried lots of other things to let me do this more robustly, or rather, tried and failed:

  • seems like the cli-app would be the way forward as it has facility to create/edit/delete notes at command line, so I could build the command line code into my script. Tried installing a CLI app both on my Synology NAS and a Pi 64-bit but couldn't find cli packages for either architecture

  • installed Joplin server in a Docker container on my Synology NAS, and started to explore the postgres database that holds the data to see if I could make edits directly in the database. Failed, as I don't know the logic that triggers an item to be sync'd following edit

Is it possible to do this (edit a .md file to amend the contents of a note). If so, how to do that without messing up syncing??

many thanks for any pointers

1 Like

Don't do it, the files contain metadata for syncing, you aren't supposed to edit them and will end up breaking your sync target.
You should probably looking into using the data api for that kind of task.

Thx Daeraxa- data api would be great, but that needs the web clipper service to be present, which means installing desktop, which isn’t possible on a Pi or Synology NAS.

Flathub/Flatpak has an arm64 version of Joplin Desktop that might suit you having the webclipper API to use, probably more for the Pi than the NAS.

1 Like

@james-carroll huge thanks! Now have Joplin desktop running on my Pi 4, with the webclipper installed and the data api being accessible. Just created a note from the shell.