Created
August 6, 2014 06:48
-
-
Save ryosan-470/17e3e2d78c788cc58200 to your computer and use it in GitHub Desktop.
Pandocを用いてGitHub Flavored MarkdownをreSTに変換するスクリプト
This file contains hidden or 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
#!/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