diff --git a/.gitattributes b/.gitattributes index e8a29fc0..0a4d0346 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ * text=auto !eol +docs/chm/make_chm_spc.gif -text docs/fop/thryb.ttf -text docs/fop/thrybi.ttf -text docs/fop/thryi.ttf -text diff --git a/.gitignore b/.gitignore index abc9f38a..8ebfb9f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ docs/*.cache docs/*.fot docs/Makefile +docs/chm/*.chm +docs/chm/*.hh? +docs/chm/fancy docs/config.* docs/configure docs/diff diff --git a/docs/Makefile.in b/docs/Makefile.in index e779b4f0..361f70c7 100755 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -53,6 +53,9 @@ web: FORCE pdf: FORCE ${FOP} -xml manual.xml -xsl xsl/fo.xsl -pdf manual.pdf +chm: html + chm/make_chm.bat $(LANG) + test: $(NSGMLS) -i lang-$(LANG) -s $(XMLDCL) manual.xml diff --git a/docs/README b/docs/README index f4f8dea7..3ef10004 100644 --- a/docs/README +++ b/docs/README @@ -26,9 +26,18 @@ In order to generate PDF files you need some tools: To generate the file, just type 'make pdf' +Generate CHM files +================== +In order to generate CHM files you need the Microsoft(r) HTML Help Workshop, +which can be freely downloaded at +http://msdn.microsoft.com/library/en-us/htmlhelp/html/vsconhh1start.asp + +Then type 'make chm'. This will run the 'make html' and then build the chm file. + + Revision Tracking (for translations): * make revcheck (this will create revcheck.html) You should have libxml and autoconf installed in your system. -Read http://php.net/manual/howto/chapter-tools.html for more info. +Read http://doc.php.net/php/dochowto/chapter-tools.php for more info. diff --git a/docs/chm/.cvsignore b/docs/chm/.cvsignore new file mode 100755 index 00000000..6d21d95f --- /dev/null +++ b/docs/chm/.cvsignore @@ -0,0 +1,3 @@ +*.chm +*.hh? +fancy diff --git a/docs/chm/README b/docs/chm/README new file mode 100755 index 00000000..64f14350 --- /dev/null +++ b/docs/chm/README @@ -0,0 +1,97 @@ +**************************************************************** +** This is a modified version of phpdoc/chm ** +**************************************************************** + +BUILDING THE MANUAL IN WINDOWS HELP FILE (.CHM) FORMAT + +Note: Where 'lang' is mentioned in this doc, it is the actual +language code (e.g. en) of the manual you are compiling, +not the 'lang' word itself! + +With the herein described tools you're able to build the .chm manual +with two options: + + a) Simply build the traditional html manual + b) Make a fancy version of the html manual and build it + +======================================================================= +WHAT YOU NEED + +* Microsoft(r) HTML Help Workshop. + You can download it freely at: + http://msdn.microsoft.com/library/en-us/htmlhelp/html/vsconhh1start.asp + You need the complete workshop package install (about 4 Megs). + Of course you need Microsoft(r) Windows to run that software :) + +* The html manual (build with 'make') + +The .chm manual generator files (from cvs.php.net): + + make_chm.bat - The only file you need to run yourself. + make_chm.php - Auto toc generator. + + To make the fancy manual, additional files are needed: + + make_chm_fancy.php - Converts the normal html files to fancy + (good looking) pages + make_chm_index_lang.html - Fancy index. (you find it in phpdoc/lang + dir, if it exists for that language). + make_chm_spc.gif - GIF file needed by the fancy pages. + make_chm_style.css - This adds some good style to html files. + +======================================================================= +INSTALLATION + +Install Microsoft(r) HTML Help Workshop. + +Put the above listed make_chm_* files to one directory. + +Open make_chm.bat in a text editor and set the appropriate +environment variables. You need to + + - set PHP_PATH to the full path of the CGI php.exe on + your machine (including php.exe). + - set PHP_HELP_COMPILER to the full path of hhc.exe on + your machine (including hhc.exe). + - set PHP_HELP_COMPILE_LANG to the language code of the + actual manual (use the code from cvs.php.net, eg. hu) + - set PHP_HELP_COMPILE_DIR to the directory of the + html manual (eg. ..\html when you build it like mentioned in the howto) + - set PHP_HELP_COMPILE_INDEX to the index filename in + the directory you set above. This used to be manual.html + for a long time, but it seems it is now index.html. + + The following variable is only needed for the fancy manual: + + - set PHP_HELP_COMPILE_FANCYDIR to the directory name where + the fancy pages will go. + You can decide not to sacrifice any more space for the fancy dir + (it takes ~25% more space than the normal html-manual), and set + this variable to the same as PHP_HELP_COMPILE_DIR. Then your old + HTML files will be rewritten to be fancy ones. + +======================================================================= +BUILDING THE MANUAL: + +Put the html manual (~2100 files) under the subdir specified above in +PHP_HELP_COMPILE_DIR (eg. html). + +To compile the NORMAL manual, use the 'normal' command line option: + + make_chm normal + +To compile the FANCY manual, just run: + + make_chm + +After this process, you will have smarty_manual_lang.chm... + +======================================================================= +The fancy design improvemenets and the .css file is based on +the newsite design(TM) work of Colin Viebrock [colin@easyDNS.com] :) + +Written by Gabor Hojtsy (goba@php.net), and adapted by +Thomas Schoefbeck (tom@php.net). Contact them or the phpdoc list +(phpdoc@lists.php.net) if you have any questions or suggestions... + +Last modified $Date$ \ No newline at end of file diff --git a/docs/chm/chm_settings.php b/docs/chm/chm_settings.php new file mode 100755 index 00000000..0214f7a4 --- /dev/null +++ b/docs/chm/chm_settings.php @@ -0,0 +1,157 @@ + HTML Help Code conversion +// Code list: http://www.helpware.net/htmlhelp/hh_info.htm +// Charset list: http://www.microsoft.com/globaldev/nlsweb/default.asp +// Language code: http://www.unicode.org/unicode/onlinedat/languages.html +// MIME preferred charset list: http://www.iana.org/assignments/character-sets +// Font list: http://www.microsoft.com/office/ork/xp/three/inte03.htm + +$LANGUAGES = array( + "hk" => array( + "langcode" => "0xc04 Hong Kong Cantonese", + "preferred_charset" => "CP950", + "mime_charset_name" => "Big5", + "preferred_font" => "MingLiu,10,0" + ), + "tw" => array( + "langcode" => "0x404 Traditional Chinese", + "preferred_charset" => "CP950", + "mime_charset_name" => "Big5", + "preferred_font" => "MingLiu,10,0" + ), + "cs" => array( + "langcode" => "0x405 Czech", + "preferred_charset" => "Windows-1250", + "mime_charset_name" => "Windows-1250", + "preferred_font" => $DEFAULT_FONT, + ), + "da" => array( + "langcode" => "0x406 Danish", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT, + ), + "de" => array( + "langcode" => "0x407 German (Germany)", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT, + ), + "el" => array( + "langcode" => "0x408 Greek", + "preferred_charset" => "Windows-1253", + "mime_charset_name" => "Windows-1253", + "preferred_font" => $DEFAULT_FONT + ), + "en" => array( + "langcode" => "0x809 English (United Kingdom)", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT + ), + "es" => array( + "langcode" => "0xc0a Spanish (International Sort)", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT + ), + "fr" => array( + "langcode" => "0x40c French (France)", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT + ), + "fi" => array( + "langcode" => "0x40b Finnish", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT + ), + "he" => array( + "langcode" => "0x40d Hebrew", + "preferred_charset" => "Windows-1255", + "mime_charset_name" => "Windows-1255", + "preferred_font" => $DEFAULT_FONT + ), + "hu" => array( + "langcode" => "0x40e Hungarian", + "preferred_charset" => "Windows-1250", + "mime_charset_name" => "Windows-1250", + "preferred_font" => $DEFAULT_FONT + ), + "it" => array( + "langcode" => "0x410 Italian (Italy)", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT + ), + "ja" => array( + "langcode" => "0x411 Japanese", + "preferred_charset" => "CP932", + "mime_charset_name" => "csWindows31J", + "preferred_font" => "MS PGothic,10,0" + ), + "kr" => array( + "langcode" => "0x412 Korean", + "preferred_charset" => "CP949", + "mime_charset_name" => "EUC-KR", + "preferred_font" => "Gulim,10,0" + ), + "nl" => array( + "langcode" => "0x413 Dutch (Netherlands)", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT + ), + "pl" => array( + "langcode" => "0x415 Polish", + "preferred_charset" => "Windows-1250", + "mime_charset_name" => "Windows-1250", + "preferred_font" => $DEFAULT_FONT + ), + "pt_BR" => array( + "langcode" => "0x416 Portuguese (Brazil)", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT + ), + "ro" => array( + "langcode" => "0x418 Romanian", + "preferred_charset" => "Windows-1250", + "mime_charset_name" => "Windows-1250", + "preferred_font" => $DEFAULT_FONT + ), + "ru" => array( + "langcode" => "0x419 Russian", + "preferred_charset" => "Windows-1251", + "mime_charset_name" => "Windows-1251", + "preferred_font" => $DEFAULT_FONT + ), + "sk" => array( + "langcode" => "0x41b Slovak", + "preferred_charset" => "Windows-1250", + "mime_charset_name" => "Windows-1250", + "preferred_font" => $DEFAULT_FONT + ), + "sl" => array( + "langcode" => "0x424 Slovenian", + "preferred_charset" => "Windows-1250", + "mime_charset_name" => "Windows-1250", + "preferred_font" => $DEFAULT_FONT + ), + "sv" => array( + "langcode" => "0x41d Swedish", + "preferred_charset" => "Windows-1252", + "mime_charset_name" => "Windows-1252", + "preferred_font" => $DEFAULT_FONT + ), + "zh" => array( + "langcode" => "0x804 Simplified Chinese", + "preferred_charset" => "CP936", + "mime_charset_name" => "gb2312", + "preferred_font" => "simsun,10,0" + ) +); +?> diff --git a/docs/chm/common.php b/docs/chm/common.php new file mode 100755 index 00000000..2f0151f6 --- /dev/null +++ b/docs/chm/common.php @@ -0,0 +1,75 @@ +|[^a-zA-Z1-9][^>]*>)/Ue", "preg_replace('/[\r\n]{1,2}/U', ' ', \"<\$1 \$2\")", file_get_contents($filename)); + } else { + $buf = preg_replace("/[\r|\n]{1,2}/U", " ", file_get_contents($filename)); + } + $charset = detectDocumentCharset($buf); + + if ($charset === false) $charset = "UTF-8"; + + if ($charset != $INTERNAL_CHARSET) { + if (function_exists("iconv")) { + $buf = iconv($charset, $INTERNAL_CHARSET, $buf); + } elseif (function_exists("mb_convert_encoding")) { + $buf = mb_convert_encoding($buf, $INTERNAL_CHARSET, $charset); + } elseif (preg_match("/^UTF-?8$/i", $INTERNAL_CHARSET) && preg_match("/^(ISO-8859-1|WINDOWS-1252)$/i", $charset)) { + $buf = utf8_encode($buf); + } else { + die("charset conversion function is not available."); + } + } + return $buf; +} + +function fputs_wrapper($fp, $str) +{ + fputs($fp, convertCharset($str)); +} + +function convertCharset($buf) +{ + global $LANGUAGE, $LANGUAGES, $INTERNAL_CHARSET; + + $charset = $LANGUAGES[$LANGUAGE]['preferred_charset']; + + if ($charset != $INTERNAL_CHARSET) { + if (function_exists("iconv")) { + $buf = iconv($INTERNAL_CHARSET, "$charset//TRANSLIT", $buf); + } elseif (function_exists("mb_convert_encoding")) { + $buf = mb_convert_encoding($buf, $charset, $INTERNAL_CHARSET); + } elseif (preg_match("/^UTF-?8$/i", $INTERNAL_CHARSET) && preg_match("/^(ISO-8859-1|WINDOWS-1252)$/i", $charset)) { + $buf = utf8_decode($buf); + } else { + die("$LANGUAGE locale is not supported."); + } + } + return $buf; +} // oneLiner() function end + +// Returns the name of character set in the given document +function detectDocumentCharset($doc) +{ + if (preg_match("//iU", $doc, $reg)) { + return $reg[1]; + } + return false; +} + +function setDocumentCharset($doc, $charset) +{ + return preg_replace("/()/iU", "\$1$charset\$3", $doc); +} +?> + diff --git a/docs/chm/make_chm.bat b/docs/chm/make_chm.bat new file mode 100755 index 00000000..7ecffa5c --- /dev/null +++ b/docs/chm/make_chm.bat @@ -0,0 +1,57 @@ +@echo off + +rem !! Please read the make_chm.README file for information +rem !! about how to build a "php_manual_lang.chm" file. + +rem Path of the PHP executable +set PHP_PATH=php + +rem Path of the Help Compiler command line tool +set PHP_HELP_COMPILER=C:\progra~1\htmlhe~1\hhc.exe + +rem The language of the manual to compile +set PHP_HELP_COMPILE_LANG=en + +rem The source directory with the original DSSSL made HTML +set PHP_HELP_COMPILE_DIR=html + +rem The directory, where the fancy files need to be copied +set PHP_HELP_COMPILE_FANCYDIR=chm\fancy + +rem ========================================================== +rem !!!!! DO NOT MODIFY ANYTHING BELOW THIS LINE !!!!! +rem ========================================================== + +echo. + +rem set PHP_HELP_COMPILE_LANG=%1 +if "%1" == "" set PHP_HELP_COMPILE_LANG=en + +echo Language choosen: %PHP_HELP_COMPILE_LANG% + +if a%2a == anormala goto skipfancy + +echo Now generating the fancy manual in %PHP_HELP_COMPILE_FANCYDIR% dir... +IF NOT EXIST %PHP_HELP_COMPILE_FANCYDIR%\NUL md %PHP_HELP_COMPILE_FANCYDIR% +%PHP_PATH% chm\make_chm_fancy.php + +goto normal + +:skipfancy +set PHP_HELP_COMPILE_FANCYDIR= +echo Skipping fancy manual generation... + +:normal + +echo Now running the toc and project file generator script... +%PHP_PATH% chm\make_chm.php + +echo Compiling the actual helpfile (smarty_manual_%PHP_HELP_COMPILE_LANG%.chm)... +%PHP_HELP_COMPILER% chm\smarty_manual_%PHP_HELP_COMPILE_LANG%.hhp + +echo. +echo Cleaning up the directory +del chm\smarty_manual_%PHP_HELP_COMPILE_LANG%.hh? + +echo Done! +echo. diff --git a/docs/chm/make_chm.php b/docs/chm/make_chm.php new file mode 100755 index 00000000..14ffe7f6 --- /dev/null +++ b/docs/chm/make_chm.php @@ -0,0 +1,219 @@ + + +
+ + + + + +