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 17:53] – reorganized adding new docs, mentioned doc gen, added section for editing old docs, other misc. philip | doc:scratchpad:howto [2009/08/04 11:30] – Fix CVS mentions mrook | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Quick guide for improving the existing PHP documentation ===== | ===== Quick guide for improving the existing PHP documentation ===== | ||
- | + | ==== Getting setup ==== | |
- | === Getting setup === | + | |
What you need is: | What you need is: | ||
- | * Source files of the PHP Manual, which is 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 | + | == Source files of the PHP Manual == |
+ | They are stored in a SVN module named ' | ||
+ | < | ||
+ | $ svn checkout http:// | ||
+ | </ | ||
+ | |||
+ | == Using TortoiseSVN on Windows to do a checkout == | ||
+ | * First off, download and install TortoiseSVN from its website: [[http:// | ||
+ | * Open a new explorer window and go to the folder you wish to do a checkout in | ||
+ | * Right click anywhere in the blank area to spawn the context menu, select "SVN Checkout..." | ||
+ | * A new window will popup asking for details about the checkout, these values will be remembered, so you will not need to enter them again | ||
+ | * Enter the following URL: " | ||
+ | * When the checkout is complete, then it should have created a directory called " | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | == The build system == | ||
+ | This renders the DocBook XML into other formats, like the HTML you see at php.net. It's named [[doc: | ||
+ | |||
+ | < | ||
+ | $ pear channel-discover doc.php.net | ||
+ | $ pear install doc.php.net/ | ||
+ | </ | ||
+ | |||
+ | == A text editor == | ||
+ | Any will do | ||
+ | |||
+ | == Knowledge == | ||
+ | * PHP | ||
+ | * The [[http:// | ||
+ | |||
+ | == Everything working == | ||
+ | Before you get started documenting, make sure the tool chain and checkout | ||
< | < | ||
- | | + | $ phd -V (check to see if phd is installed, and in the path) |
- | $ cd phpdoc (make the manual sources your current directory) | + | $ cd phpdoc (make the manual sources your current directory) |
- | $ php configure.php -V (check to see if this works) | + | $ 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) | + | $ 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 few thousand files) | + | $ phd -d .manual.xml -f xhtml -t chunkedhtml (Creates an html/ folder |
</ | </ | ||
Poke around the **html/** directory and open up some of the files in you favorite browser to see if everything is fine. | 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 === | + | ==== Knowing the structure |
The documentation for extensions is located in: | The documentation for extensions is located in: | ||
Line 35: | Line 60: | ||
There you'll find several files: | There you'll find several files: | ||
- | * // | + | * // |
* // | * // | ||
* // | * // | ||
* // | * // | ||
+ | * // | ||
+ | * //foo.xml// (Example, foo can be anything specific to a topic. Just be sure to include via // | ||
- | For procedural extension (like SVN) you also have: | + | A procedural extension (like SVN) also has: |
* // | * // | ||
* // | * // | ||
- | For OO extensions (such as imagick) | + | And OO extensions (such as imagick) |
* // | * // | ||
Line 51: | Line 78: | ||
* Note: "// | * Note: "// | ||
- | + | ==== Editing existing documentation | |
- | === Editing existing documentation === | + | |
Simply open the files and edit them. Remember to follow the " | Simply open the files and edit them. Remember to follow the " | ||
< | < | ||
- | $ vim phpdoc/ | + | $ vim phpdoc/en/trunk/ |
$ php configure.php | $ php configure.php | ||
- | $ cvs commit phpdoc/ | + | $ svn commit |
</ | </ | ||
- | === Adding new documentation === | + | ==== Adding new documentation |
When adding new functions or methods, there are a couple of options. Either way, the generated (or copied) files will need to be filled out. | When adding new functions or methods, there are a couple of options. Either way, the generated (or copied) files will need to be filled out. | ||
Line 79: | Line 105: | ||
The docgen script is found within the php documentation (phpdoc/ | The docgen script is found within the php documentation (phpdoc/ | ||
- | === Testing the changes === | + | ==== Testing the changes |
Methods and functions are automagically included into the hierarchy so you don't have to " | Methods and functions are automagically included into the hierarchy so you don't have to " | ||
- | Now its time to check the rendering: | + | < |
+ | $ cd phpdoc | ||
+ | $ php configure.php | ||
+ | </ | ||
+ | |||
+ | When the above outputs something like "All good. Saving .manual.xml... done." then you know it validates. | ||
< | < | ||
- | | + | $ phd -d .manual.xml -f xhtml -t chunkedhtml |
</ | </ | ||
Line 93: | Line 124: | ||
If everything is looking good, its time to post the changes. | If everything is looking good, its time to post the changes. | ||
- | === Committing the changes === | + | ==== Committing the changes |
== Creating patches == | == Creating patches == | ||
Line 103: | Line 134: | ||
</ | </ | ||
- | 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). | + | 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). On Windows you may use an external utility to create an archive such as [[http:// |
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. | 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. | ||
Line 112: | Line 143: | ||
If you have CVS karma then there is no need to create patches... just commit! | 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