Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
making XBGF2HTML exporter fancier and up to date
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@1052 ab42f6e0-554d-0410-b580-99e487e6eeb2
- Loading branch information
1 parent
da999b3
commit f6e9cd0
Showing
3 changed files
with
561 additions
and
598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -r $1 ]; then | ||
echo "Oops: $1 not found or not readable." | ||
exit 1 | ||
fi | ||
|
||
LOCAL=${PWD} | ||
cd `dirname $0` | ||
cd ../.. | ||
SLPS=${PWD} | ||
cd `dirname ${LOCAL}/$1` | ||
FULLPATH=${PWD} | ||
cd ${LOCAL} | ||
|
||
if [ $# -eq 1 ]; then | ||
OUTPUT=/dev/stdout | ||
elif [ $# -ne 2 ]; then | ||
echo "This tool transforms Transformational BGF documents to hypertext EBNF." | ||
echo "Usage: xbgf2html <input-xbgf-document> [<output-hypertex>]" | ||
echo "When output file is not specified, stdout is used." | ||
exit 1 | ||
if [ $# -eq 2 ]; then | ||
xsltproc --stringparam date `date +"%d/%m/%Y"` --stringparam fname `basename $1 .xbgf` --stringparam fullpath ${FULLPATH}/`basename $1` ${SLPS}/topics/export/hypertext/xbgf2xhtml.xslt $1 | grep -v 'DOCTYPE' > $2 | ||
elif [ $# -eq 3 ]; then | ||
xsltproc --stringparam date `date +"%d/%m/%Y"` --stringparam fname `basename $1 .xbgf` --stringparam fullpath ${FULLPATH}/`basename $1` --stringparam gname $3 ${SLPS}/topics/export/hypertext/xbgf2xhtml.xslt $1 | grep -v 'DOCTYPE' > $2 | ||
else | ||
OUTPUT=$2 | ||
fi | ||
if [ ! -r $1 ]; then | ||
echo "Oops: $1 not found or not readable." | ||
echo "This tool transforms Transformational BGF documents to hypertext EBNF." | ||
echo "Usage: xbgf2html <input-xbgf-document> <output-hypertext> [<hypertext-grammar>]" | ||
echo "When grammar is not specified, the local file is used." | ||
exit 1 | ||
fi | ||
|
||
xsltproc ${SLPS}/topics/export/hypertext/xbgf2xhtml.xslt $1 | grep -v 'DOCTYPE' > ${OUTPUT} |
Oops, something went wrong.