ExtendedCHMPHP syntax manual DIY. ExtendedCHMPHP syntax manual DIY1.ExtendedCHM features customizable right-click menu php code block to highlight functions in the php code block with corresponding function manual chain Extended chm php syntax manual DIY
1. main features of Extended CHM
Customizable right-click menu
Php code block highlighted with syntax
The function in the php code block carries the corresponding function manual link.
Clearer manual interface
You can customize the appearance style of the manual.
Supports skin replacement
More detailed manual content
With very practical user notes
Can be integrated into most ide and editor
For more information, visit
<
2. why DIY?
Somehow, such a good stuff has not been updated on the official php website for a long time (the latest official
Version 2003.9.6). especially after php5 is released, many contents cannot be found.
In this way, we can only carry forward the DIY spirit and make our own. ^_^
3. prerequisites
Use of the cvs client.
Basic operations in linux and software compilation and installation.
4. Software Requirements
Cvs client software:
We will use the cvs server on the official php website to obtain the latest phpdoc version.
Wincvs Chinese version is recommended in windows
< Ncvs/>
The operating systems in the unix camp generally come with cvs clients,
You can directly type "cvs version" in the command line to check whether cvs is installed,
If not
< Download the latest version
Cvs client
Windows:
Run Microsoft Html Help Workshop on windows to generate a chm file.
You can also run wine in linux to simulate windows
Microsoft Html Help Workshop
Microsoft's tool for generating chm files
< Workshop>
Linux:
We need to compile and install the manual and some necessary software packages here,
You can also use other unix camp systems,
Or simply use cygwin, vmware, and other software to simulate a linux environment in Windows.
PHP4.0 or later:
Php is used to compile and generate chm files. Therefore, you need to compile and generate chm files in windows and linux.
Install php.
Environment used in this article:
Two PCs with redhat 9 and windows 2000 professional
5. start DIY
First
Install OpenJada and OpenSP
Go to the linux console
Code :--------------------------------------------------------------------------------
$ Mkdir/home/phpdoc
$ Cd/home/phpdoc
$ Wget "http://prdownloads.sourceforge.net/openjade/openjade-1.3.2.tar.gz"
$ Wget "http://prdownloads.sourceforge.net/openjade/OpenSP-1.5.1.tar.gz"
$ Tar-zxvf * .tar.gz
$ Openjade-1.3.2 cd
$./Configure
$ Make
$ Make install
$ Cd ../OpenSP-1.5.1
$./Configure
$ Make
$ Make install
$ Cd ../
--------------------------------------------------------------------------------
Then, we will obtain the latest phpdoc version from the official php cvs server.
Code :--------------------------------------------------------------------------------
$ Export CVSROOT =: pserver: cvsread@cvs.php.net:/repository
$ Cvs-z9 checkout phpdoc
$ Cd phpdoc
$ Cvs update-dP-D "December 31,200 2 pm" xsl
$ Cvs up-A xsl/version. xml xsl/docbook/html/chunker. xsl
--------------------------------------------------------------------------------
Set compilation parameters
Code :--------------------------------------------------------------------------------
$ Autoconf
$./Configure -- with-chm = yes -- with-lang = en
--------------------------------------------------------------------------------
In this case, make some minor corrections.
Open/home/phpdoc/xsl/htmlhelp-db.xsl in the editor
Search for "@ DOCBOOKXSL_HTML @" in this file @",
Replace it with "./docbook/html/chunk. xsl" and save the disk and exit
Then open/home/phpdoc/xsl/html-common.xsl
Add the following code to the end of the file:Row above, and save the disk to exit
Code :--------------------------------------------------------------------------------
Select = "'http: // www.w3.org/TR/html4/loose.dtd'"/>
--------------------------------------------------------------------------------
Then proceed with the compilation operation,
Code :--------------------------------------------------------------------------------
$ Make chm_xsl
--------------------------------------------------------------------------------
After compilation, we need to obtain the latest php image site list and user note files.
Code :--------------------------------------------------------------------------------
$ Cd htmlhelp
$ Wget "http://www.php.net/include/mirrors.inc"
$ Wget "http://www.php.net/backend/notes/all.bz2"
$ Bunzip2 all.bz2
Cd ../
--------------------------------------------------------------------------------
You can pack the generated files and upload them to windows.
Code :--------------------------------------------------------------------------------
Tar-czvf phpdoc.tar.gz./htmlhelp
--------------------------------------------------------------------------------
Now, you need to complete the operations on the linux platform.
Now proceed to the windows environment
First, extract the phpdoc.tar.gz
The link to the related functions is incorrect in some files generated after compilation of the obtained version,
Modify the htmlhelp/filter_files.php file.
Add the following code to the header:
PHP code :--------------------------------------------------------------------------------
// Fix functions link error
Function fix_function_link ($ m ){
$ Fname1 = 'function.'.strtolower(str_replace('_', '-', then m?1=}.'.html ';
$ Fname2 = 'function.'.strtolower(str_replace('_', '.', then m?1=}.'.html ';
If (file_exists ("html/". $ fname1 )){
Return'
'. $ M [1].' ()';
} Elseif (file_exists ("html/". $ fname2 )){
Return'
'. $ M [1].' ()';
} Else {
Return'
'. $ M [1].' ()';
}
}
--------------------------------------------------------------------------------
Find the following code in the file:
PHP code :--------------------------------------------------------------------------------
// Read in the contents of the source file
$ Content = join ("", file ("$ HTML_SRC/$ filename "));
--------------------------------------------------------------------------------
Change it
PHP code :--------------------------------------------------------------------------------
// Read in the contents of the source file
$ Content = join ("", file ("$ HTML_SRC/$ filename "));
$ Content = str_replace ("»", "»", $ content );
$ Reg_fix = '/'. preg_quote ('
', "/").' (\ W +) \ (\) '. preg_quote ('', "/").'/Is ';
$ Content = preg_replace_callback ($ reg_fix, 'Fix _ function_link ', $ content );
$ Reg_fix = '/'. preg_quote ('
', "/").' (\ W +) \ (\) '. preg_quote ('', "/").'/Is ';
$ Content = preg_replace_callback ($ reg_fix, 'Fix _ function_link ', $ content );
--------------------------------------------------------------------------------
After saving the disk, rename "htmlhelp \ local_vars.php.src"
"Htmlhelp \ local_vars.php"
Edit "htmlhelp \ local_vars.php ",
Set the $ HELP_WORKSHOP variable value to the installation directory of Html Help Workshop.
Output
Add the directory of php.exe to the path environment variable.
In "Run", type cmd to enter console mode, and enter the release directory of phpdoc.tar.gz.
Code :--------------------------------------------------------------------------------
Cd htmlhelp
Make_chm.bat
--------------------------------------------------------------------------------
After the execution, the Extended CHM php syntax manual is generated.
Stored in the htmlhelp/release Directory
Download again
< > And save it to the Manual directory.
You can right-click the menu in the manual and set the skin.
After setting, double-click php_manual_en.chm to browse the manual. (source: Viphot)
Http://www.bkjia.com/PHPjc/314131.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/314131.htmlTechArticleExtended chm php syntax manual DIY 1. Extended CHM main features can be customized right-click menu php code block to syntax highlight the function in the php code block with the corresponding function manual chain...