This is an example of how to convert notes from OneNote into Markdown to use in other, less annoying Note applications. I am using PowerShell on Windows here, but other shell/scripting environments would work as well. If you want separate .md files, you'll need to export your OneNote pages separately. Exporting a section, or a selection of pages creates a single .docx file.
- Download and install Pandoc
- Export each of your note pages to a
.docx(Word) format using OneNote export from the File menu - Gather all of these
.docxfiles into a directory - Open directory in File Explorer
- Open Powershell from the File Explorer using File -> Open Windows Powersell
- Run the following command:
ForEach ($result in Get-ChildItem | select Name, BaseName) { pandoc.exe -f docx -t markdown_strict -i $result.Name -o "$($result.BaseName).md" --wrap=none --atx-headers }
markdown-strictis the type of Markdown. Other variants exist in the Pandoc documentation--wrap=noneensures that text in the new.mdfiles doesn't get wrapped to new lines after 80 characters--atx-headersmakes headers in the new.mdfiles appear as# h1,## h2and so on
OneNote was not saving to Docx correctly. The files were blank.
I had to export to Doc.
Open in Word and save as Docx.
Then convert.
Thanks for the script heardk and sc420.