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
196 stars 113 forks source link

Replace absolute path of images by relative path #2

Closed dirkagterhuis closed 3 years ago

dirkagterhuis commented 4 years ago

So, I've successfully converted all my Onenote notebooks to markdown, thanks for that! You saved me a tremendous amount of work.

I've moved all notes from the directory I initially put the markdown files to another directory, and noticed that images stopped working because the path referenced is absolute, e.g. 'D:/User/MyNotes/media/...'. I replaced this with the relative path of './media/...' to have them all work again.

I think this can be fixed somewhere around line 181 of the .ps1 file. I attempted a pull request, but I don't know enough of Powershell to replace the part of variable 'fullexportpathwithoutextension' so it just contains './media/.

This would have the script convert Onenote to markdown and lets you then move the notes around as you please!

SjoerdV commented 3 years ago

Hi Dirk, thanks for your continued feedback. As pandoc didn’t really work that well with relative paths I decided to keep the full target path leading throughout the script. What you do after script execution is all up to the user. Therefore I will not be making your suggested alteration here, but you are free to fork the project, of course.