Blame Scripts/Modules/Locale/Modules/Files/Modules/Update/Modules/Asciidoc/asciidoc_convertAsciidocToDocbook.sh

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