Skip to content

Instantly share code, notes, and snippets.

@jeffscrum
Forked from hugorodgerbrown/md_to_rst.sh
Created September 23, 2022 07:25
Show Gist options
  • Select an option

  • Save jeffscrum/407bd3a1cf276ae287613e643ed91dea to your computer and use it in GitHub Desktop.

Select an option

Save jeffscrum/407bd3a1cf276ae287613e643ed91dea to your computer and use it in GitHub Desktop.
Shell script for converting a batch of *.md files into *.rst using pandoc.
# This script was created to convert a directory full
# of markdown files into rst equivalents. It uses
# pandoc to do the conversion.
FILES=*.md
for f in $FILES
do
echo "Processing $f file..."
extension="${f##*.}"
filename="${f%.*}"
# take action on each file. $f store current file name
`pandoc $f -t rst -o $filename.rst`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment