Blame Scripts/Functions/Help/Backends/Docbook/docbook_editEntry.sh

835106
#!/bin/bash
835106
#
835106
# docbook_editEntry.sh -- This function standardizes the way
835106
# documentation entries are edited inside docbook repository
835106
# documentation manual.
835106
#
835106
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
835106
#
835106
# This program is free software; you can redistribute it and/or modify
835106
# it under the terms of the GNU General Public License as published by
835106
# the Free Software Foundation; either version 2 of the License, or (at
835106
# your option) any later version.
835106
#
835106
# This program is distributed in the hope that it will be useful, but
835106
# WITHOUT ANY WARRANTY; without even the implied warranty of
835106
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
835106
# General Public License for more details.
835106
#
835106
# You should have received a copy of the GNU General Public License
835106
# along with this program; if not, write to the Free Software
835106
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
835106
#
835106
# ----------------------------------------------------------------------
835106
# $Id: docbook_editEntry.sh 2946 2011-05-26 23:30:00Z al $
835106
# ----------------------------------------------------------------------
835106
835106
function docbook_editEntry {
835106
835106
    # Print separator line.
835106
    cli_printMessage '-' --as-separator-line
835106
835106
    # Verify chapter definition inside manual.
835106
    if [[ ! -d $MANUAL_CHAPTER_DIR ]];then
835106
835106
        # Print confirmation question.
835106
        cli_printMessage "`gettext "The following documentation chapter will be created:"`"
835106
        cli_printMessage "$MANUAL_CHAPTER_DIR" --as-response-line
835106
        cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line
835106
835106
        # Update manual chapter related files.
835106
        #docbook_updateChaptersFiles
835106
835106
        # Update manual chapter related menu.
835106
        #docbook_updateChaptersMenu
835106
835106
        # Update manual chapter related nodes (based on chapter
835106
        # related menu).
835106
        #docbook_updateChaptersNodes
835106
835106
    fi
835106
835106
    # Verify section definition inside chapters. 
835106
    if [[ ! -f $MANUAL_ENTRY ]];then
835106
835106
        # Print confirmation question. 
835106
        cli_printMessage "`gettext "The following documentation section will be created:"`"
835106
        cli_printMessage "$MANUAL_ENTRY" --as-response-line
835106
        cli_printMessage "`gettext "Do you want to continue?"`" --as-yesornorequest-line
835106
835106
        # Update chapter section related menu.
835106
        #docbook_updateMenu
835106
835106
        # Update chapter section related nodes (based on chapter
835106
        # section related menu).
835106
        #docbook_updateNodes
835106
835106
        # Update old missing cross references. If for some reason a
835106
        # documentation entry is removed by mistake, and that mistake
835106
        # is fixing by adding the removed documentation entry back
835106
        # into the repository, rebuild the missing cross reference
835106
        # message to use the correct link to the documentation
835106
        # section.
835106
        #docbook_restoreCrossReferences
835106
835106
    else
835106
835106
        # Print action message.
835106
        cli_printMessage "$MANUAL_ENTRY" --as-updating-line
835106
835106
    fi
835106
835106
    # Use default text editor to edit the documentation entry.
835106
    eval $EDITOR $MANUAL_ENTRY
835106
835106
    # Rebuild output files to propagate recent changes.
835106
    docbook_updateOutputFiles
835106
835106
}