Closed maphew closed 2 months ago
Additional research uncovered that Powershell core newer than v7.0 cannot load the Office win32 interop libraries :-/
on the other hand, that project has taken a much deeper dive into converting Onenote pages. However I remain to be convinced going to markdown is a good idea. (As handy as md is, it leaves a lot out.) The project is a great resource at any rate.
Running onenote-html-export under Windows Powershell instead of powershell core works somewhat. All of my pages are converted to html, but the images are broken. Attachments such as pdf are left out also, but maybe that was always out of scope for this script.
I also agree that the markdown export looses alot of formatting that can only really be captured in HTML. TBH, I don't really remember how my images were converted using this script. I don't remember there being too much of a headache, so I assume that they were converted in some way. I'm also not sure about attachments - it's possible i migrated those manually since i did not use attachments heavily in OneNote.
The fastest, easiest, and most solid means I've found is to use the Onemore Addin and it's Archive or Export commands: https://onemoreaddin.com/commands/File%20Commands.htm.
@maphew This looks like a great tool. Does it preserve the note heierarchy? Were there any changes you needed to make after exporting and then importing into Trilium? If this is a smooth migration path we should definitely document it in our TriliumNext/Docs repo
I've only imported a couple of test sections so far, but no significant problems noticed. Trilium appends .htm
to the note title, which is annoying as it doesn't do that for .html
. I haven't decided if I'll write a small script to rename the pages in the zips before import or try and patch Trilium to recognize the short form. I haven't looked yet at what happens with cross page/section/notebook links after importing.
In Onemore,
@maphew No need to worry about the .htm in the note title. You can simply fix that in Trilium. Just open search, select Action > rename note
and paste in ${note.title.replace(".htm","")}
to the rename note title to:
field and click search and execute actions
(be careful (take a backup first).
Out of the box:
I tried downloading and installing Microsoft Office 2010: Primary Interop Assemblies Redistributable but that didn't change anything. (Rebooted also).