Thanks to @CalebJohn I’ve got my python script (sorta) working. Joplin now imports the html with resources encoded as
base64 successfully; however, the resources (images for the moment) are given a hash id and stored in
.config/joplin-desktop/resources without their appropriate file extensions (
.png), so the markdown looks like this:
(:/8107653c2d4751638bade02215a41160) and Joplin renders it with just a little “J” icon. Clicking on the icon gives the right resource, but it’s displayed in an external image viewer.
.enex file includes in the CData section
<en-media> tags with both hash and type attributes, and in the
<note> xml I’ve got
<resource> elements that include a
<mime> element as well as
<resource-attributes><file-name> elements, and that file-name includes the
.png file extension. So, what am I missing?
Also, there are things about the sqlite interaction that I don’t understand yet. While fooling around with these test imports I notice that if I delete a note that I just imported, the resources remain in the resources directory. And if I delete those resources manually, any subsequent import of the same
.enex file does not restore the resource. Is there a way to reconcile the database entry with the contents of the resources directory?
As you can tell, I’m still fumbling around here. Any hints, guidance, or observations would be welcome.