Skip to content

Instantly share code, notes, and snippets.

@hugorodgerbrown
Last active March 26, 2023 16:57
Show Gist options
  • Save hugorodgerbrown/5317616 to your computer and use it in GitHub Desktop.
Save hugorodgerbrown/5317616 to your computer and use it in GitHub Desktop.

Revisions

  1. hugorodgerbrown revised this gist Apr 5, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion md_to_rst.sh
    Original file line number Diff line number Diff line change
    @@ -12,9 +12,9 @@
    FILES=*.md
    for f in $FILES
    do
    echo "Processing $f file..."
    # extension="${f##*.}"
    filename="${f%.*}"
    echo "Converting $f to $filename.rst"
    `pandoc $f -t rst -o $filename.rst`
    # uncomment this line to delete the source file.
    # rm $f
  2. hugorodgerbrown revised this gist Apr 5, 2013. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions md_to_rst.sh
    Original file line number Diff line number Diff line change
    @@ -13,9 +13,8 @@ FILES=*.md
    for f in $FILES
    do
    echo "Processing $f file..."
    extension="${f##*.}"
    # extension="${f##*.}"
    filename="${f%.*}"
    # take action on each file. $f store current file name
    `pandoc $f -t rst -o $filename.rst`
    # uncomment this line to delete the source file.
    # rm $f
  3. hugorodgerbrown revised this gist Apr 5, 2013. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions md_to_rst.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,13 @@
    # This script was created to convert a directory full
    # of markdown files into rst equivalents. It uses
    # pandoc to do the conversion.
    #
    # 1. Install pandoc from http://johnmacfarlane.net/pandoc/
    # 2. Copy this script into the directory containing the .md files
    # 3. Ensure that the script has execute permissions
    # 4. Run the script
    #
    # By default this will keep the original .md file

    FILES=*.md
    for f in $FILES
    @@ -10,4 +17,6 @@ do
    filename="${f%.*}"
    # take action on each file. $f store current file name
    `pandoc $f -t rst -o $filename.rst`
    # uncomment this line to delete the source file.
    # rm $f
    done
  4. hugorodgerbrown revised this gist Apr 5, 2013. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions md_to_rst.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    # 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
  5. hugorodgerbrown created this gist Apr 5, 2013.
    9 changes: 9 additions & 0 deletions md_to_rst.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    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