Last active
December 6, 2019 02:02
-
-
Save ckunte/a4047c85fefb503c1461 to your computer and use it in GitHub Desktop.
Convert all Markdown files in a folder to plain text version. (It strips all html and markdown markups in text.)
This file contains 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
#!/usr/bin/env zsh | |
# 2014 ckunte | |
# Convert Markdown files in a folder to plain text | |
# Requires pandoc and zsh. | |
# | |
# Run the following at zsh prompt: | |
# | |
# $ zsh md2txt.sh | |
# | |
for file in *.md; do pandoc -f markdown -t plain --wrap=none "$file" -o "$file.txt"; done | |
autoload zmv | |
zmv '(*).md.txt' '$1.txt' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment