joplin-plugin-backup icon indicating copy to clipboard operation
joplin-plugin-backup copied to clipboard

Add option to select export format

Open hayzey opened this issue 2 years ago • 3 comments

Joplin Desktop allows you to export to multiple formats through the GUI...

~ See screenshot of Joplin export options... ~

image

This plugin seems to be hardcoded to only export using the "jex" option.

https://github.com/JackGruber/joplin-plugin-backup/blob/2c035a3d426785deeaacc1948a2469d0824e0c25/src/Backup.ts#L620

It would be useful to be able to export to any of the available formats:

  • jex
  • raw
  • md
  • md_frontmatter
  • html

https://github.com/laurent22/joplin/blob/5d7178783592dd7cadf1f50f87d34521e9c9753b/packages/lib/services/interop/InteropService.ts#L96

hayzey avatar Jan 29 '22 12:01 hayzey

My use case for this is that I'd like to maintain a local git repo to keep a git history of my notes over time. The md_frontmatter export option is great for this in combination with Git LFS for images and such. Markdown seems to be a much nicer format for version control compared to JEX.

My ideal flow would be to use this plugin to automatically generate markdown backups. I would then run a cron job or something to periodically commit the latest backup to git.


I'm happy to take this task on myself if you think it makes sense @JackGruber . Let me know what you think! 😃

hayzey avatar Jan 29 '22 12:01 hayzey

I'm not sure I'm picking it up. But you are welcome to make a draft.

JackGruber avatar Feb 05 '22 08:02 JackGruber

@hayzey I have the same idea of keeping a git history of my notes, and have you found a suitable solution ? or other plugin that supports exporting markdown files?

NigelBoxing avatar Jul 03 '22 08:07 NigelBoxing

@JackGruber i'd like to use "raw" format since the diff grain is file level. i've tried to make a patch on my own, replacing "raw" with "jex" in plugins/io.github.jackgruber.backup.jpl/index.js but it would'nt work, an error says the command exportFolders cannot be excuted for "jex" and the file target. any sugguestion?

mo-han avatar Oct 17 '22 07:10 mo-han

raw and md with frontmatter will be included in the next release as these can be used as backupfromatand a fix in joplin for missing resources was implemented.

JackGruber avatar Nov 20 '22 17:11 JackGruber