Skip to content

Instantly share code, notes, and snippets.

@ryosan-470
Created August 6, 2014 06:48
Show Gist options
  • Save ryosan-470/17e3e2d78c788cc58200 to your computer and use it in GitHub Desktop.
Save ryosan-470/17e3e2d78c788cc58200 to your computer and use it in GitHub Desktop.
Pandocを用いてGitHub Flavored MarkdownをreSTに変換するスクリプト
#!/bin/bash
FILE=$1
FILENAME=${FILE%.*} # 拡張子なしのファイル名
FILEEXT=${FILE##*.} # 拡張子
FORMAT='markdown_github' # Github Markdown
if [ $# -ne 1 ]; then
echo "Argument parse error."
echo "Usage: ./build.sh FILENAME"
exit 1
fi
pandoc -f $FORMAT $FILENAME.$FILEEXT -o $FILENAME.rst
if [ $? -ne 0 ]; then
echo "Convert Failed"
exit 1
fi
echo "Convert Fishied"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment