Commit 845a934c9c
Unsigned
Layout: unified · split
content/blog/2024-04-06-convert-onenote-to-markdown.org +23 −1
| @@ -22,6 +22,17 @@ To start, export any pages or tabs from OneNote to the Word format (=.docx=): | |||
| 22 | 4. Name and save the file in an easy to remember location. I recommend your | 22 | 4. Name and save the file in an easy to remember location. I recommend your |
| 23 | Downloads or Desktop folder. | 23 | Downloads or Desktop folder. |
| 24 | 24 | ||
| 25 | See below for a visual walkthrough of the export process. | ||
| 26 | |||
| 27 | #+caption: OneNote Notebook | ||
| 28 | [[https://img.cleberg.net/blog/20240406-convert-onenote-to-markdown/onenote.png]] | ||
| 29 | |||
| 30 | #+caption: OneNote Section Export Options | ||
| 31 | [[https://img.cleberg.net/blog/20240406-convert-onenote-to-markdown/export.png]] | ||
| 32 | |||
| 33 | #+caption: Exported Word Document | ||
| 34 | [[https://img.cleberg.net/blog/20240406-convert-onenote-to-markdown/word.png]] | ||
| 35 | |||
| 25 | * Download Pandoc | 36 | * Download Pandoc |
| 26 | 37 | ||
| 27 | Start by downloading Pandoc from their [[https://github.com/jgm/pandoc/releases][GitHub releases]] page. I cannot install | 38 | Start by downloading Pandoc from their [[https://github.com/jgm/pandoc/releases][GitHub releases]] page. I cannot install |
| @@ -61,7 +72,7 @@ directory with the =pandoc.exe= and the Word documents, you can run the | |||
| 61 | following loop to convert all Word documents to Markdown. | 72 | following loop to convert all Word documents to Markdown. |
| 62 | 73 | ||
| 63 | #+begin_src cli | 74 | #+begin_src cli |
| 64 | for %f in (*.docx) do (pandoc.exe --extract-media=. --wrap=preserve "%f" "%f.md") | 75 | for %f in (*.docx) do (pandoc.exe --extract-media=. --wrap=preserve "%f" -o "%f.md") |
| 65 | #+end_src | 76 | #+end_src |
| 66 | 77 | ||
| 67 | This loop will perform the following actions: | 78 | This loop will perform the following actions: |
| @@ -78,3 +89,14 @@ This loop will perform the following actions: | |||
| 78 | 6. Within the pandoc command, the final step is to specify the output path with | 89 | 6. Within the pandoc command, the final step is to specify the output path with |
| 79 | =-o=. This option adds the =.md= file extension to recognize the output files | 90 | =-o=. This option adds the =.md= file extension to recognize the output files |
| 80 | as Markdown files. | 91 | as Markdown files. |
| 92 | |||
| 93 | #+caption: Pandoc Conversion | ||
| 94 | [[https://img.cleberg.net/blog/20240406-convert-onenote-to-markdown/command.png]] | ||
| 95 | |||
| 96 | If you want to export to another format, simply specify the =-f=/=--from= and =-t=/=--to= options. | ||
| 97 | |||
| 98 | For example, you can convert the Word document to org-mode. You can also convert to one format and subsequently convert to other formats as needed. | ||
| 99 | |||
| 100 | #+begin_src cli | ||
| 101 | pandoc.exe -f docx -t org file.docx | ||
| 102 | #+end_src | ||