root/tags/lgt2210/xml/html.sh

Revision 1460, 2.1 KB (checked in by pmoura, 4 years ago)

Updated release number to 2.21.0.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/bin/sh
2
3## =================================================================
4## Logtalk - Object oriented extension to Prolog
5## Release 2.21.0
6##
7## Copyright (c) 1998-2004 Paulo Moura.  All Rights Reserved.
8## =================================================================
9
10XT_PATH="/Applications/XML/XT"
11# XT_PATH="/usr/local/XT"
12
13XSLT="lgthtml.xsl"
14
15if [ -z "$1" ]; then
16    title="Entity documentation index"
17else
18    title="$1"
19fi
20
21echo
22echo This script converts all .xml files in the current directory to .html
23echo files applying the XSLT transformation defined in the $XSLT file
24echo using the James Clark XT XSLT Java processor 20020426a or later version.
25echo
26echo An index.html file, containing links to all .html documenting files,
27echo is automatically generated. This file uses the script optional parameter
28echo value as the title of the index.html file.
29echo
30echo converting XML files to HTML...
31
32for file in *.xml; do
33    echo "  converting" $file
34    name="`expr "$file" : '\(.*\)\.[^./]*$' \| "$file"`"
35    eval java -cp ${XT_PATH}/xt.jar:${XT_PATH}/lib/xp.jar -Dcom.jclark.xsl.sax.parser=com.jclark.xml.sax.CommentDriver com.jclark.xsl.sax.Driver $file $XSLT $name.html
36done
37
38echo conversion done
39echo
40echo generating index file...
41
42echo "" > index.html
43
44echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" >> index.html
45echo "<html>" >> index.html
46echo "<head>" >> index.html
47echo "    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">" >> index.html
48echo "    <title>"$title"</title>" >> index.html
49echo "    <link rel=\"stylesheet\" href=\"logtalk.css\" type=\"text/css\">" >> index.html
50echo "</head>" >> index.html
51echo "<body>" >> index.html
52echo "<h1>"$title"</h1>" >> index.html
53echo "<ul>" >> index.html
54
55for file in *.xml; do
56    name="`expr "$file" : '\(.*\)\.[^./]*$' \| "$file"`"
57    echo "  indexing" $name.html
58    echo "    <li><a href=\""$name.html"\">"$name"</a></li>" >> index.html
59done
60
61echo "</ul>" >> index.html
62
63date="`eval date`"
64
65echo "<p>Generated on "$date"</p>" >> index.html
66echo "</body>" >> index.html
67echo "</html>" >> index.html
68
69echo index file generated
70echo
Note: See TracBrowser for help on using the browser.