Using Phpdoc/phpdocumentor to generate API documentation

Source: Internet
Author: User

Phpdocumentor is a very powerful document auto-generation tool that helps us write specification annotations, generate easy-to-understand, well-structured documents, and can help with our code upgrades, maintenance, handover, and more. The online document about Phpdoc, though a lot, but a bit of trouble:1, the Internet is usually introduced too much content, not easy to be read by novice. Personally, the tutorial should be simple and easy to understand, in the premise of solving the problem, how simple it can be. More content, should be in the form of an appendix, or leave other more detailed information links for readers to read (instead of a large chunk are copied into their own article) 2, Phpdoc installation a little trouble. They did not introduce a simple and easy way to the reader 3, phpdoc the default encoding is ISO-8859-1, the resulting HTML document will be garbled in Chinese. Although there are solutions available online – Why not just provide a version that supports Chinese? Based on the above, I would like to write a blog post, to share with you a simple way to use Phpdoc (in Windows) before using Phpdoc, you first need to understand the code comment syntax rules (if you already understand, please ignore).refer to the University of WikipediaHttp://zh.wikipedia.org/wiki/PHPDocthe Description section of the comment format. Next, you can download this optimized version of Phpdoc:Http://star7th-wordpress.stor.sinaapp.com/uploads/2013/04/phpdoc.zipAfter downloading, decompression, for example, to "D:/phpdoc" path. Open Phpdoc.bat with a text editor (note, not double-click Run), line 16th: SET phpcli=d:\program files\php5.3.11\ Php.exe change the path of the PHP.exe here to the path where your computer's PHP environment executes the file. (If you are phper, I believe you have installed a PHP environment in this machine.) Then, open a command prompt. (Start-run-cmd), on the command line, enter the directory where Phpdoc is located, (for example, enter "CD D:/phpdoc"). After entering the directory, enter the following command to quickly generate the HTML document: phpdoc-d D:\website\Api-t D:\website\Api\doc-dn shilianwang-dc shilianwang-ti IoT document-O-HTM l:smarty:php the above command, D:\WEBSITE\API is the directory where the source PHP file resides. D:\website\Api\doc is the generated document storage directory. Shilianwang is a subdirectory, package, title. HTML:Smarty:PHP means using HTML modules to generate the above commands, and if you want to learn more about them, you can enter phpdoc-h at the command line to learn more. Finally, there are three types: annotation style:

This comment generates:



Phpdocumentor Manuals-Installation and label use

Thank you for your attention websites blog!

Using Phpdoc/phpdocumentor to generate API documentation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.