SjoerdV / ConvertOneNote2MarkDown

Ready to make the step to Markdown and saying farewell to your OneNote, EverNote or whatever proprietary note taking tool you are using? Nothing beats clear text, right? Read on!
GNU General Public License v3.0
212 stars 116 forks source link

Subfolders rather than appending a prefix for subpages? #9

Closed nixsee closed 4 years ago

nixsee commented 4 years ago

I very much appreciate your treatment of subpages in relation to their parents - I'm pretty sure my other two solutions of Evernote->Joplin/Notion don't do this and you end up with a mass of unsorted pages.

But, while the prefixes keep them all in order in the file explorer, I will inevitably be renaming them to their original name after organizing/linking them. So, I'm wondering if subfolders could be created, which I can then drag files out of once they have been appropriately treated?

I can see where you handle this in the code, but it's far beyond me to change it.

Thanks!

SjoerdV commented 4 years ago

I am afraid I don't understand your question entirely. You want subfolders but the script already produces subfolders (but not enough perhaps?). Could you perhaps post a screenshot of the outcome you desire. Or just some textual 'indentations' using the words notebook, section and page? Thanks

nixsee commented 4 years ago

Sorry for not being clear. When there is a subpage in OneNote (it allows 3 levels of subpages, which you seem to account for in the code), you are moving them all to the same "level" within the same section folder, and prepending the name of the "parent note" to its name.

So if you have pages that are organized like this in OneNote:

Section A:
a
    b 
        c1
        c2
        c3

The markdown output will look like this:

Folder A:
a
a_b
a_b_c1
a_b_c2
a_b_c3

But I'd like it to look like:


Folder A:
a
    Folder B:
    b
        Folder C;
        c1
        c2
        c3

Does this make any more sense? I'm ultimately just trying to maintain the hierarchy/note relation of OneNote without having file names with long prepends (which might be an actual problem, rather than just nuisance, if titles are very long or there isn't one at all and it is using body text). If its not possible/too arduous, don't worry about it. But if it is a small thing for you, it would be much appreciated!

SjoerdV commented 4 years ago

Ah yes I see, the thing is: 'What would the folder name be? Concerning your 'Folder C' for example, there are multiple pages under that heading, right". We simply don't have a reliable way of determining the name of any of those containers, so I'll have to stick to what's there right now. The script does take into account if there are duplicate names it will create an index as a postfix. And with the addition of capping all names as mentioned here I think there should not be any filenames which are too long. Hope you agree, cheers!