When I trying to make chm manual, I do 'make html', then copy 'html' tree to
Windows and do 'make_chm.bat'. But I found in the file 'php_manual_en.hhk'
and 'php_manual_en.hhc' it generated line 19 is:
<param name="Name" value="</A >PHP Manual</H1 > ... Copyright">
There are actually 718 characters in the 'value' field. It should be 'Table
of Contents'.
Then I found in phpdoc/chm/make_chm.php line 87 - 91 are:
87: preg_match('|CLASS=\"title\" ><A NAME=\"manual\" >(.+)</A|U',
$indexline, $match);
88: if (empty($match[1])) { // Fallback
89: $match[1] = "Table of Contents";
90: }
91: mapAndIndex($match[1], $INDEX_IN_HTML, " ", $toc, $index, 21);
These lines are to process 'html\index.html' file. But in 'index.html' file
from line 27 to 33 are:
><H1
CLASS="title"
><A
NAME="manual"
></A
>PHP Manual</H1
(The LF will be replaced with a SPACE character before preg_match and will
be contained in $indexline.)
Because in preg_match it use (.+) as the pattern, so the $match[1] will
never be empty, it will match to the next '</A' pattern. And this is that
718 characters string above.
In this case, running 'make_chm.bat' can still generate a
'php_manual_en.chm' file with a warning from hhc.exe, but the title of the
second item on the left side bar will be 'undefined'.
I found replace the (.+) parrern with (.*) could address this issue. But
the magic thing is in 'php_manual_en.chm' file from php.net, the title of
the second item on the left side bar is 'PHP Manual'. How'd they do that?
Did I make something wrong? I think this will happen when line 27 to 33 of
file 'index.html' are:
><H1
CLASS="title"
><A
NAME="manual"
>PHP Manual</A
></H1
And this is it supposed to be, right?
But why don't they just use "Table of Contents" on line 91 of
'make_chm.php'?
Another problem is how do I use Chinese version of "Table of Contents"
instead of English one?
'make_chm.bat' is not an automatic process for me, I have to do a lot of
manual modify during making CHM manual.
I hope someone will help me with this problem, and translators of other
languages.
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php