Add jsdoc plugin that maps @todo tags to @stability and @observable tags.
This is a temporary measure until Plovr handles custom tags or is replaced in the build system. Add support for indicating API stability with inline documentation In preparation for documenting the stability of API features, this commit adds support for indicating API stability via a new jsdoc tag @stability. There is a small plugin for jsdoc that adds a new tag, @stabiility, with some ability to enforce specific level names. The templates and css have been updated to include the stability level in the generated documentation. (+1 squashed commit) Squashed commits: [d6bc03d] Add jsdoc plugin for documenting observable properties of a class.
This commit is contained in:
@@ -92,6 +92,15 @@
|
||||
<?js }); ?></dl>
|
||||
<?js } ?>
|
||||
|
||||
<?js
|
||||
var observables = doc.observables;
|
||||
if (observables && observables.length && observables.forEach) {
|
||||
?>
|
||||
<h3 class="subsection-title">Observable Properties</h3>
|
||||
<dl><?js= self.partial('observables.tmpl', observables) ?></dl>
|
||||
|
||||
<?js } ?>
|
||||
|
||||
<?js
|
||||
var members = self.find({kind: 'member', memberof: title === 'Globals'? {isUndefined: true} : doc.longname});
|
||||
if (members && members.length && members.forEach) {
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<dt class="<?js= data.access ?>">
|
||||
<h4 class="name" id="<?js= id ?>"><?js= data.attribs + name + data.signature ?></h4>
|
||||
|
||||
<?js= this.partial('stability.tmpl', data) ?>
|
||||
|
||||
<?js if (data.summary) { ?>
|
||||
<p class="summary"><?js= summary ?></p>
|
||||
<?js } ?>
|
||||
|
||||
@@ -5,6 +5,8 @@ var self = this;
|
||||
<dt>
|
||||
<h4 class="name" id="<?js= id ?>"><?js= data.attribs + (kind == 'class'? 'new ':'') + name + data.signature ?></h4>
|
||||
|
||||
<?js= this.partial('stability.tmpl', data) ?>
|
||||
|
||||
<?js if (data.summary) { ?>
|
||||
<p class="summary"><?js= summary ?></p>
|
||||
<?js } ?>
|
||||
|
||||
40
apidoc/template/tmpl/observables.tmpl
Normal file
40
apidoc/template/tmpl/observables.tmpl
Normal file
@@ -0,0 +1,40 @@
|
||||
<?js
|
||||
var props = obj;
|
||||
?>
|
||||
|
||||
<table class="props">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Get</th>
|
||||
<th>Set</th>
|
||||
<th>Event</th>
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?js
|
||||
var self = this;
|
||||
props.forEach(function(prop) {
|
||||
if (!prop) { return; }
|
||||
var getter = 'yes';
|
||||
var setter = prop.readonly ? 'no' : 'yes';
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td class="name"><code><?js= prop.name ?></code></td>
|
||||
<td class="type">
|
||||
<?js if (prop.type && prop.type.names) {?>
|
||||
<?js= self.partial('type.tmpl', prop.type.names) ?>
|
||||
<?js } ?>
|
||||
</td>
|
||||
<td class="getter"><?js= getter ?></td>
|
||||
<td class="setter"><?js= setter ?></td>
|
||||
<td class="event"><code>change:<?js= prop.name ?></code></td>
|
||||
<td class="description last"><?js= prop.description ?></td>
|
||||
</tr>
|
||||
<?js }); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
9
apidoc/template/tmpl/stability.tmpl
Normal file
9
apidoc/template/tmpl/stability.tmpl
Normal file
@@ -0,0 +1,9 @@
|
||||
<?js
|
||||
var data = obj;
|
||||
var self = this;
|
||||
|
||||
if (data.stability) { ?>
|
||||
<div class="stability stability-<?js= stability ?>">Stability: <?js= data.stability ?></div>
|
||||
<?js } else { ?>
|
||||
<div class="stability">Stability: not documented</div>
|
||||
<?js } ?>
|
||||
Reference in New Issue
Block a user