From 09315d4a80b6745178f1bc893c51bba269e2413a Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jun 12 2011 02:09:01 +0000 Subject: Remove `docbook' and `linuxdoc' backends from `help' functionality. Only `texinfo' backend remains. - The `texinfo' backend seems to be fairly complete by now and is the one used as reference inside `centos-art.sh' script when errors occurs. - The initial intention of `help' functionality was to automate the process of creating/maintainig documentation related to each repository directory structure in different languages. The `help' functionality creates one documentation structure for each language you want to support documentation. Inside each language-specific documentation structure there is one documentation entry for each directory inside the repository. The `help' functionality is responsable of creating, reading, editing, copying, deleting, renaming those documentation entries in each specific documenation structure. - I'll use the `help' functionality only to document the manual: The CentOS Artwork Repository References. All other documentation manuals will be organized personally. Do not impose fixed structures on new documents. --- diff --git a/Scripts/Functions/Help/Backends/Docbook/Templates/repository-sect1.docbook b/Scripts/Functions/Help/Backends/Docbook/Templates/repository-sect1.docbook deleted file mode 100644 index 4119e3e..0000000 --- a/Scripts/Functions/Help/Backends/Docbook/Templates/repository-sect1.docbook +++ /dev/null @@ -1,4 +0,0 @@ - - =TITLE= - ... - diff --git a/Scripts/Functions/Help/Backends/Docbook/docbook_editEntry.sh b/Scripts/Functions/Help/Backends/Docbook/docbook_editEntry.sh deleted file mode 100755 index c8ff25c..0000000 --- a/Scripts/Functions/Help/Backends/Docbook/docbook_editEntry.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -# -# docbook_editEntry.sh -- This function standardizes the way -# documentation entries are edited inside docbook repository -# documentation manual. -# -# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_editEntry { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Verify chapter definition inside manual. - if [[ ! -d $MANUAL_CHAPTER_DIR ]];then - - # Print confirmation question. - cli_printMessage "`gettext "The following documentation chapter will be created:"`" - cli_printMessage "$MANUAL_CHAPTER_DIR" --as-response-line - cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line - - # Update manual chapter related files. - #docbook_updateChaptersFiles - - # Update manual chapter related menu. - #docbook_updateChaptersMenu - - # Update manual chapter related nodes (based on chapter - # related menu). - #docbook_updateChaptersNodes - - fi - - # Verify section definition inside chapters. - if [[ ! -f $MANUAL_ENTRY ]];then - - # Print confirmation question. - cli_printMessage "`gettext "The following documentation section will be created:"`" - cli_printMessage "$MANUAL_ENTRY" --as-response-line - cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line - - # Update chapter section related menu. - #docbook_updateMenu - - # Update chapter section related nodes (based on chapter - # section related menu). - #docbook_updateNodes - - # Update old missing cross references. If for some reason a - # documentation entry is removed by mistake, and that mistake - # is fixing by adding the removed documentation entry back - # into the repository, rebuild the missing cross reference - # message to use the correct link to the documentation - # section. - #docbook_restoreCrossReferences - - else - - # Print action message. - cli_printMessage "$MANUAL_ENTRY" --as-updating-line - - fi - - # Use default text editor to edit the documentation entry. - eval $EDITOR $MANUAL_ENTRY - - # Rebuild output files to propagate recent changes. - docbook_updateOutputFiles - -} diff --git a/Scripts/Functions/Help/Backends/Docbook/docbook_getEntities.sh b/Scripts/Functions/Help/Backends/Docbook/docbook_getEntities.sh deleted file mode 100755 index 526c6ae..0000000 --- a/Scripts/Functions/Help/Backends/Docbook/docbook_getEntities.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash -# -# docbook_getEntities.sh -- This function explores docbook's directory -# structure, takes file paths and transforms them into their related -# entity parts. -# -# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_getEntities { - - # Define short options. - local ARGSS='' - - # Define long options. - local ARGSL='name,path,pattern:' - - # Initialize arguments with an empty value and set it as local - # variable to this function scope. - local ARGUMENTS='' - - # Initialize entity related variable as local to avoid conflicts - # outside this function scope. - local ENTITY_NAMES='' - local ENTITY_PATHS='' - - # Initialize name flag (`--name'). This flag specifies whether to - # retrive the name part of the entity or not. - local FLAG_NAME='false' - - # Initialize path flag (`--path'). This flag specifies whether to - # retrive the name part of the entity or not. - local FLAG_PATH='false' - - # Initialize pattern flag (`--pattern'). This flag specifies the - # regular expression pattern applied to docbook list of files. By - # default no reduction is applied to docbook list of files (i.e., - # all docbook files are printed out). - local FLAG_PATTERN='' - - # Redefine ARGUMENTS variable using current positional parameters. - cli_parseArgumentsReDef "$@" - - # Redefine ARGUMENTS variable using getopt output. - cli_parseArguments - - # Redefine positional parameters using ARGUMENTS variable. - eval set -- "$ARGUMENTS" - - # Look for options passed through positional parameters. - while true; do - - case "$1" in - - --name ) - FLAG_NAME='true' - shift 1 - ;; - - --path ) - FLAG_PATH='true' - shift 1 - ;; - - --pattern ) - FLAG_PATTERN="$2" - shift 2 - ;; - - -- ) - shift 1 - break - - esac - - done - - # Build list of all docbook files inside docbook directory - # structure. - local FILE='' - local FILES=$(cli_getFilesList ${@} --pattern="${FLAG_PATTERN}.*\.${FLAG_BACKEND}" --type='f') - - # Loop through all docbook files under docbook directory structure - # to retrive both entity names and entity relative paths. - for FILE in $FILES;do - - # Build entity's name. - ENTITY_NAME=$(echo $FILE | cut -d/ -f 9- \ - | sed -r 's!/!-!'g | tr '[:upper:]' '[:lower:]' \ - | sed "s/\.${FLAG_BACKEND}$//") - - # Build entity's relative path. - ENTITY_PATH=$(echo $FILE | sed -r "s!${MANUAL_BASEDIR}/Entities/!!") - - # Output entity information as specified by options. When no - # option is specified the entity full definition is output. - if [[ $FLAG_NAME == 'true' ]];then - echo "&${ENTITY_NAME};" - elif [[ $FLAG_PATH == 'true' ]];then - echo ${ENTITY_PATH} - else - echo ${ENTITY_NAME} ${ENTITY_PATH} \ - | gawk '{ printf "\t\n", $1, $2}' - fi - - done - -} diff --git a/Scripts/Functions/Help/Backends/Docbook/docbook_getEntry.sh b/Scripts/Functions/Help/Backends/Docbook/docbook_getEntry.sh deleted file mode 100755 index 4d9647c..0000000 --- a/Scripts/Functions/Help/Backends/Docbook/docbook_getEntry.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# -# docbook_getEntry.sh -- This function builds a documentation entry -# based on a location specified. Location specification can be both -# action value (ACTIONVAL) variable or a value passed as first -# positional parameter. -# -# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_getEntry { - - # Define variables as local to avoid conflicts outside. - local MANUAL_ENTRY='' - local LOCATION='' - - # Redefine location in order to make this function reusable not - # just for action value variable but whatever value passed as - # first possitional argument. - if [[ "$1" != '' ]];then - LOCATION="$1" - else - LOCATION="$ACTIONVAL" - fi - - # Define relative path of entry, from trunk directory on. - MANUAL_ENTRY=$(echo $LOCATION | sed -r "s!^${HOME}/artwork/!!") - - # Verify the entry relative path to find out which documentation - # manual we are acting on. As convenction, whatever documentation - # entry you provide outside trunk/Manuals/ directory structure is - # considered as you are documenting the repository directory - # structure. Otherwise, if an entry inside trunk/Manuals/ is - # provided, the directory structure provided is used as default - # documentation manual. - if [[ ${MANUAL_ENTRY} =~ "\.${FLAG_BACKEND}$" ]];then - MANUAL_ENTRY=$(echo ${MANUAL_ENTRY} | sed "s!trunk/Manuals/$(cli_getRepoName $FLAG_BACKEND -d)/!!") - else - MANUAL_ENTRY=$(dirname Entities/Repository/Directories/${MANUAL_ENTRY})/$(basename $LOCATION).${FLAG_BACKEND} - fi - - # Re-define entry to set absolute path to manuals base directory - # structure. - MANUAL_ENTRY=${MANUAL_BASEDIR}/${MANUAL_ENTRY} - - # Output entry's absolute path. - echo ${MANUAL_ENTRY} - -} diff --git a/Scripts/Functions/Help/Backends/Docbook/docbook_updateOutputFileXhtml.sh b/Scripts/Functions/Help/Backends/Docbook/docbook_updateOutputFileXhtml.sh deleted file mode 100755 index 8601cc4..0000000 --- a/Scripts/Functions/Help/Backends/Docbook/docbook_updateOutputFileXhtml.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# -# docbook_updateOutputFilePdf.sh -- This function produces XHTML -# output for repository documentation manual, in DocBook XML format. -# The procedure was taken from `docbook-style-xsl-1.69.1-5.1' -# documentation, which says: ---To publish HTML from your XML -# documents, you just need an XSLT engine.---. -# -# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_updateOutputFileXhtml { - - # Print action message. - cli_printMessage "${MANUAL_BASEFILE}.xhtml" --as-updating-line - - # Define absolute path to DocBook source file. This is the - # repository documentation manual file where DOCTYPE and ENTITY - # definition lines are set. - local SRC=${MANUAL_BACKEND}/${MANUAL_NAME}.docbook - - # Define absolute path to PDF target file. This is the final - # location the PDF file produced as result of DocBook to PDF - # transformation will be stored in. - local DST="${MANUAL_BASEFILE}.pdf" - - # Define absolute path of the XSLT file used to create the - # formatting object (.fo) file. - local XSLT=/usr/share/sgml/docbook/xsl-stylesheets/fo/docbook.xsl - - # Verify directory where the XHTML files will be stored in. - if [[ ! -d ${MANUAL_BASEFILE}.xhtml ]];then - mkdir ${MANUAL_BASEFILE}.xhtml - fi - - # Transform DocBook XML to XHTML supressing all stderr output. - xsltproc $XSLT --output $DST $SRC 2> /dev/null - -} diff --git a/Scripts/Functions/Help/Backends/Docbook/docbook_updateOutputFiles.sh b/Scripts/Functions/Help/Backends/Docbook/docbook_updateOutputFiles.sh deleted file mode 100755 index 7c365d1..0000000 --- a/Scripts/Functions/Help/Backends/Docbook/docbook_updateOutputFiles.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# docbook_updateOutputFiles.sh -- This function exports documentation -# manual from docbook input format to different output formats (e.g., -# pdf, xhtml, rtf and txt). -# -# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function docbook_updateOutputFiles { - - # Print separator line. - cli_printMessage '-' --as-separator-line - - # Update docbook output files. - docbook_updateOutputFilePdf - docbook_updateOutputFileXhtml - -}