gen-doc.sh 1.39 KB
Newer Older
1
#!/usr/bin/env bash
2
#
3
# Generates the SGML documentation from a TTL description
4
# Copyright (C) 2009, Nokia <ivan.frade@nokia.com>
5 6 7 8 9 10 11 12 13 14
#
# 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
# of the License, 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.
15
#
16 17 18
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
19
# 02110-1301, USA.
20 21
#

22 23
set -e

24
if [ $# -lt 5 ]; then
25
	echo "Insufficient arguments provided"
26
	echo "Usage: $0 <ttl2sgml> <ttlres2sgml> <ontology-data-dir> <build-dir>"
27 28 29
	exit 1;
fi

30
TTL2SGML=$1
31 32
TTLRES2SGML=$2
ONTOLOGIES_DATA_DIR=$3
33
BUILD_DIR=$4
34

35 36 37 38
if [ ! -e $BUILD_DIR ]; then
    mkdir -p $BUILD_DIR
fi

39
$TTLRES2SGML -d $ONTOLOGIES_DATA_DIR -o $BUILD_DIR
40

41
for f in `find $ONTOLOGIES_DATA_DIR -name "*.description"` ; do
42
    # ../../src/ontologies/XX-aaa.description -> PREFIX=aaa
43 44 45
    TMPNAME=${f%.description}
    PREFIX=${TMPNAME#*-}

46
    $TTL2SGML -d $f -o $BUILD_DIR/$PREFIX-ontology.xml
47
done
48

49
echo "Done"