#FORMAT_CUSTOM_DISPATCHER=custom_set_format_func #FORMAT_CUSTOM_DEFS=./vee-custom.sh #UPDATE_INDEX=custom_update_index #OUTPUT_TOP=custom_output_top #OUTPUT_BOT=custom_output_bottom format_with_null() # example implements the same as -f none { cat ${RAW} >> ${FINAL} } format_with_groff_utf8() { #sed 1liner from http://sed.sourceforge.net/sed1line.txt exe=`which groff-utf8 2> /dev/null || echo -1` if [ "-1" != ${exe} ]; then groff-utf8 -man -Tutf8 ${RAW} >> bla.raw sed '/^$/N;/\n$/D' bla.raw >> ${FINAL} rm bla.raw else echo "Warning: groff-utf8 not found, falling back to format_with_groff" format_with_groff fi } custom_set_format_func() { case "$1" in null) FORMAT_FUNC=format_with_null echo using $FORMAT_FUNC ;; groff-utf8)FORMAT_FUNC=format_with_groff_utf8 echo using $FORMAT_FUNC ;; *) echo "bad format type" die_cleanly ;; esac } # formats post link on index page custom_update_index() { echo "${PUBLISHED}: ${TITLE}" >> ${INDEX} if [ -n "${SUMMARY}" ]; then SEC=`expr $SEC - 1` echo "${SUMMARY}" >> ${INDEX} fi } custom_output_top() { echo ${HEADERTXT} > ${FINAL} if [ -e "${TOP_TPL}" ]; then cat "${TOP_TPL}" >> ${FINAL} echo "
"   >> ${FINAL}
   else
     echo ""  >> ${FINAL}
     echo "" >> ${FINAL}
     echo "${TITLE} - ${DATE}"  >> ${FINAL}
     echo ""  >> ${FINAL}
     echo "
"   >> ${FINAL}
     echo "[index][raw][main]" >> ${FINAL}
   fi
   echo           >> ${FINAL}
}

 custom_output_bottom()
{ echo          >> ${FINAL}
  echo --       >> ${FINAL}
  echo ${FOOTERTXT} >> ${FINAL}
  if [ -e "${BOT_TPL}" ]; then
    cat "${BOT_TPL}" >> ${FINAL}
  else
    echo "
" >> ${FINAL} echo "" >> ${FINAL} echo "" >> ${FINAL} fi }