/Articles/Forth/PHP/GenerateHTML.cfg
6,7 → 6,6
// Source Files
$CFG["SourceDir"]="../../../../amforth/trunk/";
$CFG["SourceAsm"]="amforth.asm";
$CFG["SvnInfoFileName"]=".svn-info.txt";
 
// Template Files
$CFG["TemplateDir"]="../Templates/";
/Articles/Forth/PHP/GenerateHTML.php
165,7 → 165,6
print " EnableApache={0|1} - Enable to run in Apache\n";
print " SourceDir=path - path to asm source directory\n";
print " SourceAsm=file - name of top level asm source file\n";
print " SvnInfoFileName - name of Svn Info File\n";
print " TemplateDir=path - path to HTML template\n";
print " DestinationDir=path - path to destination HTML\n";
Error("\n");
175,11 → 174,12
function Parameters(&$CFG)
// Function process Command Line parameters
{
// Info
print "Parameters\n";
// Dummy values
$CFG["EnableApache"] = 0; // Do not allow run in Apache
$CFG["SourceDir"] = "";
$CFG["SourceAsm"] = "";
$CFG["SvnInfoFileName"] = "";
$CFG["TemplateDir"] = "";
$CFG["DestinationDir"] = "";
// Default values (in cfg file)
208,13 → 208,6
}
}
 
// Check if alowed to run in Apache
if ($_SERVER["argc"]==0 & ! $CFG["EnableApache"])
return "<b>This Script is configured so that it will not run in Apache.</b>";
 
// Info
print "Parameters\n";
 
// Correct paths and existence
foreach($CFG as $Key => $Value)
{
240,6 → 233,10
print " $Key=$Value\n";
print "\n";
 
// Check if alowed to run in Apache
if ($_SERVER["argc"]==0 & ! $CFG["Apache"])
return "This Script is configured so that it will not run in Apache.";
 
// No Error
return "";
}
431,7 → 428,7
}
 
 
function GenerateWordList($TemplateDir, $SvnInfoFileName, $DestinationDir, &$LabelList, &$WordList)
function GenerateWordList($TemplateDir, $DestinationDir, &$LabelList, &$WordList)
// Creates HTML pages with Word List
// Returns Error String
// IN $TemplateDir - template directory (file WordList.*.html)
452,34 → 449,6
if ($Error!="")
return $Error;
 
// Find <<SvnInfo>>
if (!preg_match("/( *)(<<SvnInfo>>)/i",$FileContent,$Matches))
{
unset($FileContent);
return "Missing <<SvnInfo>> in template file";
}
$Indent=$Matches[1];
 
// Read Svn Info file
$Error=MyReadFileString($SvnInfoFileName, $SvnInfoFile);
if ($Error!="")
{
// We do not have Svn Info File
$SvnInfoFile="";
}
else
{
// We have Svn Info File
$SvnInfoFile=preg_replace("/^((?:URL|Repository|Last)[^:]*):(.*$)|^.*$/im","<tr><td>$1</td><td>$2</td></tr>",$SvnInfoFile);
$SvnInfoFile=preg_replace("~<tr><td></td><td></td></tr>\n~i","",$SvnInfoFile);
$SvnInfoFile="<tr><th colspan=\"2\">Subversion Info</th></tr>".$SvnInfoFile;
}
 
