JSDuck: Cover more of external.js and implement @source

Taken from VisualEditor repo (authored by myself under MIT).
Hereby released under GPL as well.

Change-Id: I4dc1a0e5c618e0a20ae6f308b4ecf266d041e22c
This commit is contained in:
Timo Tijhof 2013-03-21 19:45:17 +01:00
parent da53cab191
commit ec6363cf34
3 changed files with 39 additions and 6 deletions

View 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'

View file

@ -32,10 +32,6 @@
{
"name": "jQuery",
"groups": [
{
"name": "Core",
"classes": ["jQuery", "jQuery.Event", "jQuery.Promise", "jQuery.Deferred", "jQuery.jqXHR"]
},
{
"name": "Plugins",
"classes": ["jQuery.plugin.*"]
@ -43,10 +39,14 @@
]
},
{
"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"]
}
]

View 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/>
*/