cvs: peardoc /scripts make-chm.php

From: Date: Sun, 04 Dec 2005 20:20:52 +0000
Subject: cvs: peardoc /scripts make-chm.php
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-7270@lists.php.net to get a copy of this message
wiesemann Sun Dec 4 15:20:52 2005 EDT Modified files: /peardoc/scripts make-chm.php Log: - revert to array usage of File_SearchReplace - added a note about the needed version of F_SR - added the language code to the generated .hhp file (==> no need to start the HTML Help Workshop GUI anymore) http://cvs.php.net/diff.php/peardoc/scripts/make-chm.php?r1=1.4&r2=1.5&ty=u Index: peardoc/scripts/make-chm.php diff -u peardoc/scripts/make-chm.php:1.4 peardoc/scripts/make-chm.php:1.5 --- peardoc/scripts/make-chm.php:1.4 Sun Dec 4 03:59:50 2005 +++ peardoc/scripts/make-chm.php Sun Dec 4 15:20:51 2005 @@ -15,9 +15,10 @@ +----------------------------------------------------------------------+ | Authors: Dieter Raber <d.raber@dwhsoft.de> | | anatoly techtonik <techtonik@php.net> | + | Mark Wiesemann <wiesemann@php.net> | +----------------------------------------------------------------------+ - $Id: make-chm.php,v 1.4 2005/12/04 08:59:50 techtonik Exp $ + $Id: make-chm.php,v 1.5 2005/12/04 20:20:51 wiesemann Exp $ */ /** @@ -37,6 +38,7 @@ * HHC.EXE pear_manual_en.hhp */ +// Note: File_SearchReplace >= 1.1.0 is needed require_once("File/SearchReplace.php"); error_reporting(E_ALL); @@ -150,10 +152,13 @@ } $thtmlfiles = glob("$outd/*.html"); -echo "Filtering (</HEAD) ...\n"; +echo "Filtering ...\n"; -$find_rx = '|</HEAD|ims'; -$replace = +$find_rx = array(); +$replace = array(); + +$find_rx[] = '|</HEAD|ims'; +$replace[] = ' <link rel="stylesheet" type="text/css" href="pear.css" /> <link rel="stylesheet" type="text/css" href="custom.css" /> @@ -161,21 +166,8 @@ </HEAD'; -$sr = &new File_SearchReplace( - $find_rx, - $replace, - $thtmlfiles - ); - -$sr->setSearchFunction("preg"); -$sr->doSearch(); - -echo "\nFilter replacements (</HEAD): " . $sr->occurences." ".$sr->last_error; - -echo "\nFiltering (</BODY) ...\n"; - -$find_rx = '|</BODY|is'; -$replace = ' +$find_rx[] = '|</BODY|is'; +$replace[] = ' <div id="context_menu"> <input type="hidden" id="tmpText"> <div id="context_pear"> @@ -235,7 +227,7 @@ $sr->setSearchFunction("preg"); $sr->doSearch(); -echo "\nFilter replacements (</BODY): " . $sr->occurences." ".$sr->last_error; +echo "\nFilter replacements: " . $sr->occurences." ".$sr->last_error; // pull date, copyright from original index.html $index = file_get_contents("$ind/index.html"); @@ -366,6 +358,17 @@ fclose($f); +$languages = array( + 'de' => '0x407', + 'en' => '0x409', + 'fr' => '0x40c', + 'hu' => '0x40e', + 'ja' => '0x411', + 'nl' => '0x413', + 'pl' => '0x415', + 'ru' => '0x419' +); +$language_code = $languages[$lang]; $hhp_template = "[OPTIONS] @@ -373,6 +376,7 @@ Compiled file=pear_manual_$lang.chm Contents file=pear_manual_$lang.hhc Default topic=$pref/index.html +Language=$language_code Title=PEAR Manual Default Window=Main Full-text search=Yes

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