JSDuck: Cover more of external.js and implement @source
authorTimo Tijhof <ttijhof@wikimedia.org>
Thu, 21 Mar 2013 18:45:17 +0000 (19:45 +0100)
committerTimo Tijhof <ttijhof@wikimedia.org>
Mon, 25 Mar 2013 13:58:23 +0000 (14:58 +0100)
Taken from VisualEditor repo (authored by myself under MIT).
Hereby released under GPL as well.

Change-Id: I4dc1a0e5c618e0a20ae6f308b4ecf266d041e22c

maintenance/jsduck/MetaTags.rb
maintenance/jsduck/categories.json
maintenance/jsduck/external.js

index 84e4021..83cc088 100644 (file)
@@ -3,6 +3,22 @@
 # - https://github.com/senchalabs/jsduck/wiki/Custom-tags
 require 'jsduck/meta_tag'
 
+class SourceTag < JsDuck::MetaTag
+  def initialize
+    # This defines the name of the @tag
+    @name = 'source'
+  end
+
+  # Generate HTML output for this tag.
+  # One can make use of the #format method to easily support
+  # Markdown and {@link} tags inside the contents of the tag.
+  #
+  # @param tags All matches of this tag on one class.
+  def to_html(tags)
+    '<h3 class="pa">Source</h3>' + tags.map {|tag| format(tag) }.join("\n")
+  end
+end
+
 class ContextTag < JsDuck::MetaTag
   def initialize
     @name = 'context'
index 4a8ba8c..c29c91c 100644 (file)
        {
                "name": "jQuery",
                "groups": [
-                       {
-                               "name": "Core",
-                               "classes": ["jQuery", "jQuery.Event", "jQuery.Promise", "jQuery.Deferred", "jQuery.jqXHR"]
-                       },
                        {
                                "name": "Plugins",
                                "classes": ["jQuery.plugin.*"]
                ]
        },
        {
-               "name": "Misc",
+               "name": "Upstream",
                "groups": [
                        {
-                               "name": "Native",
+                               "name": "jQuery",
+                               "classes": ["jQuery", "jQuery.Event", "jQuery.Callbacks", "jQuery.Promise", "jQuery.Deferred", "jQuery.jqXHR", "QUnit"]
+                       },
+                       {
+                               "name": "JavaScript",
                                "classes": ["Array", "Boolean", "Date", "Function", "Number", "Object", "RegExp", "String"]
                        }
                ]
index 8ab102f..7910ec8 100644 (file)
@@ -1,26 +1,43 @@
 /**
  * @class jQuery
+ * @source <http://api.jquery.com/>
  */
 
 /**
  * @method ajax
+ * @source <http://api.jquery.com/jQuery.ajax/>
  * @return {jqXHR}
  */
 
 /**
  * @class jQuery.Event
+ * @source <http://api.jquery.com/Types/#Event>
+ */
+
+/**
+ * @class jQuery.Callbacks
+ * @source <http://api.jquery.com/jQuery.Callbacks/>
  */
 
 /**
  * @class jQuery.Promise
+ * @source <http://api.jquery.com/Types/#Promise>
  */
 
 /**
  * @class jQuery.Deferred
  * @mixins jQuery.Promise
+ * @source <http://api.jquery.com/jQuery.Deferred/>
  */
 
 /**
  * @class jQuery.jqXHR
+ * @source <http://api.jquery.com/Types/#jqXHR>
  * @alternateClassName jqXHR
  */
+
+
+/**
+ * @class QUnit
+ * @source <http://api.qunitjs.com/>
+ */