javascript comments and documentations - javascript

I was wondering, if in C# under Visual Studio i can make xml comments, and java create's documentation base on annotation with javadocs, Exit's in somehow to create a nicer documentations base in comments in javascript?.
Something like the xml comments of c# like this
///<sumary> <===tags like this

There are various libraries for doing this. For example, http://code.google.com/p/jsdoc-toolkit/

Related

Writing Custom Commands for Aptana Studio

I've written / modified a couple custom snippets via the Ruby bundles (Ugh, Yuck!) but I'd like to get a little more complex...
a) Can I parse / modify the current document? (usually JavaScript)
b) Can I get at the tree of project files and read the contents?
c) Is it possible to write commands in not-Ruby? JavaScript or Python for example?
Specifically, I'd like to write something that automatically manages imports (something I miss from ActionScript editors) to cut down on manually typing:
var MyClass = require('path/to/MyClass');
and then manually sorting them
over and over and over...
You can do anything you like that you could do using Java/Eclipse. Unfortunately, no other languages are supported yet natively (i.e. JavaScript or Python), though you might try looking at some of the related pages here: http://code.google.com/p/jrfonseca/wiki/PythonMonkey
To your points, I would investigate https://wiki.appcelerator.org/display/tis/Interacting+with+Eclipse+or+Java as that will give some information on how to call Java classes from within Ruby.
For projects, I would look at the navigator framework.
For parsing/AST, I would suggest looking at the JavaScript parser/editor in the Aptana source code on github: https://github.com/aptana/studio3/tree/development/plugins/com.aptana.editor.js

Which comments documentation format is better for JavaScript?

Is there are any comments documentation format for JavaScript and processor for this format which generates HTML documentation?
Currently I am using VSDoc xml comments for providing IntelliSense help at developing time, but as I know there is no documentation generator for such comments.
So alternatively my question may sounds like: Is there are any utility which translates VSDoc comments from JavaScript files to HTML?
Have you looked at auto generated documentation from JavaDoc or VSDoc or JSDoc or anything like that.
They are all ugly and un-readable.
The solution is two fold
annotate your code with docco
Make your API documentation hand written.
There is a third option which is to revolutionize the way we do auto generated documentation, if you can then please do.
I've used Natural Docs for a few projects. The syntax is nice for reading the inline, but since it doesn't have "full language support" for JavaScript, you have to be somewhat explicit about each function/constant/class/whatever you want to document.
There is a utility that parses Javascript files and outputs the same XML format NDoc and Sandcastle use: AjaxDoc
That way you get the VS intellisense from the same comments and can output any format that you want.

How to comment for ReSharper so Intellisense displays documentation?

I want to see my methods' documentation when I use CTRL-space on a method name while coding.
How should I format comments in my JavaScript methods and classes for re#er?
ReSharper 6 added support for JavaScript, CSS and HTML. ReSharper is using the same XML documentation annotations that are driving the JavaScript IntelliSense in Visual Studio. The XML format is an extension of the format that C# and VB.NET are using so it should look familiar to .NET developers. The main differences are the additional attributes that have been added to convey the (optional) type information that is not provided by the language itself and the place where those comments are written.
For more information take a look at these pages:
The format for JavaScript doc comments
VS 2008 JavaScript Intellisense
AjaxDoc: Generates documentation for JavaScript script libraries

meaning of #scope in sproutcore

I'm using sproutcore, and I use sc-gen to generate a controller like this (this is from the sproutcore Todos tutorial):
sc-gen controller Todos.tasksController SC.ArrayController
In the generated javascript file, I find this javascript comment line:
/** #scope Todos.tasksController.prototype */
I wonder what this #scope does. Is this necessary? What tool is parsing this #scope keyword? Is this something specific to sproutcore or is this used in javascript in general?
SproutCore supports the JSDoc standard for generated documentation.
The #scope syntax is part of this. There is a more in-depth explanation here:
http://code.google.com/p/jsdoc-toolkit/wiki/DocExamples#Changing_Scope
It is not necessary for your own code, if you don't intend on using JSDoc. But if you do, or you are using an editor/IDE that supports JSDoc (e.g. JetBrains WebStorm), then it's a good idea to keep it in.
When building your SC app, all comments are removed (in minification), so it won't hurt the size of your app.

Is there any similar JAVADOCS script/tool for Javascript files?

Trying to find a way to automate the API from javascript comments.
The JSDoc project is no longer active, you should give a look to JsDoc Toolkit.
You might also want to check the following alternatives:
YUIDoc
PDoc
JSDoc http://jsdoc.sourceforge.net/
JSDoc Toolkit
jGrouseDoc
YUI Doc
jsd100
DocumentJS
I know its a lot late but since no one mentioned, I think Docco is a great tool. I use it for javascript but this tool can be used for other types of files too.

Categories

Resources