No changes between revisions
/Articles/Forth/PHP/amforth
0,0 → 1,133
#!/bin/sh
#
# This script takes source files of amforth and call php script which
# creates HTML pages. The script may be run by hand on regulerly fox
# example once an hour or day.
#
# (c) miho 2007 / www.mlab.cz
 
# Configuration
# =============
# WorkingDir - existing directory with rw access
# SvnPath - path ro subversion server with source files
# SvnInfoFile - name of file to put info about version in
# WebForthInPath - name of directory with HTML templates and scripts
# WebForthOutPath - name of directory to put HTML pages in
WorkingDir=/home/miho/amforth
SvnPath=https://amforth.svn.sourceforge.net/svnroot/amforth/trunk
SvnInfoFile=.svn-info.txt
WebForthInPath=/var/www/Articles/Forth
WebForthOutPath=/var/www/Articles/Forth
 
# Start of script
# ===============
DateFile=/tmp/amforth.date
if [ -f $DateFile ]; then
tail -n 400 $DateFile > $DateFile. 2> /dev/nul
rm $DateFile 2> /dev/nul
mv $DateFile. $DateFile 2> /dev/nul
fi
date >> $DateFile 2> /dev/nul
 
# Create Log file
# ===============
if [ ! -d $WorkingDir ]; then
echo "--> ERROR: No Workig Directory"
exit 1
fi
cd $WorkingDir
if [ ! -d $WorkingDir/Log ]; then
mkdir $WorkingDir/Log 2> /dev/nul
if (($?)); then
echo "--> ERROR: Unable Create Working Directory"
exit 1
fi
fi
LogFile=$WorkingDir/Log/amforth.log
LogFileGenerate=$WorkingDir/Log/GenerateHTML.log
echo "$0" > $LogFile
echo "-------------------" >> $LogFile
 
# Remove export directory
# =======================
echo "Performing: remove export directory" | tee -a $LogFile
rm -rf $WorkingDir/source-exported | tee -a $LogFile 2>> $LogFile
if (($?)); then
echo "--> ERROR: Unable Remove Export Directory" | tee -a $LogFile
exit 1
fi
echo "-------------------" >> $LogFile
 
# svn checkout
# ============
echo "Performing: svn checkout" | tee $LogFile
svn co $SvnPath $WorkingDir/source >> $LogFile 2>> $LogFile
if (($?)); then
echo "--> ERROR: svn commit" | tee -a $LogFile
exit 1
fi
echo "-------------------" >> $LogFile
 
# svn export
# ==========
echo "Performing: svn export" | tee -a $LogFile
svn export $WorkingDir/source $WorkingDir/source-exported >> $LogFile 2>> $LogFile
if (($?)); then
echo "--> ERROR: svn export" | tee -a $LogFile
exit 1
fi
echo "-------------------" >> $LogFile
 
# svn info
# ========
echo "Performing: svn info" | tee -a $LogFile
Result=`svn info $WorkingDir/source` 2>> $LogFile
echo "$Result" >> $LogFile
if (($?)); then
echo "--> ERROR: svn export" | tee -a $LogFile
exit 1
fi
echo "$Result" > $WorkingDir/source-exported/$SvnInfoFile
echo "-------------------" >> $LogFile
 
# Create HTML
# ===========
echo "Performing: GenerateHTML" | tee -a $LogFile
if [ ! -d $WorkingDir/HTML ]; then
mkdir $WorkingDir/HTML 2>> $LogFile
fi
php $WebForthInPath/PHP/GenerateHTML.php \
SourceDir="$WorkingDir/source-exported/" \
SourceAsm="amforth.asm" \
TemplateDir="$WebForthInPath/Templates/" \
DestinationDir="$WebForthOutPath/HTML/" \
> $LogFileGenerate 2>> $LogFile
if (($?)); then
echo "--> ERROR: GenerateHTML.php" | tee -a $LogFile
exit 1
fi
echo "-------------------" >> $LogFile
 
