PHPDoc documentation generator in or out of Eclipse? [closed]

余生颓废 提交于 2019-12-03 13:29:08

问题


I am developing with Eclipse + PDT. I've been adding phpdoc comments into my code, but actually never generated a resulting documentation in Eclipse. How should I do it - is there some functionality in Eclipse, or doc generation should be done externally?


回答1:


To generate the documentation, you should use phpDocumentor, which can be installed as a PEAR package.

Then, you have to call it from command-line ; I've never seen it called from Eclipse PDT, actually.

A great solution is to have a continuous-integration platform (using phpUnderControl, for instance), and integrate to creation of the phpdoc in your build configuration file ; this way, the phpdoc is generated everytime someone commits (or once a day, or whenever you want ^^ ).

In Eclipse PDT, you can call "external tools" (see "Run > External Tools" in the menu) ; this would allow you to launch the phpdoc command (like you do from CLI) ; but it definitly is not as user-friendly as what Zend Studio offers -- not the same price either, though ^^




回答2:


Another great tool to generate documentation is ApiGen. It doesn't need installation with PEAR (but includes it) and it can be used like a standalone package.




回答3:


Yes there is a wizard to do this in Zend. Check out this brief guide.

Alternatively you can create an external launch configuration to invoke the standard phpDocumentor.

  1. Select Run->External Tools->External Tools Configurations...
  2. In the left hand pane, select Program then the new icon (left-most icon above the pane).
  3. In the right hand pane, select the Main tab.
  4. Enter generate_doc in the Name: field.
  5. Enter the path to the phpdoc cli tool in the Location: field.
  6. Enter any required arguments in the Arguments field, e.g. for the current project input ${project_loc}.
  7. To run the external configuration, select Run.

To rerun the configuration you have a few choices:

  1. Select the External Tools icon from the menu bar external tools icon http://help.eclipse.org/ganymede/topic/org.eclipse.cdt.doc.user/images/icon%5Fext%5Ftools.png" then click generate_doc
  2. Select Run->External Tools->generate_doc
  3. Hit Alt+R, E, 1 (assuming generate_doc is the first item in the list, otherwise pick the appropriate number)


来源:https://stackoverflow.com/questions/1184627/phpdoc-documentation-generator-in-or-out-of-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!