From 25b773635be8eb2919db2c23d550978921b13fa8 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Apr 01 2011 15:57:17 +0000 Subject: Update help_updateOutputFileXhtml.sh. --- diff --git a/Scripts/Functions/Help/help_updateOutputFileXhtml.sh b/Scripts/Functions/Help/help_updateOutputFileXhtml.sh index 15d6a04..3fc0c1d 100755 --- a/Scripts/Functions/Help/help_updateOutputFileXhtml.sh +++ b/Scripts/Functions/Help/help_updateOutputFileXhtml.sh @@ -26,32 +26,46 @@ function help_updateOutputFileXhtml { # Output action message. - cli_printMessage "${MANUAL_BASEFILE}-xhtml" 'AsUpdatingLine' + cli_printMessage "${MANUAL_BASEFILE}.xhtml.tar.bz2" 'AsUpdatingLine' - # Check html output directory - [[ ! -d ${MANUAL_BASEFILE}-xhtml ]] && mkdir -p ${MANUAL_BASEFILE}-xhtml + # Redefine manual base file to use just the file base name. + local MANUAL_BASEFILE=$(basename "$MANUAL_BASEFILE") - # Add html output directory into directory stack to make it the - # current working directory. Otherwise texi2html may produce - # incorrect paths to images included. - pushd ${MANUAL_BASEFILE}-xhtml > /dev/null + # Add manual base directory path into directory stack to make it + # the current working directory. This is done to reduce the path + # information packaged inside `repository.xhtml.tar.bz2' file. + pushd ${MANUAL_BASEDIR} > /dev/null - # Update html files. Use texi2html to export from texinfo file + # Prepare directory structure where xhtml files will be stored in. + [[ ! -d ${MANUAL_BASEFILE}.xhtml ]] && mkdir -p ${MANUAL_BASEFILE}.xhtml + + # Clean up directory structure where xhtml files will be stored. + # We don't want to have unused files inside it. + [[ $(ls ${MANUAL_BASEFILE}.xhtml > /dev/null) ]] && rm ${MANUAL_BASEFILE}.xhtml/*.xhtml + + # Update xhtml files. Use texi2html to export from texinfo file # format to html using CentOS Web default visual style. - texi2html --init-file=${MANUAL_BASEDIR}/repository.init \ - --output=${MANUAL_BASEDIR}/repository-xhtml \ + texi2html --init-file=${MANUAL_BASEFILE}.init \ + --output=${MANUAL_BASEFILE}.xhtml \ ${MANUAL_BASEFILE}.texi - # Apply html transformations. Html transformations rely on - # Texi2html default html output. The main goal of these html - # transformations is to build specific html structures that match - # specific css definitions. This way we extend the visual style of - # Texi2html default html output. - sed -r -i \ - -f ${HOME}/artwork/trunk/Identity/Manual/repository.sed \ - ${MANUAL_BASEFILE}-xhtml/*.xhtml + # Apply xhtml transformations. This transformation cannot be built + # inside the initialization script (repository.init). For example, + # I can't see a possible way to produce different quotation HTML + # outputs from the same texinfo quotation definition. Instead, + # once the HTML code is produced we can take que quotation HTML + # definition plus the first letters inside it and transform the + # structure to a completly different thing that can be handle + # through classed inside CSS definitions. + sed -r -i -f ${MANUAL_BASEFILE}.sed ${MANUAL_BASEFILE}.xhtml/*.xhtml + + # Compress directory structure where xhtml files are stored in. + # This compressed version is the one we put under version control. + # The directory used to build the compressed version is left + # unversion for the matter of human revision. + tar -cjf ${MANUAL_BASEFILE}.xhtml.tar.bz2 ${MANUAL_BASEFILE}.xhtml - # Remove html output directory from directory stack. + # Remove manual base directory from directory stack. popd > /dev/null }