Index: phpdoc/make_chm.php diff -u phpdoc/make_chm.php:1.4 phpdoc/make_chm.php:1.5 --- phpdoc/make_chm.php:1.4 Sun Jan 14 05:53:16 2001 +++ phpdoc/make_chm.php Sun Jan 14 09:06:35 2001 @@ -1,126 +1,130 @@ HTML Help Code) - $languages = Array ( - - "de" => "0x407 German (Germany)", - "en" => "0x809 Enlish (United Kingdom)", - "es" => "0xc0a Spanish (International Sort)", - "fr" => "0x40c French (France)", - "hu" => "0x40e Hungarian", - "il" => "0x410 Italian (Italy)", - "kr" => "0x412 Korean", - "nl" => "0x413 Dutch (Netherlands)", - "pt_BR" => "0x416 Portuguese (Brazil)" - - ); - - if (file_exists("$fancydir/index.html")) { - $fancyindex = TRUE; - $indexfile = "index.html"; - } else { $indexfile = "manual.html"; } - - // Start writing the project file - $f = fopen ("manual_$language.hhp", "w"); - fputs ($f, "[OPTIONS]\n"); - fputs ($f, "Auto Index=Yes\n"); - fputs ($f, "Binary TOC=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, "Default Font=Arial,10,0\n"); - fputs ($f, "Default topic=$fancydir\\$indexfile\n"); - fputs ($f, "Display compile progress=Yes\n"); - fputs ($f, "Full-text search=Yes\n"); - fputs ($f, "Index file=index.hhk\n"); - - // get the proper language code from the array - fputs ($f, "Language=" . $languages[$language] . "\n"); - - // 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")); - if (preg_match("|>(.*) -$tabs -$tabs "; - - if ($imgnum != 'auto') { - echo "\n$tabs "; - } - echo "\n$tabs \n"; - - } - - function DoFile ($filename) { - - global $fancydir; - echo "

    "; - $content = file ("$fancydir/$filename"); - for ($i = 0; $i < count ($content); $i++) { - - if (ereg (">([^<]+)/", $content[$i+5], $matches); - } - elseif ($content[$i+2] == $content[$i+4]) { - preg_match ("/>([^<]+)/", $content[$i+7], $matches); - } - else { - preg_match ("/>([^<]+)/", $content[$i+3], $matches); - } - $param["title"] = $matches[1]; - SiteMapObj($param["title"], $param["html"], " "); - } - - } - echo "
