Blame tcar-scripts-locale/Modules/Files/Modules/Update/Modules/Asciidoc/asciidoc_convertAsciidocToDocbook.sh

Alain Reguera Delgado f23b0d
#!/bin/bash
Alain Reguera Delgado f23b0d
######################################################################
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
#   asciidoc_convertAsciidocToDocbook.sh -- This function converts
Alain Reguera Delgado f23b0d
#   asciicoc files into docbook files using asciidoc command's default
Alain Reguera Delgado f23b0d
#   (article) doctype.
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
#   When docbook files are produced from asciidoc files it is
Alain Reguera Delgado f23b0d
#   necessary to consider the format in which they are generated
Alain Reguera Delgado f23b0d
#   (e.g., whether it is an article or a manpage). This information is
Alain Reguera Delgado f23b0d
#   stored in render.conf file, in the same directory of asciidoc
Alain Reguera Delgado f23b0d
#   file. Both locale and render modules need to produce the same
Alain Reguera Delgado f23b0d
#   docbook output in order to produce html and manpages well
Alain Reguera Delgado f23b0d
#   localized. Otherwise, there might be content that would be not
Alain Reguera Delgado f23b0d
#   localized because the same content is produced using a different
Alain Reguera Delgado f23b0d
#   markup (e.g., you localize asciidoc documents as articles but then
Alain Reguera Delgado f23b0d
#   render them as manpage).  To solve this issue, it is necessary
Alain Reguera Delgado f23b0d
#   that both locale and render module use the same configuration
Alain Reguera Delgado f23b0d
#   file when producing localization and final content. This way, both
Alain Reguera Delgado f23b0d
#   locale and render produce content using the same information.
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
#   Written by:
Alain Reguera Delgado f23b0d
#   * Alain Reguera Delgado <al@centos.org.cu>, 2009-2013
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
# Copyright (C) 2009-2013 The CentOS Artwork SIG
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
# This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado f23b0d
# it under the terms of the GNU General Public License as published by
Alain Reguera Delgado f23b0d
# the Free Software Foundation; either version 2 of the License, or (at
Alain Reguera Delgado f23b0d
# your option) any later version.
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
# This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado f23b0d
# WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado f23b0d
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado f23b0d
# General Public License for more details.
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
# You should have received a copy of the GNU General Public License
Alain Reguera Delgado f23b0d
# along with this program; if not, write to the Free Software
Alain Reguera Delgado f23b0d
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado f23b0d
#
Alain Reguera Delgado f23b0d
######################################################################
Alain Reguera Delgado f23b0d
Alain Reguera Delgado f23b0d
function asciidoc_convertAsciidocToDocbook {
Alain Reguera Delgado f23b0d
Alain Reguera Delgado f23b0d
    tcar_checkFiles -m '^(manpage|article|book)$' "${RENDER_FLOW}"
Alain Reguera Delgado f23b0d
Alain Reguera Delgado f23b0d
    /usr/bin/asciidoc --backend="docbook" --doctype="${RENDER_FLOW}" \
Alain Reguera Delgado f23b0d
        --out-file=${DOCBOOK} ${RENDER_FROM}
Alain Reguera Delgado f23b0d
Alain Reguera Delgado f23b0d
}