16

Does anyone have any experience in documenting/structuring angularjs projects so the JSDoc can generate nice comments (for your directives, controllers, filters etc.) in an HTML format? At the moment it generates one file with the _global class that points to the namespace of my app with couple functions and that's it...

Or maybe there is a better way to generate html version of doc blocks in angularjs?

PS: I am using standard jsdoc syntax to document my code (@param, @return etc.)

Update: My specific question is: Is there any way to generate html documentation for angularjs doc blocks to cover all controllers/directives/filters etc.? When ran JSDoc command line utility it covered only about 5% of my code in the HTML report...

Thanks!

4

3 回答 3

33

我一直在研究一个利用 AngularJS 的文档生成代码的 grunt 插件。它遵循它们的语法和输出。咕噜-双目。该链接显示文档源以及原始 AngularJS 源的文档生成。它是可配置和可扩展的。

转到grunt-docular并找到安装链接以获取创建您自己的文档的示例

于 2013-04-23T12:28:15.707 回答
4

EDIT: See John David Five's answer below

My answer was much, much older and should no longer be accepted.

于 2012-10-11T16:21:32.120 回答
1

构建步骤:

文档将在build/docs文件夹中可用。如果你有 PHP 5.5,你可以通过以下方式查看它:

  • 光盘构建
  • php -S 本地主机:8000
  • 在浏览器中查看:http://localhost:8000/docs/index.html
于 2013-11-19T08:00:38.740 回答