Commit 845a934c9c

845a934c9c06c85cf2ab5f26371b738feacb9b65

parent: c0b41a4196

Unsigned

cmc <hello@cleberg.net> · 2024-04-09 23:18 UTC

add images to onenote post

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=):
224. Name and save the file in an easy to remember location. I recommend your 224. 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
25See 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
27Start by downloading Pandoc from their [[https://github.com/jgm/pandoc/releases][GitHub releases]] page. I cannot install 38Start 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
61following loop to convert all Word documents to Markdown. 72following loop to convert all Word documents to Markdown.
62 73
63#+begin_src cli 74#+begin_src cli
64for %f in (*.docx) do (pandoc.exe --extract-media=. --wrap=preserve "%f" "%f.md") 75for %f in (*.docx) do (pandoc.exe --extract-media=. --wrap=preserve "%f" -o "%f.md")
65#+end_src 76#+end_src
66 77
67This loop will perform the following actions: 78This loop will perform the following actions:
@@ -78,3 +89,14 @@ This loop will perform the following actions:
786. Within the pandoc command, the final step is to specify the output path with 896. 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
96If you want to export to another format, simply specify the =-f=/=--from= and =-t=/=--to= options.
97
98For 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
101pandoc.exe -f docx -t org file.docx
102#+end_src