Skip to content

Instantly share code, notes, and snippets.

@dropletmedia
Last active January 6, 2020 16:57
Show Gist options
  • Select an option

  • Save dropletmedia/37c8573f65ce936f049c8acfcb16e3d3 to your computer and use it in GitHub Desktop.

Select an option

Save dropletmedia/37c8573f65ce936f049c8acfcb16e3d3 to your computer and use it in GitHub Desktop.
Markdown to docx and odt
#!/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
@dropletmedia
Copy link
Author

Mark this file as executable, and add it's folder to PATH to enjoy the full benefit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment