C.1. Código del generador

El código empleado para generar la documentación se puede observar a continuación:

#!/bin/bash
#
# Copyright (C) 2002
#     Fernando Reyero Noya     <fernando.reyero@hispalinux.es>
#     Sergio González González <sergio.gonzalez@hispalinux.es>#
#
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

# Localización de los binarios
JADE=/usr/bin/jade
XSLTPROC=/usr/bin/xsltproc
JADETEX=/usr/bin/jadetex
DVIPDF=/usr/bin/dvipdf
DVIPS=/usr/bin/dvips

# Hoja de estilo html normal (todo en uno)
ESTILO_HTML=./fys.xsl

# Hoja de estilo html en trozos
ESTILO_HTML_CHUNK=./fys-chunk.xsl

# Hoja de estilo dssl (para pasar a .tex)
ESTILO_TEX=/usr/share/sgml/docbook/stylesheet/dsssl/modular/print/docbook.dsl

# Declaración de entidades
ENT=/usr/share/sgml/declaration/xml.dcl

/bin/echo -e "\nComenzando la generación de la documentación...\n\n"

# Pasamos a HTML normal
/bin/echo -e "Generando HTML simple...\n"
$XSLTPROC $ESTILO_HTML "$1".xml > "$1".html 2>/dev/null
/bin/echo -e "  [Hecho]\n"

# Pasamos a HTML en trozos
/bin/echo -e "Generando HTML en partes...\n"
$XSLTPROC $ESTILO_HTML_CHUNK "$1".xml 2>/dev/null
/bin/echo -e "  [Hecho]\n"

# Pasamos a formato TEX
/bin/echo -e "Generando archivo .tex...\n"
$JADE -d $ESTILO_TEX -t tex -V tex-backend $ENT "$1".xml 2>/dev/null
/bin/echo -e "  [Hecho]\n"

# Pasamos a DVI
/bin/echo -e "Generando DVI...\n"
$JADETEX "$1".tex >/dev/null 2>/dev/null
/bin/echo -e "  [Hecho]\n"

# Pasamos de DVI a PDF
/bin/echo -e "Generando PDF...\n"
$DVIPDF "$1".dvi 2>/dev/null
/bin/echo -e "  [Hecho]\n"

# Pasamos a de DVI a PostScript
/bin/echo -e "Generando PostScript...\n"
$DVIPS "$1".dvi 2>/dev/null
/bin/echo -e "  [Hecho]\n"

# Pasamos a RTF
/bin/echo -e "Generando RTF...\n"
$JADE -d $ESTILO_TEX -t rtf $ENT "$1".xml 2>/dev/null
/bin/echo -e "  [Hecho]\n"

# Borramos los ficheros temporales generados
/bin/rm -f *.aux *.log *.out
/bin/echo -e "Documentación generada.\n"