Export your OneNote note collection to Obsidian, Logseq, Org Mode or any other plain text note-taking app!
Thinking of moving your OneNote collection to another note-taking app such as Obsidian, Logseq, Org Mode and more? Your in the right place!
OneNote Exporter (in short, one
) is a PowerShell program which is capable of exporting all your OneNote notes to any Pandoc-supported plain text markup format using the OneNote Object Model and Pandoc. That is to say: markdown, org-mode and more!
Notable alternatives
one
exports OneNote pages to Word using the OneNote Object Model, and then uses Pandoc to convert them to your markup format of choice. Then, one
uses Markup Packs to customize the result. Markup Packs are functions specific to each markup format, which contain search and replace queries executed at runtime against the text output by Pandoc to tailor it to your desires. If search and replace doesn't cut it, you can add a postprocessing
scriptblock to increase your freedom. Markup Packs give you fine-grained control over of all elements of your notes, including
one
currently ships Markup Packs for Emacs Org Mode (OrgPack1
) and markdown (MarkDownPack1
).
one
will export all your local OneNote notebooks, meaning that to export a notebook of yours, you will need to download it to OneNote >= 2016* with the "Add Notebook" option.
As long as Pandoc supports your desired markup format, all one
needs to shine is a Markup Pack to tailor the output to your tastes. The section on Markup Packs contains a step by step guide to write and use your own Markup Packs.
You can see the actual test results in the test
directory (as well as the Word file to which the test note was exported). I have attempted to identify all unsupported syntax, which you can see as you would in OneNote at the bottom of the test Word file, and the respective export (failure) in the Org Mode and markdown conversions.
As you can see in the image above, the Markup Packs shipping for Org Mode and markdown (OrgPack1
and MarkdownPack1
respectively) will give your notes:
Some notes:
If you want markdown output compatible with VSCode and GitHub, specify markdown_github
in the line 66 of your config.ps1
$conversion = 'markdown_github-simple_tables-multiline_tables-grid_tables+pipe_tables'
markdown
in the Pandoc call in your config.ps1) image size notation will not render properly in GitHub or other GitHub-flavoured markdown renderers such as the VSCode markdown preview window.With support is meant that one
understands which file type you are trying to export your notes to: it will use this knowledge to appropriately name files and apply default Markup Packs if markupPack
is set to ''
in line 74 of your config.ps1.
one
supports all (as of June 2022) Pandoc supported markups, as follows (from the Pandoc manual),
Emacs Org Mode
org
Markdown
markdown_strict
CommonMark
commonmark
commonmark_x
GitHub-Flavored Markdown
gfm
markdown_github
Pandoc Markdown
markdown
MultiMarkdown
markdown_mmd
PHP Markdown Extra
markdown_phpextra
You can specify your Markup Pack of choice line 74 of your config.ps1. markupPack
may have three values, as follows:
'<markup pack>'
You Markup Pack of choice.
''
The default Markup Pack for your export format. one
determines which Markup Pack to use by first identifying the extension of the file format you have specified in your Pandoc call (currently .org
and .md
), and then choosing the default Markup Pack for that format.
'none'
No post-processing will be applied.
Markup Packs are markup-format-specific functions containing search and replace queries executed at runtime against a string containing the entire markup content. If search and replace doesn't cut it, you can add a postprocessing
scriptblock to increase your freedom (check the scriptblock to "Remove over-indentation of list items" in Markdown MarkdownPack1).
A Markup Pack template is available in the templates
directory. It's an annotated version of the Emacs Org Mode OrgPack1 Markup Pack. If you're interested in exporting to a Markdown format, check the Markdown MarkdownPack1 Markup Pack for inspiration.
To add a Markup Pack, follow these steps:
Org.psm1
or Markdown.psm1
in src/Conversion/Markup-Packs
).markupPack
in your config.ps1 to the name of your markup pack. That is, the name of the function you have written.Windows >= 10
Windows Powershell 5.x and above, or Powershell Core 6.x up to 7.0
Microsoft OneNote
>= 2016 (Desktop version, NOT the Windows Store version)
Microsoft Word
>= 2016 (Desktop version, NOT the Windows Store version)
config_example.ps1
to config.ps1
and configure the available options to your liking..\one.ps1
All of the following are configured from config.ps1
(assuming you have renamed config example.ps1
to that).
Page\Subpage.md
) or appending prefixes (e.g. Page_Subpage.md
)32
and 255
as the maximum length of markdown file names, and their folder names (only when using subfolders for subpages (e.g. Page\Subpage.md
)). A lower value can help avoid hitting file and folder name limits of 255
bytes on file systems. A higher value preserves a longer page title. If using page prefixes (e.g. Page_Subpage.md
), it is recommended to use a value of 100
or greater./media
folder for each notebook, or in a separate /media
folder in each folder of the hierarchy
.md
files, generating relative references to the media files within the markdown document.docx
(90% faster) and creating new ones - useful if just want to test differences in the various processing options without generating new .docx
each time.docx
files using page ID and last modified epoch date e.g. {somelongid}-1234567890.docx
or hierarchy e.g. <sectiongroup>-<section>-<page>.docx
config example.ps1
. The following formats are accepted, among others:
>
after bullet lists, created by Pandoc\
escape symbol that are created when converting with Pandoc.pdf
export alongside the .md
file. .md
does not preserve InkDrawing
(i.e. overlayed drawings, highlights, pen marks) absolute positions within a page, but a .pdf
export is a complete page snapshot that preserves InkDrawing
absolute positions within a page.$notesdestpath
in config.ps1
to a notes
directory in the project while adjusting the settings to your preference.one
started from the base of ConvertOneNote2markdown, by