mkdocs (1306B)
1 #!/bin/sh 2 3 convert() 4 { 5 SRC=$1 6 HTML=`echo ${SRC} | ${SED} 's/\.in$//p'` 7 DOC=`echo ${HTML} | ${SED} 's/\.html$//p' | ${TR} '[a-z]' '[A-Z]'` 8 echo "converting ${SRC} to ${HTML_TOP_DIR}/${_JA_DIR}/${HTML} ... \c" 9 ${NKF} -e ${SRC} | ${SED} -e 's/¡£/¡¥/gp' -e 's/¡¢/¡¤/gp' | ${NKF} -j | ${W3MDOC} > ${HTML_TOP_DIR}/${_JA_DIR}/${HTML} 10 echo "done.\nconverting ${HTML} to ${DOC_TOP_DIR}/${_JA_DIR}/${DOC} ... \c" 11 ${W3M} -dump -e ${HTML_TOP_DIR}/${_JA_DIR}/${HTML} > ${DOC_TOP_DIR}/${_JA_DIR}/${DOC} 12 echo "done." 13 } 14 15 W3MDOC="./w3mdoc.pl" 16 W3M="w3m" 17 if [ -x ${HOME}/bin/pre_w3m ]; then 18 W3M=${HOME}/bin/pre_w3m 19 fi 20 21 NKF="/usr/local/bin/nkf" 22 SED="/usr/bin/sed" 23 TR="/usr/bin/tr" 24 25 HTML_TOP_DIR="html" 26 DOC_TOP_DIR="doc" 27 _JA_DIR="ja" 28 #HTML_DIR="html" 29 #DOC_DIR="doc" 30 31 if [ ! -d ${HTML_TOP_DIR} ]; then 32 mkdir ${HTML_TOP_DIR} 33 if [ ! -d ${HTML_TOP_DIR}/${_JA_DIR} ]; then 34 mkdir ${HTML_TOP_DIR}/${_JA_DIR} 35 fi 36 fi 37 if [ ! -d ${DOC_TOP_DIR} ]; then 38 mkdir ${DOC_TOP_DIR} 39 if [ ! -d ${DOC_TOP_DIR}/${_JA_DIR} ]; then 40 mkdir ${DOC_TOP_DIR}/${_JA_DIR} 41 fi 42 fi 43 44 if [ $# -eq 0 ]; then 45 for _IN in *.in 46 do 47 convert ${_IN} 48 done 49 else 50 for _IN in $* 51 do 52 case ${_IN} in 53 *.in) convert ${_IN};; 54 *) ;; 55 esac 56 done 57 fi