// Put Svn Info into HTML template
$FileContent=str_ireplace("<<SvnInfo>>", $SvnInfoFile, $FileContent);
#print $FileContent;
 
 
// Find <<WordList>>
if (!preg_match("/( *)(<<WordList>>)/i",$FileContent,$Matches))
{
518,8 → 487,7
// Indent and Concatenate lines
foreach($WordListHTML as $Key => $Value)
{
if ($Key>0)
$WordListHTML[$Key]=$Indent.preg_replace("/\n/","<br>",$Value);
$WordListHTML[$Key]=$Indent.preg_replace("/\n/","<br>",$Value);
}
$WordListHTML=implode("\n",$WordListHTML);
618,11 → 586,7
Error(CreateWordList($CFG["SourceDir"], $LabelList, $WordList));
 
// Create HTML WordList
Error(GenerateWordList(
$CFG["TemplateDir"],
$CFG["SourceDir"].$CFG["SvnInfoFileName"],
$CFG["DestinationDir"],
$LabelList, $WordList));
Error(GenerateWordList($CFG["TemplateDir"], $CFG["DestinationDir"], $LabelList, $WordList));
 
// Copy ASM files and convert them into HTML
Error(GenerateAsmFiles($CFG["TemplateDir"], $CFG["SourceDir"], $SourceAsmFiles, $CFG["DestinationDir"]));
631,8 → 595,7
print "O.K.\n";
return
 
// Zpracování readme autora
// Vyplatilo by se udělat samostatny formatovaci a nahrazovaci mechanizmus
// Zpracování readme autora + verze
// Zpracování templejtů do samostatného podprogramu (vyřešit indent...)
// tím se vyřeší i en/cs verze Asm souboru
// Generovat log do souboru místo printu (zvážit) oddělit chyby a varování
/Articles/Forth/PHP/amforth
100,7 → 100,6
EnableApache="0" \
SourceDir="$WorkingDir/source-exported/" \
SourceAsm="amforth.asm" \
SvnInfoFile="$SvnInfoFile" \
TemplateDir="$WebForthInPath/Templates/" \
DestinationDir="$WebForthOutPath/HTML/" \
> $LogFileGenerate 2>> $LogFile
/Articles/Forth/Templates/WordList.cs.html
52,34 → 52,11
</p>
<p class="Subtitle">
Tato stránka zpřístupňuje křížovou referenci jazyka amforth. Odkazy se
generují automaticky na základě zdrojových souborů jazyka amforth.
generují automaticky na základě zdrojových souborů jazyka amforth, které
jsou umístěny na (přístupné pomocí klienta Subversion)
<a href="https://amforth.svn.sourceforge.net/svnroot/amforth">https://amforth.svn.sourceforge.net/svnroot/amforth</a>.
</p>
 
<h1> Verze </h1>
 
<table class="Compact">
<tr>
<th colspan="2" class="center"> Základní informace </th>
</tr>
<tr>
<td> Stránka jazyka amforth </td>
<td> <a href="http://amforth.sourceforge.net/">http://amforth.sourceforge.net/</a></td>
</tr>
<tr>
<td> Stránka pro download </td>
<td> <a href="http://sourceforge.net/projects/amforth">http://sourceforge.net/projects/amforth</a></td>
</tr>
<tr>
<td> Subversion server </td>
<td> <a href="https://amforth.svn.sourceforge.net/svnroot/amforth">https://amforth.svn.sourceforge.net/svnroot/amforth</a></td>
</tr>
<<SvnInfo>>
</table>
<!--
<<ReadMe>>
-->
 
<h1> Seznam slov </h1>
 
<<WordList>>
/Articles/Forth/Templates/WordList.en.html
51,35 → 51,12
amforth - Forth for ATmega
</p>
<p class="Subtitle">
This page provides cross reference of the language amforth. The list is
automaticaly generated drectly from assemble source files.
This page is automaticaly generated cross reference for language
amforth. Links are generated directly from source files of the language
which is available at (needs Subversion Client)
<a href="https://amforth.svn.sourceforge.net/svnroot/amforth">https://amforth.svn.sourceforge.net/svnroot/amforth</a>.
</p>
 
<h1> Vesion </h1>
 
<table class="Compact">
<tr>
<th colspan="2" class="center"> Basic information </th>
</tr>
<tr>
<td> amforth main page </td>
<td> <a href="http://amforth.sourceforge.net/">http://amforth.sourceforge.net/</a></td>
</tr>
<tr>
<td> amforth download page </td>
<td> <a href="http://sourceforge.net/projects/amforth">http://sourceforge.net/projects/amforth</a></td>
</tr>
<tr>
<td> Subversion server </td>
<td> <a href="https://amforth.svn.sourceforge.net/svnroot/amforth">https://amforth.svn.sourceforge.net/svnroot/amforth</a></td>
</tr>
<<SvnInfo>>
</table>
 
<!--
<<ReadMe>>
-->
 
<h1> Vocabulary </h1>
 
<<WordList>>