Export Directory Structure

Hey there, new forum poster here.

I’d like to be able to export my notebooks as a directory with the same directory structure as the notebooks themselves (e.g. notebooks and sub-notebooks are directories, notes are files within those directories). Is this already possible, and I just missed how to do it? (I’m using Joplin 1.0.193 win32). If not, I’d like to make this a feature request.

I don’t think this would be too much work given the functionality that already exists. I’m a professional programmer, but have never contributed to an open source project before - but if this isn’t too much work I’d be happy to give this feature a shot if you’d be willing to review the pull request. I’d just need a pointer to the relevant parts of the code base.

Welcome to the forums. I swear this request keeps popping up on and off again here every so often, but I’m not finding the discussions I’m alluding to, so i could be wrong. If I remember correctly, though, the core reason this hasn’t been implemented is due to how Joplin creates and stores its notebooks. They are stored in a non-standard format and each directory is a part of the note files and not actually a real directory, if that makes sense. Of course, exporting as RAW directory might be the closest thing you’re looking for right now, but i could still be wrong there.

As a non-dev, take this with some salt. Ha

File > Export > MD - Markdown will export the structure with notebooks as folders containing the notes as markdown files. The titles of the markdown files will be the titles of the notes.

File > Export > HTML - HTML Directory will export the structure with notebooks as folders containing the notes as HTML files. The titles of the HTML files will be the titles of the notes.

Any resources (attachments) will be in a separate folder. These use the Joplin naming convention (i.e. a long unique string) so that links will work.

Is this useful for you?

File > Export > MD - Markdown is the solution I wanted, thank you.

I had used that before to export single notes. But for exporting notebooks, all the other export options say Export … Directory (e.g. Export HTML Directory), so when the Markdown export option didn’t say directory, I assumed that it was not in a directory structure. Maybe the menu name should be made clearer?

Either way, thanks!

1 Like

@dpoulton, you amaze me with how much you know about the app. Thanks. <3

@bedwardly-down

Don’t give me credit I don’t deserve! I had no idea when this question was asked. I just tried the MD & HTML export options to see what happened and if either resulted in what the OP was after.

In fact I was quite surprised. The HTML export also exports some of the plugin code into a sub-folder so you can do things like view Mermaid charts in your exported HTML notes. I wasn’t expecting that…

2 Likes

@dpoulton take it. Haha

In all honesty, I’m not on my laptop most of day, so I’m guessing just as much. Ha

2 Likes

Thanks. This works for me to preserve notebook structure.
However, all tags are gone if I wipe the database and import backed up md files.

Does anyone know how to keep both notebook structure and tags?

Thanks,

@lucas welcome to the forum

File > Export > JEX - Joplin Export File

This backs up everything (except templates and custom css files) into a single archive file and is the best export / backup if you want to delete the Joplin database and re-import.

Thanks for getting back to me. I actually tried every export format and import.
JEX is great single file backup/restore, including tags. But when I import it into database, notebook structures are gone. I can only see one huge notebook with all my notes.

The way I do export is Ctrl+A in All notes to select all notes then right click export.

So currently I still don’t have a way to preserve both tags and structure.
Did I miss something?

Yes. Don't Ctrl+A in All notes. Use File > Export > JEX - Joplin Export File and it will export everything (except templates and custom css files) including the notebook names and tags.