在JSDoc中,如果您有一个特定类型的数组(例如字符串数组),我可以找到的最佳文档显示使用以下内容:
/**
* @param {Array.<string>} myStrings All my awesome strings
*/
function blah(myStrings){
//stuff here...
}
Run Code Online (Sandbox Code Playgroud)
你如何替换下面的问号指定一个对象数组?
/**
* @param {???????} myObjects All of my equally awesome objects
*/
function blah(myObjects){
//stuff here...
}
Run Code Online (Sandbox Code Playgroud) 我喜欢doxygen来创建C或PHP代码的文档.我有一个即将推出的Python项目,我想我记得Python没有/* .. */评论,并且还有自己的自我文档工具,这似乎是pythonic的文档方式.
由于我熟悉doxygen,我如何使用它来生成我的Python文档?有什么特别需要注意的吗?
使用JavaDoc,如何引用类中最终静态字段的值?
我希望???在此示例中替换为字段的值STATIC_FIELD.
/**
* This is a simple class with only one static field with the value ???.
*/
public class Simple {
/**
* We can reference the value with {@value} here,
* but how do we reference it in the class JavaDoc?
*/
public static final String STATIC_FIELD = "simple static field";
}
Run Code Online (Sandbox Code Playgroud) 我正试图开始使用Sphinx并且似乎有无情的问题.
命令: docs/sphinx-quickstart
我回答所有问题,一切正常.
命令: docs/ls
一切看起来都很正常.结果:build Makefile source
命令: sphinx-build -d build/doctrees source build/html
它似乎工作.我能够打开index.html文件,看到我想要的"shell".
当我尝试将我的实际源代码作为source文件夹时遇到问题.
命令: sphinx-build -d build/doctrees ../ys_utils build/html
结果:
Making output directory...
Running Sphinx v1.1.3
loading pickled environment... not yet created
No builder selected, using default: html
loading intersphinx inventory from http://docs.python.org/objects.inv...
building [html]: targets for 1 source files that are out of date
updating environment: 1 added, 0 changed, 0 removed
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.1.3-py2.6.egg/sphinx/ext/autodoc.py", line 321, in …Run Code Online (Sandbox Code Playgroud) 我正在使用sphinx和autodoc插件为我的Python模块生成API文档.虽然我可以看到如何很好地记录特定参数,但我找不到如何记录**kwargs参数的示例.
有没有人有一个明确的方法来记录这些?
让我们面对现实:您不需要成为设计师就能看到默认的Javadoc看起来很难看.
网上有一些资源可以提供重新设计的Javadoc.但默认行为代表产品,应该看起来相当好看.
另一个问题是,与其他类似资源相比,Javadoc的可用性并不是最新的.
特别是巨大的项目很难使用Firefox的快速搜索进行导航.
实际问题:
是否有任何独立(桌面)应用程序能够以比浏览器更有用的方式浏览现有的Javadoc?
我正在考虑像Mono的文档浏览器这样的东西.
理论问题:
有没有人知道,如果有一些计划以某种方式标准化的方式发展Javadoc?
编辑: 有关此主题的Sun维基的有用链接.
在使用notepad ++和sublime编写许多快乐的岁月后,我被建议给PHP IDE一个机会.我正在尝试phpStorm,看起来不错.代码完成和文档是一个很好的功能,但是当使用魔术方法时,对我来说并不奏效.是否有工作让phpStorm了解魔术方法中发生了什么?
我们的情况是这样的:
abstract class a {
public static function __callStatic($method,$args)
{
if(strpos($method,"get_by_") === 0)
{
//do stuff
} elseif(strpos($method,"get_first_by_") === 0) {
//do stuff
} elseif($method == "get_all") {
//do stuff
}
}
}
class b extends a {
// some more stuff
}
b::get_by_user_id(27);
b::get_first_by_id(156);
b::get_all();
Run Code Online (Sandbox Code Playgroud)
神奇的callStatic方法允许我们通过构成函数调用的一个或多个参数来获取对象的集合.
我看到在这些情况下有一个@method语句可用,但phpStorm只是获取了这些语句中的第一个.此外,我只能将返回类型设置为混合,因为我更愿意将其设置为调用它的任何类(在我的示例中为b).
非常感谢任何想法或建议,谢谢.
是否有一个网站或项目记录iPhone SDK的私有API?
这是一个非常直截了当的问题,但我在谷歌上找不到任何东西.我正在寻找有关Node.js的创建服务器函数中的请求参数的文档,但我找不到任何东西.
http.createServer(function(request, response){
console.log(JSON.stringify(request));
});
Run Code Online (Sandbox Code Playgroud)
使用JSON.stringify()进行调试会给出一个错误,即对象是循环的并且程序停止.我见过不同的东西request.url,或者request.body,是否有一个记录所有请求函数和参数的页面?它似乎很容易找到,我似乎无法找到它.
我再次尝试了,结果只是console.log(request)写出了请求中的所有数据.这里仅作为参考:
ondata: [Function],
_httpMessage:
{ domain: null,
_events: [Object],
_maxListeners: 10,
output: [],
outputEncodings: [],
writable: true,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_hasBody: true,
_trailer: '',
finished: false,
_hangupClose: false,
socket: [Circular],
connection: [Circular] } },
connection:
{ _connecting: false,
_handle:
{ fd: null,
writeQueueSize: 0,
owner: [Circular],
onread: [Function: onread],
reading: true },
_readableState:
{ highWaterMark: 16384,
buffer: [],
length: 0,
pipes: …Run Code Online (Sandbox Code Playgroud)