We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
First, install pandoc.
pandoc
brew install pandoc
then, you can use the following script.
#!/usr/bin/env bash usage() { >&2 echo "Usage: `basename $0` [docx-file] [guide-name] [output-dir]" } [[ "$#" -ne 3 ]] && usage && exit 1 DOCX_FILE=$1; shift; GUIDE_NAME=$1; shift; OUTPUT_DIR=$1; shift; DIR="$CWD" cd "$OUTPUT_DIR" pandoc -s "$DOCX_FILE" \ -f docx-empty_paragraphs \ -t markdown_strict-smart+pipe_tables-all_symbols_escapable \ -o "$GUIDE_NAME.md" \ --extract-media . \ --atx-headers \ --toc \ --wrap=none \ --shift-heading-level-by 1 \ --tab-stop 2 cd "$DIR"
If saved as convert-docx and with a document downloaded from Google Docs as SupplementaryTutorial.docx, here's an example of how to call it:
convert-docx
SupplementaryTutorial.docx
convert-docx SupplementaryTutorial.docx index guides/supplementary-tutorial
Table of Contents