|
| 1 | +# Read Me |
| 2 | + |
| 3 | +## Read this first |
| 4 | + |
| 5 | +This directory contains source files and a setup for converting |
| 6 | +PHP's XML documentation into presentation formats like HTML and |
| 7 | +RTF. You should not have to bother with this unless you are |
| 8 | +writing documentation yourself, or if you simply are curious |
| 9 | +about how the XML stuff works. |
| 10 | + |
| 11 | +If you just want to read the documentation, look at: http://www.php.net/docs.php |
| 12 | + |
| 13 | +## How to write PHPDoc files |
| 14 | + |
| 15 | +If you are interested in information about how to |
| 16 | +set up the tools needed, how to work with Git and |
| 17 | +DocBook on Linux or Windows, or what conventions you |
| 18 | +should follow when writing phpdoc files, please refer |
| 19 | +to the PHP Documentation HOWTO. |
| 20 | + |
| 21 | +You can read the HOWTO online at http://doc.php.net/tutorial/ |
| 22 | + |
| 23 | +If you are already working with the phpdoc module, |
| 24 | +then you can find its XML source in the howto directory |
| 25 | +of the module, and build it yourself with: |
| 26 | + |
| 27 | +```bash |
| 28 | +phd -d .manual.xml |
| 29 | +``` |
| 30 | + |
| 31 | +However, PhD is a separate project which can be read about here: http://wiki.php.net/doc/phd |
| 32 | + |
| 33 | +## Quick Reference |
| 34 | + |
| 35 | +### Source checkout |
| 36 | + |
| 37 | +a. Fork the repository of the language you want to contribute to on [GitHub](https://github.com/phpdoctest) |
| 38 | +b. Check out the source |
| 39 | + |
| 40 | +```bash |
| 41 | +git checkout git://github.com:[your github-username]/[language you want to contribute to].git |
| 42 | +git remote add upstream https://github.com/phpdoctest/[language you want to contribute to].git |
| 43 | +``` |
| 44 | + |
| 45 | +c. Check out the doc-base repository with the different tools |
| 46 | + |
| 47 | +```bash |
| 48 | +git checkout https://github.com/phpdoctest/doc-base.git |
| 49 | +``` |
| 50 | + |
| 51 | +That will leave you with a folder ```[language you want to contribute to]``` |
| 52 | +which contains the source-files for the documentation and a folder ```doc-base``` |
| 53 | +that contains the different tools and resources used in all languages. |
| 54 | + |
| 55 | +### Edits |
| 56 | + |
| 57 | +a. Bring everything up to date and create a new branch |
| 58 | + |
| 59 | +``` |
| 60 | +cd [language you want to contribute to] |
| 61 | +git fetch upstream |
| 62 | +git checkout -b [branchname] upstream/master |
| 63 | +``` |
| 64 | + |
| 65 | +b. Make the change. Use spaces not tabs. Be sure to carefully watch your whitespace! |
| 66 | +c. Look at your unified diff, make sure it looks right and that whitespace changes aren't mixed in: |
| 67 | + |
| 68 | +```bash |
| 69 | +git diff path/to/file.xml |
| 70 | +``` |
| 71 | + |
| 72 | +d. Make sure no errors are present, so at the command line in your phpdoc source directory run: |
| 73 | + |
| 74 | +```bash |
| 75 | +cd .. |
| 76 | +php doc-base/configure.php |
| 77 | +``` |
| 78 | + |
| 79 | + Always ```php configure.php``` before commit! |
| 80 | + |
| 81 | +e. Commit your changes |
| 82 | + |
| 83 | +``` |
| 84 | +git add path/to/file.xml |
| 85 | +git commit |
| 86 | +git push origin branchname |
| 87 | +``` |
| 88 | + |
| 89 | +f. Open a PullRequest on GitHub for your changes to be merged directly into the main repository. |
| 90 | + |
| 91 | + |
| 92 | +Read the HOWTO for more information. After reading the HOWTO, email the phpdoc |
| 93 | +mailing list (phpdoc@lists.php.net) with questions and concerns. |
| 94 | + |
| 95 | +### new functions |
| 96 | + |
| 97 | + a) Copy an existing xml file or use a skeleton from the HOWTO. |
| 98 | + Rename and place it into the appropriate directory. |
| 99 | + |
| 100 | + b) Edit. Be sure no leftover text exists. No tabs either. |
| 101 | + |
| 102 | + c) Now test locally before commit by first running |
| 103 | + (php configure.php) |
| 104 | + |
| 105 | + d) git add add path/to/yourfile.xml |
| 106 | + |
| 107 | + e) git commit |
| 108 | + |
| 109 | + Note that the version numbers are taken care of elsewhere (don't worry |
| 110 | + about them) |
| 111 | + |
| 112 | +### some popular tags and entities |
| 113 | + |
| 114 | + <filename> filenames |
| 115 | + <constant> constants |
| 116 | + <varname> variables |
| 117 | + <parameter> a function's parameter/argument |
| 118 | + <function> functions, this links to function pages or bolds if |
| 119 | + already on the function's page. it also adds (). |
| 120 | + |
| 121 | + <literal> teletype/mono-space font <tt> |
| 122 | + <emphasis> italics |
| 123 | + <example> see HOWTO, includes many other tags. |
| 124 | + <link> internal manual links |
| 125 | + <link linkend="language.variables">variables</link> |
| 126 | + |
| 127 | + <link> external links via global.ent |
| 128 | + <link xlink:href="&spec.cookies;">mmm cookies</link> |
| 129 | + |
| 130 | + <type> types, this links to the given types manual |
| 131 | + page: <type>object</type> -> php.net/types.object |
| 132 | + |
| 133 | + |
| 134 | + &return.success; see: language-snippets.ent |
| 135 | + &true; <constant>TRUE</constant> |
| 136 | + &false; <constant>FALSE</constant> |
| 137 | + &php.ini; <filename>php.ini</filename> |
| 138 | + |
| 139 | + Be sure to check out globals.ent and language-snippets.ent for |
| 140 | + more information for entities and urls. |
| 141 | + |
| 142 | +--------------------------------------------------------------------------- |
0 commit comments