Last active
January 6, 2020 16:57
-
-
Save dropletmedia/37c8573f65ce936f049c8acfcb16e3d3 to your computer and use it in GitHub Desktop.
Markdown to docx and odt
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 md to docx AND odt | |
| # requirements: pandoc | |
| # | |
| if [ -z "$1" ]; then | |
| echo "Usage:" | |
| echo "" | |
| echo " md-to-docx.sh [filename-no-extension]" | |
| exit 13 | |
| fi | |
| if [ ! -f "$1.md" ]; then | |
| echo "FATAL missing file '$1.md'" | |
| exit 11 | |
| fi | |
| mkdir -p "$1" | |
| cd "$1" | |
| pandoc -s -o $1.docx ../$1.md | |
| pandoc -s -o $1.odt ../$1.md |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mark this file as executable, and add it's folder to PATH to enjoy the full benefit