|
|
1a4d0e |
#!/bin/bash
|
|
|
1a4d0e |
#
|
|
|
2fa604 |
# docbook_convertToPdf.sh -- This function takes DocBook XML as input
|
|
|
2fa604 |
# and produces two different PDF as outputs; one from DocBook XML and
|
|
|
63e984 |
# another from DocBook SGML. We decided to provide support for both
|
|
|
63e984 |
# ways of output production from DocBook XML and DocBook SGML for you
|
|
|
63e984 |
# to evaluate and if possible correct.
|
|
|
1a4d0e |
#
|
|
|
2fe9b7 |
# Copyright (C) 2009, 2010, 2011 The CentOS Project
|
|
|
1a4d0e |
#
|
|
|
1a4d0e |
# This program is free software; you can redistribute it and/or modify
|
|
|
1a4d0e |
# it under the terms of the GNU General Public License as published by
|
|
|
2fe9b7 |
# the Free Software Foundation; either version 2 of the License, or (at
|
|
|
2fe9b7 |
# your option) any later version.
|
|
|
1a4d0e |
#
|
|
|
1a4d0e |
# This program is distributed in the hope that it will be useful, but
|
|
|
1a4d0e |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
1a4d0e |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
1a4d0e |
# General Public License for more details.
|
|
|
1a4d0e |
#
|
|
|
1a4d0e |
# You should have received a copy of the GNU General Public License
|
|
|
1a4d0e |
# along with this program; if not, write to the Free Software
|
|
|
1a4d0e |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
1a4d0e |
#
|
|
|
1a4d0e |
# ----------------------------------------------------------------------
|
|
|
1a4d0e |
# $Id$
|
|
|
1a4d0e |
# ----------------------------------------------------------------------
|
|
|
1a4d0e |
|
|
|
a7c6e7 |
function docbook_convertToPdf {
|
|
|
1a4d0e |
|
|
|
2fa604 |
# Tranform DocBook XML to PDF.
|
|
|
8c13b6 |
docbook_convertToPdfFromXml
|
|
|
1a4d0e |
|
|
|
f27e3a |
# Tranform DocBook SGML to PDF.
|
|
|
f27e3a |
if [[ $(cli_getCurrentLocale) =~ '^en' ]];then
|
|
|
f27e3a |
# FIXME: This is only possible when no localization is
|
|
|
f27e3a |
# performed (i.e., xml2po is not involved.) to main DocBook
|
|
|
f27e3a |
# file, otherwise there will be errors and the PDF output
|
|
|
f27e3a |
# won't be created. The errors come out because when we passed
|
|
|
f27e3a |
# the validated DocBook file to xml2po all XML decimal
|
|
|
f27e3a |
# entities inside the main DocBook file are expanded and set
|
|
|
f27e3a |
# in the msgid field. Such expanded characters are not
|
|
|
f27e3a |
# recognized by openjade when they are used as source to
|
|
|
f27e3a |
# produce the PDF output.
|
|
|
8c13b6 |
docbook_convertToPdfFromSgml
|
|
|
f27e3a |
fi
|
|
|
1a4d0e |
|
|
|
1a4d0e |
}
|