doc:scratchpad:howto
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:scratchpad:howto [2008/12/09 18:05] – minor rewording, added 'validation' example philip | doc:scratchpad:howto [2011/04/06 10:59] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Quick guide for improving the existing PHP documentation ===== | + | This page has been removed, in favor of: [[doc/howto]] |
- | + | ||
- | === Getting setup === | + | |
- | + | ||
- | What you need is: | + | |
- | * Source files of the PHP Manual, which are stored in a CVS module named ' | + | |
- | < | + | |
- | * The build system, and it's named [[doc: | + | |
- | < | + | |
- | $ pear install doc.php.net/ | + | |
- | * A text editor (any will do) | + | |
- | * Knowledge of the [[http:// | + | |
- | + | ||
- | Before you get started documenting, | + | |
- | < | + | |
- | $ phd -V (check to see if phd is installed, and in the path) | + | |
- | $ cd phpdoc (make the manual sources your current directory) | + | |
- | $ php configure.php -V (check to see if this works) | + | |
- | $ php configure.php (This will create a huge .manual.xml file which PhD uses to render the docs) | + | |
- | $ phd -d .manual.xml -f xhtml -t chunkedhtml (Creates an html/ folder with a few thousand files) | + | |
- | </ | + | |
- | + | ||
- | Poke around the **html/** directory and open up some of the files in you favorite browser to see if everything is fine. | + | |
- | + | ||
- | === Knowing the structure === | + | |
- | + | ||
- | The documentation for extensions is located in: | + | |
- | + | ||
- | / | + | |
- | + | ||
- | For example, the SVN extension documentation exists in: | + | |
- | + | ||
- | / | + | |
- | + | ||
- | There you'll find several files: | + | |
- | + | ||
- | * // | + | |
- | * // | + | |
- | * // | + | |
- | * // | + | |
- | + | ||
- | A procedural extension (like SVN) also has: | + | |
- | + | ||
- | * // | + | |
- | * // | + | |
- | + | ||
- | And OO extensions (such as imagick) contain: | + | |
- | + | ||
- | * // | + | |
- | * // | + | |
- | + | ||
- | * Note: "// | + | |
- | + | ||
- | === Editing existing documentation === | + | |
- | Simply open the files and edit them. Remember to follow the " | + | |
- | < | + | |
- | $ vim phpdoc/ | + | |
- | $ php configure.php | + | |
- | $ cvs commit phpdoc/ | + | |
- | </ | + | |
- | + | ||
- | === Adding new documentation === | + | |
- | + | ||
- | When adding new functions or methods, there are a couple | + | |
- | + | ||
- | == Option A: Copy skeleton files == | + | |
- | This involves copying the skeleton files into the correct location: | + | |
- | + | ||
- | < | + | |
- | cp / | + | |
- | cp / | + | |
- | </ | + | |
- | + | ||
- | * Note: " | + | |
- | * Note: " | + | |
- | * Note: " | + | |
- | + | ||
- | == Option B: Generating files using docgen == | + | |
- | The docgen script is found within the php documentation (phpdoc/ | + | |
- | + | ||
- | === Testing the changes === | + | |
- | + | ||
- | Methods and functions are automagically included into the hierarchy so you don't have to " | + | |
- | + | ||
- | < | + | |
- | $ php configure.php | + | |
- | </ | + | |
- | + | ||
- | When the above outputs something like "All good. Saving .manual.xml... done." then you know it validates. Now its time to optionally check the rendering: | + | |
- | + | ||
- | < | + | |
- | $ phd -d .manual.xml -f xhtml -t chunkedhtml | + | |
- | </ | + | |
- | + | ||
- | This will create a " | + | |
- | + | ||
- | If everything is looking good, its time to post the changes. | + | |
- | + | ||
- | === Committing the changes === | + | |
- | + | ||
- | == Creating patches == | + | |
- | + | ||
- | If you edited existing documentation you will have to create a patch. The following will iterate recursively over the directory and push all changes into the changes.patch file: | + | |
- | + | ||
- | < | + | |
- | $ cvs diff -u > changes.patch | + | |
- | </ | + | |
- | + | ||
- | If you added new files you will have to create an archive of the new files you added (tar -cf changes.tar file1.xml file2.xml file3.xml). | + | |
- | + | ||
- | Then upload the archive (or patch file) to http somewhere and post the link to phpdoc@lists.php.net including a short summary of what you did. | + | |
- | + | ||
- | And later committing them yourself | + | |
- | + | ||
- | == Committing patches == | + | |
- | + | ||
- | If you have CVS karma then there is no need to create patches... just commit! | + | |
- | + |
doc/scratchpad/howto.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1