goba Sat Feb 3 03:04:01 2001 EDT
Modified files:
/phpdoc make_chm.README make_chm.bat make_chm.php
make_chm_fancy.php
Log:
Getting ready to the new index file (index.html).
Correcting some minor bugs.
htmlentities() to the elements of the toctree
Getting date into the file (eg. manual-en-20010203.chm)
It should work again :)
Index: phpdoc/make_chm.README
diff -u phpdoc/make_chm.README:1.4 phpdoc/make_chm.README:1.5
--- phpdoc/make_chm.README:1.4 Sun Jan 14 09:05:55 2001
+++ phpdoc/make_chm.README Sat Feb 3 03:04:01 2001
@@ -26,7 +26,8 @@
http://snaps.php.net/manual/lang/
and untar the distribution in a directory
a) Build the html manual yourself using Jade and the other
- tools needed (how to do it is not in the scope of this README)
+ tools needed (look into the README or README.win32
+ file to see how to build it yourself)
=======================================================================
You need the .chm manual generator files (from cvs.php.net):
@@ -38,7 +39,7 @@
make_chm_fancy.php - Convert the normal html files to
good looking pages and correct
- some pages (manual.html, copyright.html)
+ some pages (original index, copyright.html)
make_chm_index_lang.html - Fancy index. I recommend you
to use a fancy index in the language
of the actual compiled maunal (look into
@@ -46,7 +47,7 @@
make_chm_spc.gif - GIF file needed by the fancy pages.
make_chm_style.css - This adds some good style to html files.
-Note that you NEED make_chm.php and make_chm.bat to make the
+Note that you NEED make_chm.php and make_chm.bat to make the
fancy manual too!!!!!
Now put the above listed make_chm_* files to one directory.
@@ -54,12 +55,12 @@
directory (eg. html).
You need to decide what method to use (normal or fancy).
-The output .chm file for the tested Hungarian version were nearly
-in the same size, the fancy manual .chm took 30k more space.
+The output .chm file for the tested English and Hungarian version
+were nearly in the same size, the fancy manual .chm took 30k more space.
This is not significant, as the .chm files are ~1.5Megs in size.
=======================================================================
-To make manual_lang.chm using the normal HTML pages:
+To make manual-lang-date.chm using the normal HTML pages:
Open make_chm.bat in a text editor and set the appropriate
environment variables. You need to
@@ -72,18 +73,21 @@
actual manual (use the code from cvs.php.net, eg. hu)
- set PHP_HELP_COMPILE_DIR to the directory of the
html manual (eg. html)
+ - set PHP_HELP_COMPILE_INDEX to the index filename in
+ the directory you set above. This used to be manual.html
+ for a long time, but it seems it is now index.html.
Now the batch file is ready to run. To compile the normal
manual, use the 'normal' command line option (without quotes):
make_chm.bat normal
-It will generate manual_lang.hhp, manual_lang.hhc in the
+It will generate manual-lang.hhp, manual-lang.hhc in the
same directory, and run hhc to finalize the process
-and compile manual_lang.chm.
+and compile manual-lang-date.chm.
=======================================================================
-To make manual_lang.chm using the fancy style:
+To make manual-lang-date.chm using the fancy style:
See make_chm.bat and make all the modifications described above.
One more thing you need to set here is the PHP_HELP_COMPILE_FANCYDIR
@@ -107,16 +111,16 @@
It will generate the fancy pages in the directory you specified,
copying in to the fancy dir
- make_chm_index_lang.html as index.html,
+ make_chm_index_lang.html as fancy_index.html,
make_chm_spc.gif as spacer.gif and
make_chm_style.css as style.css
-A date subtitution takes place when copying index.html (the
+A date subtitution takes place when copying fancy_index.html (the
actual date will be printed inside the file), and some more
-modifications are made to manual.html and copyright.html.
+modifications are made to the original manual index and copyright.html.
After that the same process is done as described above with normal pages.
-After this process, you will have manual_lang.chm in your language...
+After this process, you will have manual-lang-date.chm in your language...
The fancy design improvemenets and the .css file is based on
the newsite design(TM) work of Colin Viebrock [[EMAIL PROTECTED]] :)
Index: phpdoc/make_chm.bat
diff -u phpdoc/make_chm.bat:1.4 phpdoc/make_chm.bat:1.5
--- phpdoc/make_chm.bat:1.4 Sun Jan 14 09:05:55 2001
+++ phpdoc/make_chm.bat Sat Feb 3 03:04:01 2001
@@ -3,10 +3,22 @@
rem !! Please read the make_chm.README file for information
rem !! about how to build a manual_lang.chm file.
-set PHP_PATH=D:\progra~1\php402\php.exe
+rem Path of the PHP CGI executable
+set PHP_PATH=D:\progra~1\php404\php.exe
+
+rem Path of the Help Compiler command line tool
set PHP_HELP_COMPILER=D:\progra~1\helpwo~1\hhc.exe
-set PHP_HELP_COMPILE_LANG=hu
+
+rem The language of the manual to compile
+set PHP_HELP_COMPILE_LANG=en
+
+rem The source directory with the original DSSSL made HTML
set PHP_HELP_COMPILE_DIR=html
+
+rem The index file in this directory (manual.html or idex.html)
+set PHP_HELP_COMPILE_INDEX=index.html
+
+rem The directory, where the fancy files need to be copied
set PHP_HELP_COMPILE_FANCYDIR=fancy
rem ==========================================================
@@ -31,8 +43,8 @@
echo Now running the toc and project file generator script...
%PHP_PATH% -q make_chm.php
-echo Compiling the actual helpfile (manual_%PHP_HELP_COMPILE_LANG%.chm)...
-%PHP_HELP_COMPILER% manual_%PHP_HELP_COMPILE_LANG%.chm
+echo Compiling the actual helpfile (manual-%PHP_HELP_COMPILE_LANG%-date.chm)...
+%PHP_HELP_COMPILER% manual-%PHP_HELP_COMPILE_LANG%.hhp
echo Done!
echo.
Index: phpdoc/make_chm.php
diff -u phpdoc/make_chm.php:1.8 phpdoc/make_chm.php:1.9
--- phpdoc/make_chm.php:1.8 Fri Feb 2 10:45:08 2001
+++ phpdoc/make_chm.php Sat Feb 3 03:04:01 2001
@@ -10,12 +10,13 @@
$fancydir = getenv("PHP_HELP_COMPILE_FANCYDIR");
if (empty($fancydir)) { $fancydir = getenv("PHP_HELP_COMPILE_DIR"); }
$language = getenv("PHP_HELP_COMPILE_LANG");
+ $original_index = getenv("PHP_HELP_COMPILE_INDEX");
MakeProjectFile();
function MakeProjectFile () {
- global $fancydir, $language, $manual_title, $fancyindex, $indexfile;
+ global $fancydir, $language, $manual_title, $fancyindex, $indexfile,
+$original_index;
// define language array (manual code -> HTML Help Code)
// Japanese is not on my list, I don't know why...
@@ -35,18 +36,18 @@
);
- if (file_exists("$fancydir/index.html")) {
+ if (file_exists("$fancydir/fancy-index.html")) {
$fancyindex = TRUE;
- $indexfile = "index.html";
- } else { $indexfile = "manual.html"; }
+ $indexfile = "fancy-index.html";
+ } else { $indexfile = $original_index; }
// Start writing the project file
- $f = fopen ("manual_$language.hhp", "w");
+ $f = fopen ("manual-$language.hhp", "w");
fputs ($f, "[OPTIONS]\n");
fputs ($f, "Auto Index=Yes\n");
fputs ($f, "Compatibility=1.1 or later\n");
- fputs ($f, "Compiled file=manual_$language.chm\n");
- fputs ($f, "Contents file=manual_$language.hhc\n");
+ fputs ($f, "Compiled file=manual-$language-" . date("Ymd") . ".chm\n");
+ fputs ($f, "Contents file=manual-$language.hhc\n");
fputs ($f, "Default Font=Arial,10,0\n");
fputs ($f, "Default Window=phpdoc\n");
fputs ($f, "Default topic=$fancydir\\$indexfile\n");
@@ -58,7 +59,7 @@
// now try to find out how the manual named in the actual language
// this must be in the manual.html file as the title (DSSSL generated)
- $content = join("", file("$fancydir/manual.html"));
+ $content = join("", file("$fancydir/$original_index"));
if (preg_match("|>(.*)</TITLE|U", $content, $found)) {
$manual_title = $found[1];
} else { $manual_title = "PHP Manual"; }
@@ -66,7 +67,7 @@
fputs ($f, "Title=$manual_title\n");
// define the phpdoc window style (adds more functionality)
- fputs($f, "\n[WINDOWS]\nphpdoc=\"$manual_title\",\"manual_$language.hhc\",," .
+ fputs($f, "\n[WINDOWS]\nphpdoc=\"$manual_title\",\"manual-$language.hhc\",," .
"\"$fancydir\\$indexfile\",\"$fancydir\\$indexfile\",,,,,0x23520,,0x386e,,,,,,,,0\n");
// write out all the filenames as in $fancydir
@@ -85,6 +86,8 @@
function SiteMapObj ($name, $local, $tabs, $imgnum = 'auto') {
global $fancydir;
+ $name = htmlentities($name);
+
echo "\n$tabs<LI> <OBJECT type=\"text/sitemap\">
$tabs <param name=\"Name\" value=\"$name\">
$tabs <param name=\"Local\" value=\"$fancydir\\$local\">";
@@ -141,7 +144,7 @@
<UL>
<?php
- $index_a = file ("$fancydir/manual.html");
+ $index_a = file ("$fancydir/$original_index");
$ijoin = join("", $index_a);
$ijoin = preg_replace("/[\r|\n]/", " ", $ijoin);
@@ -152,7 +155,7 @@
if ($fancyindex) {
preg_match('|CLASS=\"title\" ><A NAME=\"manual\" >(.*)</A|U', $ijoin, $match);
- SiteMapObj($match[1], "manual.html", " ", 21);
+ SiteMapObj($match[1], "$original_index", " ", 21);
}
preg_match('|<A HREF="preface.html" >(.*)</A >|U', $ijoin, $match);
@@ -221,7 +224,7 @@
// grab all the output at this point and
// write out to the proper language .hcc file
$writeout = ob_get_contents();
- $fp = fopen("manual_$language.hhc", "w");
+ $fp = fopen("manual-$language.hhc", "w");
fputs($fp, $writeout);
fclose($fp);
Index: phpdoc/make_chm_fancy.php
diff -u phpdoc/make_chm_fancy.php:1.3 phpdoc/make_chm_fancy.php:1.4
--- phpdoc/make_chm_fancy.php:1.3 Sun Jan 14 09:06:35 2001
+++ phpdoc/make_chm_fancy.php Sat Feb 3 03:04:01 2001
@@ -5,11 +5,13 @@
$htmldir = getenv("PHP_HELP_COMPILE_DIR");
$fancydir = getenv("PHP_HELP_COMPILE_FANCYDIR");
$language = getenv("PHP_HELP_COMPILE_LANG");
+ $original_index = getenv("PHP_HELP_COMPILE_INDEX");
+
$counter = 0;
$handle=opendir($htmldir);
while (false!==($filename = readdir($handle))) {
- if (strpos($filename, ".html") && ($filename != "index.html")) {
+ if (strpos($filename, ".html") && ($filename != "fancy-index.html")) {
fancy_design($filename);
}
}
@@ -18,7 +20,7 @@
// make GENTIME the actual date/time
$content = join("", file("make_chm_index_$language.html"));
$content = preg_replace("/\\[GENTIME\\]/", date("D M d H:i:s Y"), $content);
- $fp = fopen("$fancydir/index.html", "w");
+ $fp = fopen("$fancydir/fancy-index.html", "w");
fputs($fp, $content);
fclose($fp);
@@ -32,7 +34,7 @@
function fancy_design($fname) {
- global $htmldir, $fancydir, $counter;
+ global $htmldir, $fancydir, $counter, $original_index;
// get the contents of the file from $htmldir
$content = join("", file("$htmldir/$fname"));
@@ -63,13 +65,13 @@
// fix copyright page fault...
if ($fname == "copyright.html") {
$content = preg_replace("/&copy;/", "©", $content);
- $content = preg_replace("/<A\\s+HREF=\"manual.html#(authors|translators)\"/U",
"<A HREF=\"index.html\"", $content);
+ $content =
+preg_replace("/<A\\s+HREF=\"$original_index#(authors|translators)\"/U", "<A
+HREF=\"fancy-index.html\"", $content);
$content = preg_replace("|(</TH\\s+></TR\\s+>)|", "\\1<TR><TH COLSPAN=\"3\"
ALIGN=\"center\"> </TH></TR>", $content);
$content = preg_replace("|( </TD\\s+></TR\\s+>)|", "\\1<TR><TD
COLSPAN=\"3\" ALIGN=\"center\"> </TD></TR>", $content);
}
- // fix manual.html to look far better...
- elseif ($fname == "manual.html") {
+ // fix the original manual index to look far better...
+ elseif ($fname == "$original_index") {
$indexchange = '<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%" CELLSPACING="0"
CELLPADDING="0"><TR><TD COLSPAN="3"><DIV CLASS="NAVHEADER"><TABLE BGCOLOR="#CCCCFF"
BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR><TD><TABLE
WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0"><TR><TH COLSPAN="3">PHP
K�zik�nyv</TH></TR><TR><TD COLSPAN="3"
ALIGN="center"> </TD></TR></TABLE></TD></TR><TR BGCOLOR="#333366"><TD><IMG
SRC="spacer.gif" BORDER="0" WIDTH="1" HEIGHT="1"><BR></TD></TR></TABLE>
</DIV></TD></TR><TR><TD><IMG SRC="spacer.gif" WIDTH="10" HEIGHT="1"></TD><TD
HEIGHT="100%" VALIGN="TOP" WIDTH="100%"><BR>';