

The folder you created in step 10 must be a subfolder of this one (unless you fix the path in the following command). Open a bash terminal and cd to the directory containing the. docx files with images, a folder will be created automatically for you.) We could write a clever script to do all this automatically, but it will take less time to just do it manually, unless you have a huge number of notebooks.) (Note: You can save a step by putting your desired foldername in the single quotes of the -extract-media='' argument-for. (This is why we need to do each pandoc operation seperately, because each export will create a separate media folder, and we want to keep these separate so the links in the markdown files work correctly. Drag the media folder, if it exists, into the folder you just created now. docx file, these will be exported to a new folder called media. Make a folder called journal which will store the final separated pages as individual. For this example, right now all the pages from our Journal tab in OneNote are mashed together in journal.md. (When you are doing a bunch of these, you can press the ↑ (up arrow) key to recall the previous command in the shell, then edit the filename.)Ĭreate a new folder to store the pages in the tab.

If you don't want to split this file (for example, if your tab contained only one page), skip to step 15. The next field is the input filename, and -o stands for 'output', so journal.md is the output filename. wrap=preserve tells pandoc not hard-wrap the output file with linebreaks (which is the default). docx file and put them in the default subfolder (named 'media' by default). Here's an explanation of the command: -extract-media='' tells pandoc to extract images from the. docx file, use the following pandoc command to convert it to markdown (replace journal with the name of your file): pandoc -extract-media='' -wrap=preserve '.\journal.docx' -o journal.md docx files are located.įor each exported. Set up pandoc and open a PowerShell or cmd window.Ĭd into the directory where the exported. Repeat steps 2-5 for each tab in the notebook. Press Enter again to save the exported file. In the Notebooks list, expand the notebook to see all the tabs.Ĭlick the filetype dropdown and press M to select. Turn off your network(s) to prevent OneNote from performing a lengthy OneDrive sync after each export. I did end up finding an export pipeline, but it was a pain.