# Copy result to Web Directory
# ============================
echo "Performing: copy HTML" | tee -a $LogFile
rm -rf $WebForthOutPath/HTML | tee -a $LogFile 2>> $LogFile
if (($?)); then
echo "--> ERROR: Unable Remove HTML Directory" | tee -a $LogFile
exit 1
fi
if [ ! -d $WebForthOutPath/HTML ] || [ -d $WebForthOutPath ]; then
mkdir $WebForthOutPath/HTML | tee -a $LogFile 2>> $LogFile
fi
cp -r $WorkingDir/HTML/* $WebForthOutPath/HTML | tee -a $LogFile 2>> $LogFile
echo "-------------------" >> $LogFile
if (($?)); then
echo "--> ERROR: Unable Copy HTML Directory" | tee -a $LogFile
exit 1
fi
 
# Finish
# ======
echo "O.K."
echo "O.K." >> /tmp/amforth.date
exit 0
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/Articles/Forth/Templates/FileAsm.cs.html
6,10 → 6,10
<meta name="keywords" content="amforth programovací jazyk Forth ATmega ATMEL">
<meta name="description" content="amforth - jazyk Forth pro ATMEL ATmega">
<!-- AUTOINCLUDE START "Page/Head.cs.ihtml" DO NOT REMOVE -->
<link rel="StyleSheet" href="../../../Web/CSS/MLAB.css" type="text/css" title="MLAB základní styl">
<link rel="StyleSheet" href="../../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
<link rel="shortcut icon" type="image/x-icon" href="../../../Web/PIC/MLAB.ico">
<script type="text/javascript" src="../../../Web/JS/MLAB_Menu.js"></script>
<link rel="StyleSheet" href="../../../../Web/CSS/MLAB.css" type="text/css" title="MLAB základní styl">
<link rel="StyleSheet" href="../../../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
<link rel="shortcut icon" type="image/x-icon" href="../../../../Web/PIC/MLAB.ico">
<script type="text/javascript" src="../../../../Web/JS/MLAB_Menu.js"></script>
<!-- AUTOINCLUDE END -->
</head>
 
20,7 → 20,7
<div class="Header">
<script type="text/javascript">
<!--
SetRelativePath("../../../");
SetRelativePath("../../../../");
DrawHeader();
// -->
</script>
35,7 → 35,7
<div class="Menu">
<script type="text/javascript">
<!--
SetRelativePath("../../../");
SetRelativePath("../../../../");
DrawMenu();
// -->
</script>
71,7 → 71,7
<div class="Footer">
<script type="text/javascript">
<!--
SetRelativePath("../../../");
SetRelativePath("../../../../");
DrawFooter();
// -->
</script>
/Articles/Forth/Templates/FileAsm.en.html
6,10 → 6,10
<meta name="keywords" content="amforth programming language Forth ATmega ATMEL">
<meta name="description" content="amforth - laguage Forth for ATMEL ATmega">
<!-- AUTOINCLUDE START "Page/Head.en.ihtml" DO NOT REMOVE -->
<link rel="StyleSheet" href="../../../Web/CSS/MLAB.css" type="text/css" title="MLAB Basic Style">
<link rel="StyleSheet" href="../../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
<link rel="shortcut icon" type="image/x-icon" href="../../../Web/PIC/MLAB.ico">
<script type="text/javascript" src="../../../Web/JS/MLAB_Menu.js"></script>
<link rel="StyleSheet" href="../../../../Web/CSS/MLAB.css" type="text/css" title="MLAB Basic Style">
<link rel="StyleSheet" href="../../../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
<link rel="shortcut icon" type="image/x-icon" href="../../../../Web/PIC/MLAB.ico">
<script type="text/javascript" src="../../../../Web/JS/MLAB_Menu.js"></script>
<!-- AUTOINCLUDE END -->
</head>
 
20,7 → 20,7
<div class="Header">
<script type="text/javascript">
<!--
SetRelativePath("../../../");
SetRelativePath("../../../../");
DrawHeader();
// -->
</script>
35,7 → 35,7
<div class="Menu">
<script type="text/javascript">
<!--
SetRelativePath("../../../");
SetRelativePath("../../../../");
DrawMenu();
// -->
</script>
71,7 → 71,7
<div class="Footer">
<script type="text/javascript">
<!--
SetRelativePath("../../../");
SetRelativePath("../../../../");
DrawFooter();
// -->
</script>
/Articles/Forth/Templates/WordList.cs.html
6,10 → 6,10
<meta name="keywords" content="amforth programovací jazyk Forth ATmega ATMEL">
<meta name="description" content="amforth - jazyk Forth pro ATMEL ATmega">
<!-- AUTOINCLUDE START "Page/Head.cs.ihtml" DO NOT REMOVE -->
<link rel="StyleSheet" href="../../Web/CSS/MLAB.css" type="text/css" title="MLAB základní styl">
<link rel="StyleSheet" href="../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
<link rel="shortcut icon" type="image/x-icon" href="../../Web/PIC/MLAB.ico">
<script type="text/javascript" src="../../Web/JS/MLAB_Menu.js"></script>
<link rel="StyleSheet" href="../../../Web/CSS/MLAB.css" type="text/css" title="MLAB základní styl">
<link rel="StyleSheet" href="../../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
<link rel="shortcut icon" type="image/x-icon" href="../../../Web/PIC/MLAB.ico">
<script type="text/javascript" src="../../../Web/JS/MLAB_Menu.js"></script>
<!-- AUTOINCLUDE END -->
</head>
 
20,7 → 20,7
<div class="Header">
<script type="text/javascript">
<!--
SetRelativePath("../../");
SetRelativePath("../../../");
DrawHeader();
// -->
</script>
35,7 → 35,7
<div class="Menu">
<script type="text/javascript">
<!--
SetRelativePath("../../");
SetRelativePath("../../../");
DrawMenu();
// -->
</script>
68,7 → 68,7
<div class="Footer">
<script type="text/javascript">
<!--
SetRelativePath("../../");
SetRelativePath("../../../");
DrawFooter();
// -->
</script>
/Articles/Forth/Templates/WordList.en.html
6,10 → 6,10
<meta name="keywords" content="amforth programming language Forth ATmega ATMEL">
<meta name="description" content="amforth - laguage Forth for ATMEL ATmega">
<!-- AUTOINCLUDE START "Page/Head.en.ihtml" DO NOT REMOVE -->
<link rel="StyleSheet" href="../../Web/CSS/MLAB.css" type="text/css" title="MLAB Basic Style">
<link rel="StyleSheet" href="../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
<link rel="shortcut icon" type="image/x-icon" href="../../Web/PIC/MLAB.ico">
<script type="text/javascript" src="../../Web/JS/MLAB_Menu.js"></script>
<link rel="StyleSheet" href="../../../Web/CSS/MLAB.css" type="text/css" title="MLAB Basic Style">
<link rel="StyleSheet" href="../../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
<link rel="shortcut icon" type="image/x-icon" href="../../../Web/PIC/MLAB.ico">
<script type="text/javascript" src="../../../Web/JS/MLAB_Menu.js"></script>
<!-- AUTOINCLUDE END -->
</head>
 
20,7 → 20,7
<div class="Header">
<script type="text/javascript">
<!--
SetRelativePath("../../");
SetRelativePath("../../../");
DrawHeader();
// -->
</script>
35,7 → 35,7
<div class="Menu">
<script type="text/javascript">
<!--
SetRelativePath("../../");
SetRelativePath("../../../");
DrawMenu();
// -->
</script>
68,7 → 68,7
<div class="Footer">
<script type="text/javascript">
<!--
SetRelativePath("../../");
SetRelativePath("../../../");
DrawFooter();
// -->
</script>