New Tool for Migration from OneNote - updated and improved version

I am getting a message for every note:
[WARNING] Deprecated: --atx-headers. Use --markdown-headings=atx instead.
Seems a powershell command has been deprecated and replaced by another command.
Although it is generating .md files after an hour of trying in spite of the warning message.

Sorry, I don’t have time to investigate. Try going into the code (using whichever text editor) and changing any mention of

--atx-headers

to
--markdown-headings=atx

edit: I did this in the github code, but didn’t create a new release as I have no idea if it works/fixes the problem

I’m using OneNote on Windows 10 with a XP-Pen , https://www.xp-pen.com digital
drawing tablet. it’s great for handwriting and taking notes.

Hi Mada34,

Sorry, it’s been 30 days since your post. I’ve been offline for a while so you may have found a way to convert your HTML files.

The core of the HTML to markdown conversion in most programs is Pandoc.

I’ve never thought of doing a conversion like this, so thanks for the question.

This solution is just a first quick approach that worked on a couple of test HTML files I pulled from my Synology project. Hopefully, it works for everybody else :slight_smile:

Install Pandoc from https://pandoc.org/installing.html

Then unzip the attached bash file and put it in the folder with your HTML files.

html-md.sh.zip (700 Bytes)

At the command line change to the folder with the bash file in it and type
chmod 700 html-md.sh
This makes sure the file is executable
now at the command line type
html-md.sh

NOTE this should work recursively so any subfolders of the folder it is in should also get converted. If you have many folders with HTML notes in just put the html-md.sh file one folder lower and it will convert all those folders.

The original HTML files will still be there but there will be a new .md version of each one.

Please note that Pandoc has some limitations for example it does not convert checklists they will appear just as plain text. Any HTML that uses odd Microsoft formatting or class names may not appear either. Most of the work in the Synology HTML data is cleaning the HTML and recreating HTML without things Pandoc can not understand. This is where most programs making conversions struggle as you have to fix each issue before conversion, or manually convert it to markdown and add it back in after conversion (like I have to do with checklists).

If you find there are large parts not converted you may find another program somewhere, but I’ll add the HTML to md option to my current project for version 1 (link to project board) (which could be 3 or more weeks away it’s 90% done but not documented yet, and adding in the HTML will take a couple of days.

Anybody who finds some HTML that has come from OneNote that is not converted can share it with me and I’ll look at it to see if I can look into ways of cleaning/fixing it for version 2…

Version 2 would support getting the data out of OneNote as well but that is a long ways off with other things to do in between, but if anybody wants to collaborate on writing YANOM they can take a look at git hub.

Anybody reading this far might want to look at the YANOM project wiki page for a non-geek explanation of note conversions and how closed file systems like OneNote are so horrible compared to obsidian and why the YANOM project exists.

Good luck

Kevin

Thanks for your help here Kevin. It is, however, disappointing to see how utterly disappointed you are with the various “Note-O-Matics” that you have tried, which I have to assume includes mine. I am perplexed by your frustration at people not wanting you to help improve their open-source NOMs - by definition, open-source means that you can do so without permisssion.

Yet, I don’t see any tools shared at your YANOM page, just a… screed… against NOMs. Are you in the process of developing something? If so, feel free to use any code from my OneNote script - I’m not a developer by any means and hacked around to augment the original tool (made by someone who does, indeed, seem to know what they’re doing). It seems to work well for my and various other people’s purposes, but could surely be made more efficient/robust - comments and/or code contributions are quite welcomed.

Can I ask why you’re sharing this video here? None of the 4 methods shared in the video have anything to do with the tool that this thread is for. Moreover, the 1st method is an excruciatingly slow and vastly inferior version of this tool, as are the other methods as well.

I apologize, I didn’t read the rules of this forum. Thought this thread was a compilation of ways to import from OneNote. Under “Import data” in the “Import from OneNote” section of the Obsidian Help, there is a link to this forum thread - that’s why I wrote this post.

  1. Can I leave a link to another thread, or should I delete the post entirely?

  2. When I run the ConvertOneNote2MarkDown-v2.ps1 script I just have the notepad with your script inside open for editing instead of executing. Would you please tell me, what could be the problem? Thank you!

Sorry, I didn’t mean to sound harsh. I know you were just trying to be helpful. I see no problem with leaving the link to the other thread.

To use the tool, you will need to open PowerShell, navigate to where you have the script saved, and then execute it from there. If you follow the instructions in the Github page, it should be able to guide you through the process for using this tool. If you have any problems with it, please describe the issue here or there and I will try to clarify what needs to be done.

1 Like

Here’s what I do and in what folder and what I get. Can you please tell me what the problem could be?

The instructions say the following:

  1. open a PowerShell terminal and navigate to the folder containing the script and run it.'.\ConvertOneNote2MarkDown-v2.ps1'
  • if you receive an error, try running this line to bypass security: “Set-ExecutionPolicy Bypass -Scope Process”
  • if you still have trouble, try running both Onenote and Powershell as an administrator.

Give that a try and let me know how it goes.

“Set-ExecutionPolicy Bypass -Scope Process”
gives this result:

" “Set-ExecutionPolicy” is not recognized as an internal or external command, operable program or batch file "

I tried to install chocolatey.org - failed because of the same problem.
Tried to solve this problem - still no luck.

I think something is cut or disabled in my Windows.
Also, I’m thinking of reinstalling Windows,
because there is nothing I can do about the problem.

Have you tried running the script without that line “Set-ExecutionPolicy Bypass -Scope Process”?

Also, did you include the quotation marks or no? You shouldn’t. It should just be like this.

Set-ExecutionPolicy Bypass -Scope Process

Have you tried running both Onenote and Powershell in both normal and Administrator mode?

Yes, I tried that.
I didn’t put quotation marks.

Not sure what to suggest. The internet says that that error comes from not running PowerShell in administrator/elevated mode. Hope you can figure it out.

1 Like

How much time did you require on this step?
Approximately…

I have not been able to get past it.

I don’t even know what this is… When/where do you see this screen?

Problem about image preview after batch conversion
Source code “show image.md”
![](..\p\1.png){width="2.25in" height="1.7291666666666667in"}
preview

Obsidian doesn’t show picture., How to solve it?

If it is showing up in Typora when you view the same files, then it isn’t a problem with this export tool and you’ll have to figure out what’s not working with Obsidian. I’d suggest you try changing the link format around until you get it working - perhaps something is off with the relative folder reference

It has just been brought to my attention that the script was creating broken links for images. As it turns out, Pandoc changed their code back in Oct 2020 and it seems no one has noticed this/reported it to me since then.

So, it is worth double checking your files. If there are problems, then it would be worth re-exporting/converting everything with the new script…

1 Like