diff --git a/Scripts/Functions/Help/Texinfo/texinfo.sh b/Scripts/Functions/Help/Texinfo/texinfo.sh index 104dd80..1855624 100755 --- a/Scripts/Functions/Help/Texinfo/texinfo.sh +++ b/Scripts/Functions/Help/Texinfo/texinfo.sh @@ -38,12 +38,30 @@ function texinfo { # Define file extension used by source files inside manuals. MANUAL_EXTENSION="${MANUAL_BACKEND}" + # Define absolute path to template directory. This is the place + # where we store locale directories (e.g., en_US, es_ES, etc.) + # used to build manuals in texinfo format. + MANUAL_TEMPLATE=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/$(cli_getRepoName \ + ${MANUAL_BACKEND} -d)/Templates + + # Define absolute path to language-specific template directory. + # This is the place where we store locale-specific files used to + # build manuals in texinfo format. + MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/${MANUAL_L10N} + + # Verify absolute path to language-speicific template directory. + # If it doesn't exist, use English language as default location to + # retrive template files. + if [[ ! -d $MANUAL_TEMPLATE_L10N ]];then + MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/en_US + fi + # Initialize document structure for new manuals. texinfo_createStructure # Define documentation entry default values. To build the - # documentation entry, we combine the manual's name, the chapter's - # name and the section name retrived from the command-line. + # documentation entry, we combine the manual's name, part, chapter + # and section information retrived from the command-line. if [[ $MANUAL_CHAPTER_NAME == '' ]];then # When chapter option is not provided, discard the section @@ -111,18 +129,18 @@ function texinfo { # The two final actions of help functionality are precisely to # update manual output files and commit all changes from # working copy to central repository. In this situation, when - # the `--update' action name is provided to `centos-art.sh', + # the `--update-output' option is provided to `centos-art.sh', # don't duplicate the rendition of manual output files (e.g., - # one as action name and another as help's normal execution + # one for the option and other for help's normal execution # flow) nor commit any change form working copy to central - # repository (e.g., output files are not under version + # repository (e.g., output files aren't under version # control). texinfo_${ACTIONNAM} else - # Execute action names that follow help's execution flow as it - # is, without any modification. + # Execute action names as part of normal help's execution + # flow, without any extra modification. texinfo_${ACTIONNAM} # Rebuild output files to propagate recent changes, if any. diff --git a/Scripts/Functions/Help/help.sh b/Scripts/Functions/Help/help.sh index ea84efd..31d43b2 100755 --- a/Scripts/Functions/Help/help.sh +++ b/Scripts/Functions/Help/help.sh @@ -104,11 +104,10 @@ function help { # Define absolute path to changed directories inside the # manual. For example, when a section entry is edited, copied # or renamed inside the same manual there is only one - # aboslute path to changed directory to look for changes, the - # one holding the section entry. However, when a manual entry - # is renamed, there are two different locations to look for - # changes, the source manual removed and the target manual - # added. + # aboslute path to look for changes, the one holding the + # section entry. However, when an entire manual is renamed, + # there might be two different locations to look changes for, + # the source location deleted and the target location added. MANUAL_CHANGED_DIRS="${MANUAL_BASEDIR_L10N}" # Define absolute path to base file. This is the main file @@ -116,13 +115,13 @@ function help { # files in different formats (.info, .pdf, .xml, etc.). MANUAL_BASEFILE="${MANUAL_BASEDIR_L10N}/${MANUAL_NAME}" - # Define part name. + # Define manual's part name. MANUAL_PART_NAME=${MANUAL_PART[${MANUAL_DOCENTRY_ID}]} - # Define part directory. + # Define absolute path to manual's part directory. MANUAL_PART_DIR="${MANUAL_BASEDIR_L10N}/${MANUAL_PART_NAME}" - # Define chapter name. + # Define manual's chapter name. MANUAL_CHAPTER_NAME=${MANUAL_CHAP[${MANUAL_DOCENTRY_ID}]} # Define absolute path to chapter's directory. This is the @@ -152,11 +151,11 @@ function help { MANUAL_BACKEND=$(cli_getConfigValue \ "${MANUAL_CONFIG_FILE}" "main" "manual_backend") - # Verify documentation backend. This is required because - # in order to prevent malformed values from being used. Be - # sure only supported documentation backends could be - # provided as value to `manual_backend' option in - # configuration files. + # Verify documentation backend. This is required in order + # to prevent malformed values from being used. Be sure + # only supported documentation backends can be provided as + # value to `manual_backend' option inside configuration + # files. if [[ ! $MANUAL_BACKEND =~ '^(texinfo)$' ]];then cli_printMessage "`gettext "The documentation backend provided isn't supported."`" --as-error-line fi @@ -172,24 +171,6 @@ function help { fi - # Define absolute path to template directory. This is the - # place where we store locale directories (e.g., en_US, es_ES, - # etc.) used to build manuals in texinfo format. - MANUAL_TEMPLATE=${CLI_FUNCDIR}/${CLI_FUNCDIRNAM}/$(cli_getRepoName \ - ${MANUAL_BACKEND} -d)/Templates - - # Define absolute path to language-specific template - # directory. This is the place where we store locale-specific - # files used to build manuals in texinfo format. - MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/${MANUAL_L10N} - - # Verify absolute path to language-speicific template - # directory. If it doesn't exist, use English language as - # default location to retrive template files. - if [[ ! -d $MANUAL_TEMPLATE_L10N ]];then - MANUAL_TEMPLATE_L10N=${MANUAL_TEMPLATE}/en_US - fi - # Notice that, because we are processing non-option arguments # one by one, there is no need to sycronize changes or # initialize functionalities to the same manual time after diff --git a/Scripts/Functions/Help/help_getEntries.sh b/Scripts/Functions/Help/help_getEntries.sh index aee3f3a..a1c0ec8 100755 --- a/Scripts/Functions/Help/help_getEntries.sh +++ b/Scripts/Functions/Help/help_getEntries.sh @@ -26,7 +26,9 @@ function help_getEntries { - local DOCENTRY='' + # Initialize manual's documentation entry as an empty value local + # to this function. + local MANUAL_DOCENTRY='' # Redefine positional parameters using ARGUMENTS. At this point, # option arguments have been removed from ARGUMENTS variable and @@ -35,7 +37,7 @@ function help_getEntries { if [[ $@ == '' ]];then - # Define default documentation entry. This happen when + # Define default documentation entry. This happens when # non-option arguments aren't provided to centos-art.sh # script. Default documentation entry defined here points to # manual's main definition file, so only the manual's self @@ -56,9 +58,9 @@ function help_getEntries { # here. Empty spaces are not permitted. To separate words, use # the minus sign (e.g., hello-world) or cammel case (e.g., # HelloWorld). - for DOCENTRY in $@;do + for MANUAL_DOCENTRY in $@;do - if [[ $DOCENTRY =~ '^([A-Za-z0-9-]+)(:[A-Za-z0-9-]*){0,3}$' ]];then + if [[ ${MANUAL_DOCENTRY} =~ '^([A-Za-z0-9-]+)(:[A-Za-z0-9-]*){0,3}$' ]];then # When `MANUAL:PART:CHAPTER:SECTION' is used as format # to documentation entry, you can specify the manual, @@ -67,26 +69,26 @@ function help_getEntries { # Manual self name. MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "$DOCENTRY" | gawk 'BEGIN{ FS=":" } { print $1 }') -f \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $1 }') -f \ | tr '[:upper:]' '[:lower:]') # Manual self directory name. MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "$DOCENTRY" | gawk 'BEGIN{ FS=":" } { print $1 }') -d ) + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $1 }') -d ) # Manual part name. MANUAL_PART[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "$DOCENTRY" | gawk 'BEGIN{ FS=":" } { print $2 }') -d ) + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $2 }') -d ) # Manual chapter name. MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "$DOCENTRY" | gawk 'BEGIN{ FS=":" } { print $3 }') -d ) + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $3 }') -d ) # Manual section name. MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "$DOCENTRY" | gawk 'BEGIN{ FS=":" } { print $4 }') -f ) + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN{ FS=":" } { print $4 }') -f ) - elif [[ $DOCENTRY =~ '^(trunk|branches|tags)' ]];then + elif [[ ${MANUAL_DOCENTRY} =~ '^(trunk|branches|tags)' ]];then # When `path/to/dir' is used as format to # documentation entry, you cannot specify the manual @@ -95,19 +97,19 @@ function help_getEntries { # here. Use this format to document directories inside # your working copy. - # Manual self name. + # Manual's self name. MANUAL_SLFN[${MANUAL_DOCENTRY_COUNT}]='tcar-fs' - # Manual self directory name. + # Manual's self directory name. MANUAL_DIRN[${MANUAL_DOCENTRY_COUNT}]='Tcar-fs' - # Manual chapter name. + # Manual's chapter name. MANUAL_CHAP[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "$DOCENTRY" | gawk 'BEGIN { FS="/" }; { if ( NF >= 1 ) print $1 }' ) -d ) + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 1 ) print $1 }' ) -d ) - # Manual section name. + # Manual's section name. MANUAL_SECT[${MANUAL_DOCENTRY_COUNT}]=$(cli_getRepoName \ - $(echo "$DOCENTRY" | gawk 'BEGIN { FS="/" }; { if ( NF >= 2 ) print $0 }' \ + $(echo "${MANUAL_DOCENTRY}" | gawk 'BEGIN { FS="/" }; { if ( NF >= 2 ) print $0 }' \ | cut -d/ -f2- | tr '/' '-') -f ) else