-
-
Save philpicton/3e7c98d182436062192205064e67811d to your computer and use it in GitHub Desktop.
Convert docx to markdown
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
| #!/bin/bash | |
| # a script to convert docx to markdown and extract images into subfolder | |
| # requirements: pandoc | |
| # | |
| if [ -z "$1" ]; then | |
| echo "Usage:" | |
| echo "" | |
| echo " docx-to-md.sh [filename-no-extension]" | |
| exit 13 | |
| fi | |
| if [ ! -f "$1.docx" ]; then | |
| echo "FATAL missing file '$1.docx'" | |
| exit 11 | |
| fi | |
| mkdir -p "$1" | |
| cd "$1" | |
| pandoc -f docx -t markdown --extract-media="." -o "$1.md" "../$1.docx" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
docx-to-md.sh [filename no extension]