Last active
June 26, 2025 15:15
-
-
Save petergi/a9c4648b641440c00604a485bff6d0b1 to your computer and use it in GitHub Desktop.
This command will convert each .docx file in the directory to a Markdown file with ATX-style headers. If you prefer Setext-style headers, you can replace atx with setext.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 - Export to Word Document: First, export your OneNote pages to a .docx (Word) format using the OneNote export feature from the File menu. | |
# 2 - Install Pandoc: Install Pandoc on your Mac (https://gist.github.com/petergi/dcfe4279bb9c586463d0c4936a0738df#file-install-pandoc-on-macos-sh). | |
# 3 - Convert to Markdown: Use the terminal to navigate to the directory where your .docx files are saved. | |
# Run the following command to convert the .docx files to Markdown: | |
for file in *.docx; do | |
pandoc -f docx -t markdown_strict -i "$file" -o "${file%.docx}.md" --wrap=none --markdown-headings=atx | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you need to install Pandoc: Another Gist