\n"; - } + ob_start(); + + $fancydir = getenv("PHP_HELP_COMPILE_FANCYDIR"); + if (empty($fancydir)) { $fancydir = getenv("PHP_HELP_COMPILE_DIR"); } + $language = getenv("PHP_HELP_COMPILE_LANG"); + + MakeProjectFile(); + + function MakeProjectFile () { + + global $fancydir, $language, $manual_title, $fancyindex, $indexfile; + + // define language array (manual code -> HTML Help Code) + // Japanese is not on my list, I don't know why... + $languages = Array ( + + "de" => "0x407 German (Germany)", + "en" => "0x809 Enlish (United Kingdom)", + "es" => "0xc0a Spanish (International Sort)", + "fr" => "0x40c French (France)", + "hu" => "0x40e Hungarian", + "il" => "0x410 Italian (Italy)", + "kr" => "0x412 Korean", + "nl" => "0x413 Dutch (Netherlands)", + "pt_BR" => "0x416 Portuguese (Brazil)" + + ); + + if (file_exists("$fancydir/index.html")) { + $fancyindex = TRUE; + $indexfile = "index.html"; + } else { $indexfile = "manual.html"; } + + // Start writing the project file + $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, "Default Font=Arial,10,0\n"); + fputs ($f, "Default Window=phpdoc\n"); + fputs ($f, "Default topic=$fancydir\\$indexfile\n"); + fputs ($f, "Display compile progress=Yes\n"); + fputs ($f, "Full-text search=Yes\n"); + + // get the proper language code from the array + fputs ($f, "Language=" . $languages[$language] . "\n"); + + // 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")); + if (preg_match("|>(.*) +$tabs +$tabs "; + + if ($imgnum != 'auto') { + echo "\n$tabs "; + } + echo "\n$tabs \n"; + + } + + function DoFile ($filename) { + + global $fancydir; + echo "
    "; + $content = file ("$fancydir/$filename"); + for ($i = 0; $i < count ($content); $i++) { + + if (ereg (">([^<]+)/", $content[$i+5], $matches); + } + elseif ($content[$i+2] == $content[$i+4]) { + preg_match ("/>([^<]+)/", $content[$i+7], $matches); + } + else { + preg_match ("/>([^<]+)/", $content[$i+3], $matches); + } + $param["title"] = $matches[1]; + SiteMapObj($param["title"], $param["html"], " "); + } + + } + echo "
\n"; + } ?> @@ -130,82 +134,81 @@ - - + \n"; - - // link in directly the copyright page - $cjoin = join("", file ("$fancydir/copyright.html")); - $cjoin = preg_replace("/[\r|\n]/", " ", $cjoin); - preg_match('|

(.*)(.*)(.*)|U', $ijoin, $match); + SiteMapObj($match[1], "preface.html", " "); + + echo "\n

    "; + preg_match('|(.*)|U', $ijoin, $match); + SiteMapObj($match[1], "preface.html#about", " "); + echo "
\n"; + + // now autofind the chapters/subchapters + + for ($i = 0; $i < count ($index_a); $i++) { + + /* Chapters */ + if (ereg (">[IVX]+\.\ \n"; } + + //preg_match ("/>([IVX]+)\. ([^<]+)/", $index_a[$i+2], $matches); + $chapter["title"] = $matches[1]; + SiteMapObj($chapter["title"], $chapter["html"], " "); + + } + + /* Sub chapters */ + elseif (ereg (">([0-9]+|[IVXL]+|[A-Z])\.\ \n"; + } + + //preg_match ("/>([0-9]+|[IVXL]+|[A-Z])\. ([^<]+)/", $index_a[$i+2], $matches); + $schapter["title"] = $matches[1]; + SiteMapObj($schapter["title"], $schapter["html"], " "); + + DoFile ($schapter["html"]); + } + } + + echo " \n"; + + // link in directly the copyright page + $cjoin = join("", file ("$fancydir/copyright.html")); + $cjoin = preg_replace("/[\r|\n]/", " ", $cjoin); + preg_match('|

(.*) @@ -213,21 +216,20 @@ + // 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"); + fputs($fp, $writeout); + fclose($fp); + + /* + + Now no index is made, so no need to print out a blank file. + In the future, we should make an index file somehow. + + // make a default index file (no content, no index) + $index_hhk = ' @@ -236,9 +238,11 @@

'; + + $fp = fopen("index.hhk", "w"); + fputs($fp, $index_hhk); + fclose($fp); - $fp = fopen("index.hhk", "w"); - fputs($fp, $index_hhk); - fclose($fp); - + */ + ?> Index: phpdoc/make_chm_fancy.php diff -u phpdoc/make_chm_fancy.php:1.2 phpdoc/make_chm_fancy.php:1.3 --- phpdoc/make_chm_fancy.php:1.2 Sun Jan 14 06:05:35 2001 +++ phpdoc/make_chm_fancy.php Sun Jan 14 09:06:35 2001 @@ -27,7 +27,7 @@ $counter += 3; - echo "Converting ready...\n"; + echo "\nConverting ready...\n"; echo "Total number of files written in $fancydir directory: $counter\n\n"; function fancy_design($fname) { @@ -63,7 +63,7 @@ // fix copyright page fault... if ($fname == "copyright.html") { $content = preg_replace("/&copy;/", "©", $content); - $content = preg_replace("/)|", "\\1 ", $content); $content = preg_replace("|( )|", "\\1 ", $content); }