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=):
22224. Name and save the file in an easy to remember location. I recommend your
2323 Downloads or Desktop folder.
2424
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
2536* Download Pandoc
2637
2738Start 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
6172following loop to convert all Word documents to Markdown.
6273
6374#+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")
6576#+end_src
6677
6778This loop will perform the following actions:
@@ -78,3 +89,14 @@ This loop will perform the following actions:
78896. Within the pandoc command, the final step is to specify the output path with
7990 =-o=. This option adds the =.md= file extension to recognize the output files
8091 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