mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Added support for the @also pragma, to allow multiple doclets to be associated with the same line of source code. Tweaks to the default template.
This commit is contained in:
parent
6917abcc4f
commit
602c41680d
@ -23,12 +23,14 @@
|
||||
/** The kind of this package.
|
||||
@readonly
|
||||
@default
|
||||
@type {string}
|
||||
*/
|
||||
this.kind = 'package';
|
||||
|
||||
json = JSON.parse(json);
|
||||
|
||||
/** The name of this package.
|
||||
This value is found in the package.json file passed in as a command line option.
|
||||
@type {string}
|
||||
*/
|
||||
this.name = json.name;
|
||||
@ -43,8 +45,10 @@
|
||||
*/
|
||||
this.description = json.description;
|
||||
|
||||
/** The version of this package.
|
||||
/**
|
||||
The hash summary of the source file.
|
||||
@type {string}
|
||||
@since 3.2.0
|
||||
*/
|
||||
this.version = json.version;
|
||||
|
||||
@ -55,7 +59,7 @@
|
||||
* "licenses": [
|
||||
* {
|
||||
* "type": "GPLv2",
|
||||
* "url": "http://www.example.com/licenses/gpl.html",
|
||||
* "url": "http://www.example.com/licenses/gpl.html"
|
||||
* }
|
||||
* ]
|
||||
*/
|
||||
|
||||
@ -27,7 +27,15 @@
|
||||
|
||||
// handles named symbols in the code, may or may not have a JSDoc comment attached
|
||||
parser.on('symbolFound', function(e) {
|
||||
var newDoclet = new jsdoc.doclet.Doclet(e.comment, e);
|
||||
var subDoclets = e.comment.split(/@also\b/g);
|
||||
|
||||
for (var i = 0, l = subDoclets.length; i < l; i++) {
|
||||
newSymbolDoclet.call(this, subDoclets[i], e);
|
||||
}
|
||||
});
|
||||
|
||||
function newSymbolDoclet(docletSrc, e) {
|
||||
var newDoclet = new jsdoc.doclet.Doclet(docletSrc, e);
|
||||
|
||||
// an undocumented symbol right after a virtual comment? rhino mistakenly connected the two
|
||||
if (newDoclet.name) { // there was a @name in comment
|
||||
@ -92,7 +100,7 @@
|
||||
|
||||
addDoclet.call(this, newDoclet);
|
||||
e.doclet = newDoclet;
|
||||
});
|
||||
}
|
||||
|
||||
//parser.on('fileBegin', function(e) { });
|
||||
|
||||
|
||||
15
package.json
15
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jsdoc",
|
||||
"version": "3.0.0beta1",
|
||||
"revision": "2011-02-05-2259",
|
||||
"revision": "2011-02-06-0040",
|
||||
"description": "An automatic documentation generator for javascript.",
|
||||
"keywords": [ "documentation", "javascript" ],
|
||||
"licenses": [
|
||||
@ -13,21 +13,24 @@
|
||||
"repositories": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "http://github.com/micmath/JSDoc"
|
||||
"url": "git://github.com/micmath/jsdoc.git"
|
||||
},
|
||||
{
|
||||
"type": "svn",
|
||||
"url": "https://jsdoc.googlecode.com/svn/trunk"
|
||||
}
|
||||
],
|
||||
"bugs": "http://code.google.com/p/jsdoc/issues/list",
|
||||
"contributors" : [
|
||||
{
|
||||
"name": "Michael Mathews",
|
||||
"email": "micmath@gmail.com",
|
||||
"web": "http://micmath.ws"
|
||||
"email": "micmath@gmail.com"
|
||||
}
|
||||
],
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Michael Mathews",
|
||||
"email": "micmath@gmail.com",
|
||||
"web": "http://micmath.ws"
|
||||
"email": "micmath@gmail.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -194,19 +194,19 @@
|
||||
margin-left: 30px;
|
||||
}
|
||||
.property-head {
|
||||
margin-left: -30px;
|
||||
margin-left: -20px;
|
||||
display: block;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
.property-head h4 {
|
||||
color: #4782B5;
|
||||
}
|
||||
.property-title {
|
||||
.property-name {
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0 20px 0 0;
|
||||
padding: 0 10px 0 0;
|
||||
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
font-size: 1.2em;
|
||||
color: #4782B5;
|
||||
}
|
||||
.property-summary {
|
||||
color: #999;
|
||||
@ -219,8 +219,16 @@
|
||||
.property-details dt {
|
||||
font-weight: bold;
|
||||
margin-bottom: 4px;
|
||||
padding-left: 10px;
|
||||
clear: left;
|
||||
float: left;
|
||||
}
|
||||
.property-details dd {
|
||||
padding-left: 60px;
|
||||
}
|
||||
.property-deprecated {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
|
||||
.example-code {
|
||||
border: 1px solid #999;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<div class="property">
|
||||
|
||||
<dl class="property-head" id="property:{{name}}">
|
||||
<dl class="property-head{{#deprecated}} property-deprecated{{/deprecated}}" id="{{longname}}">
|
||||
<dt class="property-name">
|
||||
<h4 class="property-title">{{name}}</h4>
|
||||
{{name}}
|
||||
</dt>
|
||||
<dd class="property-summary">
|
||||
{{{summary}}}
|
||||
@ -15,9 +15,30 @@
|
||||
</dt>
|
||||
<dd>
|
||||
{{{description}}}
|
||||
<br clear="both">
|
||||
</dd>
|
||||
{{/description}}
|
||||
|
||||
{{#deprecated}}
|
||||
<dt>
|
||||
Deprecated
|
||||
</dt>
|
||||
<dd>
|
||||
{{{deprecated}}}
|
||||
<br clear="both">
|
||||
</dd>
|
||||
{{/deprecated}}
|
||||
|
||||
{{#since}}
|
||||
<dt>
|
||||
Since
|
||||
</dt>
|
||||
<dd>
|
||||
{{{since}}}
|
||||
<br clear="both">
|
||||
</dd>
|
||||
{{/since}}
|
||||
|
||||
{{#type}}
|
||||
<dt>
|
||||
Type
|
||||
@ -26,6 +47,7 @@
|
||||
{{#names}}
|
||||
<span class="type-name">{{#linkTo}}{{.}}{{/linkTo}}</span>{{^last?}} | {{/last?}}{{#last?}} {{/last?}}
|
||||
{{/names}}
|
||||
<br clear="both">
|
||||
</dd>
|
||||
{{/type}}
|
||||
|
||||
@ -35,6 +57,7 @@
|
||||
</dt>
|
||||
<dd class="yesDef">
|
||||
Yes
|
||||
<br clear="both">
|
||||
</dd>
|
||||
{{/readonly}}
|
||||
|
||||
@ -44,15 +67,17 @@
|
||||
</dt>
|
||||
<dd class="yesDef">
|
||||
Yes
|
||||
<br clear="both">
|
||||
</dd>
|
||||
{{/nullable}}
|
||||
|
||||
{{#defaultvalue}}
|
||||
<dt>
|
||||
Default Value
|
||||
Default
|
||||
</dt>
|
||||
<dd>
|
||||
{{defaultvalue}}
|
||||
<br clear="both">
|
||||
</dd>
|
||||
{{/defaultvalue}}
|
||||
|
||||
@ -61,9 +86,11 @@
|
||||
Example
|
||||
</dt>
|
||||
<dd>
|
||||
<br clear="both">
|
||||
<div class="example-code">
|
||||
<pre class="prettyprint lang-js"><code>{{.}}</code></pre>
|
||||
</div>
|
||||
<br clear="both">
|
||||
</dd>
|
||||
{{/examples}}
|
||||
</dl>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user