...
 
Commits (3)
......@@ -39,7 +39,3 @@ Use this to see a PDF file without keeping it
The PDF file will be deleted when the PDF viewer is closed
## TODO
* `evince` is used to open PDF files in `mdtest`, it should test an environment
variable/configuration to allow others viewer.
......@@ -9,7 +9,7 @@ USAGE="usage: $0 mdFilePath [outDirectory]"
[[ -z ${1} ]] && echo ${USAGE} >&2 && exit 1
MD_FILE=${1}
OUT_DIR_OPTION=""
OUT_DIR_OPTION="-o $PWD"
[[ -n ${2} ]] && OUT_DIR_OPTION="-o ${2}"
gimli -f ${MD_FILE} -s ${MARKDOWN_PROJECT_PATH}/style.css -w '-t ' ${OUT_DIR_OPTION}
......
......@@ -7,16 +7,17 @@ MARKDOWN_PROJECT_PATH=$(dirname $0)
USAGE="usage: $0 mdFilePath"
[[ -z ${1} ]] && echo ${USAGE} >&2 && exit 1
MD_FILE=${1}
MD_FILE_PATH=${1}
MD_FILE_NAME=$(basename ${MD_FILE_PATH})
OUT_DIR=$(mktemp -d)
OUT_FILENAME=${MD_FILE/%.md/.pdf}
OUT_FILE_NAME=${MD_FILE_NAME/%.md/.pdf}
${MARKDOWN_PROJECT_PATH}/md2pdf.sh ${MD_FILE} ${OUT_DIR}
evince ${OUT_DIR}/${OUT_FILENAME}
${MARKDOWN_PROJECT_PATH}/md2pdf.sh ${MD_FILE_PATH} ${OUT_DIR}
evince ${OUT_DIR}/${OUT_FILE_NAME}
# Clean temp files
rm ${OUT_DIR}/${OUT_FILENAME}
rm ${OUT_DIR}/${OUT_FILE_NAME}
rmdir ${OUT_DIR}
exit 0