Last active
November 9, 2021 06:34
-
-
Save is-hoku/f8b57b2839e17f0c297c698ea80d4f6d to your computer and use it in GitHub Desktop.
コンピュータ工学やエンジニアリングデザインなどの授業で、マークダウンでレポートを書いて docx ファイルにするスクリプト。 (usage) md2docx [config.sh で書いた授業名] [変換する .md ファイル]
This file contains 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 | |
case $1 in | |
nktk) | |
REFERENCE=~/Documents/nktk/template.docx | |
BASE_DIR=~/Documents/nktk | |
;; | |
endz) | |
REFERENCE=~/Documents/engineering_design/template.docx | |
BASE_DIR=~/Documents/engineering_design | |
;; | |
esac |
This file contains 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 | |
CONFIG_DIR=~/bin | |
source "${CONFIG_DIR:?}/config.sh" "$1" | |
OUTPUT_FILE=`echo $2 | sed 's/\.[^\.]*$/.docx/'` | |
pandoc ${BASE_DIR}/$2 --from=markdown --to=docx --standalone --reference-doc=$REFERENCE --output=$OUTPUT_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment