Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 Javascript/jQuery Documentation [closed]

OKay, TWO questions here:

  1. Is there anything like GhostDoc for JS?
  2. Are there any good help file generators that can use both C# AND JS source files to generate documentation? It looks like SandCastle doesn't support a web site as opposed to a web project with .proj files. And, as far as I can tell, Natural Docs doesn't support the Visual Studio style documentation... so that won't work.

I feel like I'm missing something here. I just can't believe that people out there are commenting their JS by hand... there HAS to be something, right?

I've searched high and low. I'm asking as a last resort. Please just tell me that I stink at searching and that there are easy solutions to this! :-)

like image 786
imyoac Avatar asked Sep 27 '10 15:09

imyoac


2 Answers

You gave this as an example (would've been nice to put it in the question proper, maybe a mod will come by and do that for you, since you should be able to edit your own questions) and you want to know if the /// <summary> block can be automatically inserted in the javascript part of the code, not just in the .cs files.

(function ($) { $.fn.helpfulTips = function (options) { 
    /// <summary>  
    /// Helpful Tips 
    /// </summary>  
    /// <param name="options">options</param>  
    /// <returns>jQuery</returns>  
    var defaults = { pointer: "#theArrow" };
    } 
});

I should think it would, but I just type that stuff so fast that I don't realize I'm typing it. I tend to do mine manually too, but I don't generally have a need to javadoc my code (we don't use javadocs), so I don't know if there are any automated tools to help with that in VS. I was curious so I'm hanging onto this post (favorited) so I can see if anyone else has good thoughts on this.

like image 114
jcolebrand Avatar answered Nov 14 '22 23:11

jcolebrand


You must reference all the js files will be used in the source by adding:

/// <reference path="jquery-1.4.2.min.js" />
/// <reference path="facebox.js" />

top of your javascript file. This way, you can get intellisense in javascript.

One last thing, some js frameworks (eg. jQuery) have a -vsdoc.js file for intellisense. You must place that files where your original js files resides in; and names of them must be match.

if your js files name is "test.js" then your -vsdoc file must be named: "test-vsdoc.js"

like image 1
Medeni Baykal Avatar answered Nov 14 '22 22:11

Medeni Baykal