cvs: peardoc /scripts make-chm.php

From: Date: Thu, 08 Dec 2005 22:01:25 +0000
Subject: cvs: peardoc /scripts make-chm.php
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-7280@lists.php.net to get a copy of this message
techtonik Thu Dec 8 17:01:25 2005 EDT Modified files: /peardoc/scripts make-chm.php Log: * Coding Standards http://cvs.php.net/diff.php/peardoc/scripts/make-chm.php?r1=1.5&r2=1.6&ty=u Index: peardoc/scripts/make-chm.php diff -u peardoc/scripts/make-chm.php:1.5 peardoc/scripts/make-chm.php:1.6 --- peardoc/scripts/make-chm.php:1.5 Sun Dec 4 15:20:51 2005 +++ peardoc/scripts/make-chm.php Thu Dec 8 17:01:23 2005 @@ -18,7 +18,7 @@ | Mark Wiesemann <wiesemann@php.net> | +----------------------------------------------------------------------+ - $Id: make-chm.php,v 1.5 2005/12/04 20:20:51 wiesemann Exp $ + $Id: make-chm.php,v 1.6 2005/12/08 22:01:23 techtonik Exp $ */ /** @@ -52,8 +52,8 @@ $ind = "$cwd/../html"; // source directory $chmd = "$cwd/../chm"; // path for HH project files (autopurged) -$pref = "pear_manual_$lang"; // for path substitutions -$outd = "$chmd/$pref"; // path for html output +$pref = "pear_manual_$lang"; // name and path substitutions +$outd = "$chmd/$pref"; // path for filtered html output if (!is_dir("$ind") || !file_exists("$ind/index.html")) { die("Error: To build CHM you need compiled PEAR manual in $ind/ directory"); @@ -152,7 +152,7 @@ } $thtmlfiles = glob("$outd/*.html"); -echo "Filtering ...\n"; +echo "Filtering...\n"; $find_rx = array(); $replace = array(); @@ -227,7 +227,7 @@ $sr->setSearchFunction("preg"); $sr->doSearch(); -echo "\nFilter replacements: " . $sr->occurences." ".$sr->last_error; +echo "Filter replacements: " . $sr->occurences." ".$sr->last_error; // pull date, copyright from original index.html $index = file_get_contents("$ind/index.html"); @@ -353,9 +353,9 @@ </html> DOC; -$f = fopen("$outd/index.html", "w"); -fwrite($f, $index_template); -fclose($f); +$fp = fopen("$outd/index.html", "w"); +fwrite($fp, $index_template); +fclose($fp); $languages = array( @@ -373,14 +373,14 @@ $hhp_template = "[OPTIONS] Compatibility=1.1 or later -Compiled file=pear_manual_$lang.chm -Contents file=pear_manual_$lang.hhc +Compiled file=$pref.chm +Contents file=$pref.hhc Default topic=$pref/index.html Language=$language_code Title=PEAR Manual Default Window=Main Full-text search=Yes -Index file=pear_manual_$lang.hhk +Index file=$pref.hhk Enhanced decompilation=Yes [FILES] @@ -392,11 +392,11 @@ $hhp_template .= ' [WINDOWS] -Main="PEAR Manual","pear_manual_'.$lang.'.hhc","pear_manual_'.$lang.'.hhk","'.$pref.'/index.html","'.$pref.'/index.html",,,,,0x61560,220,0x306e,[3,3,664,487],0xb0000,,,,,0, +Main="PEAR Manual","'.$pref.'.hhc","'.$pref.'.hhk","'.$pref.'/index.html","'.$pref.'/index.html",,,,,0x61560,220,0x306e,[3,3,664,487],0xb0000,,,,,0, '; echo " .1. "; -$f = fopen("$chmd/pear_manual_$lang.hhp", "w"); +$f = fopen("$chmd/$pref.hhp", "w"); fwrite($f, $hhp_template); fclose($f); @@ -432,7 +432,7 @@ $toc = preg_replace($search, $replace, $matches[0]); // echo $toc; -$f = fopen("$chmd/pear_manual_$lang.hhc", "w"); +$f = fopen("$chmd/$pref.hhc", "w"); fwrite($f, '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD></HEAD> @@ -448,6 +448,8 @@ fclose($f); +echo "\nWriting CHM Index..."; + // Build HHK $hhkvalues = array(); @@ -471,7 +473,7 @@ } array_multisort($hhkvalues[1], SORT_ASC, $hhkvalues[0]); -$fhk = fopen("$chmd/pear_manual_$lang.hhk", "w"); +$fhk = fopen("$chmd/$pref.hhk", "w"); fwrite($fhk, '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD></HEAD> @@ -500,4 +502,3 @@ echo "\nNow you can follow into \"$chmd\" directory and launch MS HTMLHELP compiler to build CHM"; echo "\n\n HHC.EXE $pref.hhp\n"; -?>

« previous php.pear.doc (#7280) next »