Skip to content

Instantly share code, notes, and snippets.

@dleicht
dleicht / docx2html.sh
Created September 24, 2020 21:37
Pandoc docx2html batch script with media extraction
# pandoc docx2html script v0.1
# ----------------------------
# This will use pandoc to convert all docx (including media) in the current folder to html.
# Pandoc will put any media in a "media" subfolder, because it's the docx file's design.
# Unfortunately, iterating over the files, pandoc will overwrite media files without any warning.
# Thus it is necessary to put them into separate folders. That's where the counter comes into play.
FILES=*.docx
COUNTER=1
for f in $FILES
do