Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

独立的工具函数能生成文档吗? #2

Open
zhiqinyigu opened this issue Mar 6, 2015 · 8 comments
Open

独立的工具函数能生成文档吗? #2

zhiqinyigu opened this issue Mar 6, 2015 · 8 comments

Comments

@zhiqinyigu
Copy link

比如下列代码:
funtion getAjax(){
$.ajax();
}

怎么为getAjax写注释文档。

@zhh77
Copy link
Owner

zhh77 commented Mar 8, 2015

注释要首先定义module,然后才是class,最后才是method。getAjax根据method的来定义就好了,你可以看下例子中,具体的写法

@zhh77
Copy link
Owner

zhh77 commented Mar 8, 2015

单独的方法是不能生产的,必须要有对应的module和class归属。module和class可以只是虚拟的,不用具体的代码支持,只定义注释就好了。

@zhiqinyigu
Copy link
Author

嗯嗯,后来我也是打算以此作为将就方案。但是单文件多个module的解析还是存在问题是吧,大概是你文章提到的----“后面有时间会对YUIDoc的扫描规则做优化(yuidoc对于module的扫描还存在不少问题)”。

期待你的修复,这几天试了三个文档工具都是各有不足,在你修复之前我先将就用着jsdoc,到时候再转换回来。

@fendoude007
Copy link

error: --------------------------------------------------------------------------
error: An uncaught YUIDoc error has occurred, stack trace given below
error: --------------------------------------------------------------------------
error:
ReferenceError: html is not defined
at /usr/local/lib/node_modules/smartdoc/smartDoc.js:287:18
at prepare (/usr/local/lib/node_modules/smartdoc/node_modules/yuidocjs/lib/utils.js:218:5)
at render (/usr/local/lib/node_modules/smartdoc/smartDoc.js:246:11)
at Object.Y.DocBuilder.writeDemo (/usr/local/lib/node_modules/smartdoc/smartDoc.js:188:13)
at /usr/local/lib/node_modules/smartdoc/smartDoc.js:86:21
at null. (/usr/local/lib/node_modules/smartdoc/node_modules/yuidocjs/lib/builder.js:1591:39)
at Object.e.Parallel.test (/usr/local/lib/node_modules/smartdoc/node_modules/yuidocjs/node_modules/yui/parallel/parallel-min.js:2:479)
at /usr/local/lib/node_modules/smartdoc/node_modules/yuidocjs/node_modules/yui/parallel/parallel-min.js:2:399
at null. (/usr/local/lib/node_modules/smartdoc/node_modules/yuidocjs/lib/builder.js:1438:17)
at Object.e.Parallel.test (/usr/local/lib/node_modules/smartdoc/node_modules/yuidocjs/node_modules/yui/parallel/parallel-min.js:2:479)
error: --------------------------------------------------------------------------
error: Node.js version: v4.4.5
error: YUI version: 3.9.1
error: YUIDoc version: 0.3.45
error: Please file all tickets here: http://github.com/yui/yuidoc/issues
error: --------------------------------------------------------------------------

@yuexushuang
Copy link

@fendoude007 请问一下解决了吗?遇到了同样的问题

@zhh77
Copy link
Owner

zhh77 commented Aug 11, 2016

@yuexushuang @fendoude007 ,是怎么操作引起来的?

@yuexushuang
Copy link

@zhh77 最终发现是注释写的不标准,导致文档没有成功生成,html就是undefined。

@enuobear
Copy link

@fendoude007你怎么解决的,我也是这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants