Skip to content

Instantly share code, notes, and snippets.

@slhck
Created November 12, 2020 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slhck/3d90f4b450c88744889f1656f165e350 to your computer and use it in GitHub Desktop.
Save slhck/3d90f4b450c88744889f1656f165e350 to your computer and use it in GitHub Desktop.
Convert a Word document to a Markdown-formatted JSON-parsable string
#!/usr/bin/env bash
#
# Convert a Word document to a Markdown-formatted JSON-parsable string
pandoc "$1" -t gfm-raw_html --wrap=preserve -o - | python -c 'import json; import sys; print(json.dumps(sys.stdin.read()))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment