| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function docbook_convertToText { |
| |
| |
| |
| |
| if [[ ! -f ${FILE}.xhtml ]];then |
| return |
| fi |
| |
| local COMMAND='' |
| local OPTIONS='' |
| |
| |
| |
| |
| |
| if [[ -x '/usr/bin/lynx' ]];then |
| COMMAND='/usr/bin/lynx' |
| OPTIONS='-force_html -nolist -width 70 -dump' |
| elif [[ -x '/usr/bin/elinks' ]];then |
| COMMAND='/usr/bin/elinks' |
| OPTIONS='-force_html -no-numbering -no-references -width 70 -dump' |
| elif [[ -x '/usr/bin/w3m' ]];then |
| COMMAND='/usr/bin/w3m' |
| OPTIONS='-dump' |
| fi |
| |
| if [[ $COMMAND != '' ]];then |
| |
| |
| if [[ -f ${FILE}.txt ]];then |
| cli_printMessage "${FILE}.txt" --as-updating-line |
| else |
| cli_printMessage "${FILE}.txt" --as-creating-line |
| fi |
| |
| |
| ${COMMAND} ${OPTIONS} ${FILE}.xhtml > ${FILE}.txt |
| |
| else |
| cli_printMessage "`gettext "No way to convert from XHTML to plain-text found."`" --as-error-line |
| fi |
| |
| } |