jpablobr.com

→ how to build php documentation with phpdocumentor

More on: php, phpdocumentor, Tue Sep 25 00:24:08 -0600 2009

You can build the project documentation using the command-line script phpdoc, or a Web-based interface. To begin, download the latest version of PHPDocumentor from the website, extracting it to a protected area of your web document root. Then navigate to the index.html file located in the PhpDocumentor directory. You'll see several tabs at the top of the interface, including IntroductionConfigFilesOutputOptionsCredit, and Links. Feel free to browse each tab to get an idea of their purpose, however for the purposes of this example you'll need to be concerned with only the Files and Output tabs. Navigate to the Files tab, depicted in Figure 1.

The Files Tab

Figure 1. The Files Tab

Note that you can specify input files in four manner: by file, by directory, files to ignore, and by package. I've added the directory containing the sample1.php and sample2.php files. Next click on the Output tab, depicted in Figure 2.

The Output Tab

Figure 2. The Output Tab

The Targetfield is used to specify the documentation destination directory. The Output type dropdown lists the variety of templates and documentation types available to you. Throughout this tutorial I've used HTML:Smarty:default. Feel free to experiment with other formats. Add a target directory and press the create button located to the lower-right of the window. You can scroll through the output appearing in the lower frame to review PHPDocumentor's actions. Assuming all goes okay, the output will conclude with "Operation Completed". Review your documentation by navigating to the target folder.

blog comments powered by

Disqus