Skip to content

Instantly share code, notes, and snippets.

@z3by
Created December 10, 2019 19:32
Show Gist options
  • Save z3by/345cec303e8dc8a041c945927c57d747 to your computer and use it in GitHub Desktop.
Save z3by/345cec303e8dc8a041c945927c57d747 to your computer and use it in GitHub Desktop.
Linux And MacOS script for converting docx files to markdown.
#!/bin/bash
for i in *.docx;
do
filename=$(echo "$i" | cut -f 1 -d '.')
pandoc -f docx -t markdown_mmd "$filename".docx --output="$filename".md --atx-headers --wrap=none --toc --extract-media="."
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment