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