didier

Modified documentation templates

......@@ -18,7 +18,8 @@ module.exports = function (grunt) {
options: {
verbose: true,
destination: 'docs/components',
template: 'docs/arcs'
template: 'docs/arcs',
configure: 'docs/jsdoc.conf.json'
}
}
},
......
......@@ -5,6 +5,7 @@ arcs_module(
/**
* @class ARUCODetector
* @classdesc Component that detects ARUCO markers in images
* This component encapsulate the {@link https://github.com/jcmellado/js-aruco|js-aruco} library.
*/
ARUCODetector = ARCS.Component.create(
function() {
......@@ -15,10 +16,11 @@ arcs_module(
/**
* Detects ARUCO markers in the given image.
* If markers are detected, this slot triggers the signal "onMarkers".
* If markers are detected, this slot triggers the signal onMarkers.
* @param image {obj} the image in which markers should be detected
* @emits ARUCODetector#onMarker
* @emits onMarkers
* @function ARUCODetector#detect
* @slot
*/
this.detect = function (image) {
/*1 recover markers from image
......@@ -32,7 +34,7 @@ arcs_module(
* Signal that is emitted when markers are detected in an image.
* @function ARUCODetector#onMarkers
* @param markers {array} Array of detected markers.
* @access signal
* @signal
*/
},
......
......@@ -192,6 +192,7 @@ arcs_module(
/**
* Adds new objects to the current 3D scene
* @param scene {object} 3D object as defined by Three.js to add to the scene.
* @signal
* @function ARViewer#addScene
*/
this.addScene = function (scene) {
......
......@@ -23,6 +23,9 @@ arcs_module(function (ARCS) {
* eventually triggered.
* @param n {numeric} number of iterations
* @function Loop#setIterations
* @slot
* @emits newIteration
* @emits sendToken
*/
this.setIterations = function (n) {
var i;
......@@ -32,6 +35,17 @@ arcs_module(function (ARCS) {
}
this.emit("sendToken", "end");
};
/** @function Loop#newIteration
* @signal
* @param n {number} current iteration number.
*/
/** @function Loop#sendToken
* @signal
* @param s {string} token to emit.
*/
},
"setIterations", //slotList
["sendToken", "newIteration"] // signalList
......@@ -48,6 +62,7 @@ arcs_module(function (ARCS) {
/**
* @param n {numeric} number to display
* @function DisplayInt#display
* @slot
*/
this.display = function (n) {
console.log(" DisplayInt : " + n);
......@@ -74,7 +89,8 @@ arcs_module(function (ARCS) {
* This slot adds its parameter to its internal sum and send it back by using
* the signal "sum".
* @param n {integer} add n to the internal sum of the component.
* @function Sum.add
* @function Sum#add
* @slot
*/
Sum.slot("add", function (n) {
this.total = this.total + n;
......
......@@ -106,16 +106,41 @@
<?js } ?>
<?js
var methods = self.find({kind: 'function', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
var methods = self.find({kind: 'function', slot: false, signal: false, memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
if (methods && methods.length && methods.forEach) {
?>
<h3 class="subsection-title">Methods</h3>
<dl><?js methods.forEach(function(m) { ?>
<dl><?js methods.forEach(function(m) {?>
<?js= self.partial('method.tmpl', m) ?>
<?js }); ?></dl>
<?js } ?>
<?js
var slots = self.find({slot: true, memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
if (slots && slots.length && slots.forEach) {
?>
<h3 class="subsection-title">Slots</h3>
<dl><?js slots.forEach(function(m) { ?>
<?js= self.partial('method.tmpl', m) ?>
<?js }); ?></dl>
<?js } ?>
<?js
var signals = self.find({signal: true, memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
if (signals && signals.length && signals.forEach) {
?>
<h3 class="subsection-title">Signals</h3>
<dl><?js signals.forEach(function(m) { ?>
<?js= self.partial('method.tmpl', m) ?>
<?js }); ?></dl>
<?js } ?>
<?js
var typedefs = self.find({kind: 'typedef', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
if (typedefs && typedefs.length && typedefs.forEach) {
......
......@@ -59,6 +59,14 @@ var self = this;
<?js }); ?></ul>
<?js } ?>
<?js if (data.emits && emits.length) { ?>
<h5>Emits signals:</h5>
<ul><?js emits.forEach(function(f) { ?>
<li><?js= self.linkto(f) ?></li>
<?js }); ?></ul>
<?js } ?>
<?js if (data.exceptions && exceptions.length) { ?>
<h5>Throws:</h5>
<?js if (exceptions.length > 1) { ?><ul><?js
......
{
"plugins": ["docs/sigslot.js"]
}
exports.defineTags = function(dictionary) {
dictionary.defineTag('signal', {
onTagged: function(doclet, tag) {
doclet.signal = true;
},
mustNotHaveValue : true,
mustNotHaveDescription: true
});
dictionary.defineTag('slot', {
onTagged: function(doclet, tag) {
doclet.slot = true;
},
mustNotHaveValue : true,
mustNotHaveDescription: true
});
dictionary.defineTag('emits', {
onTagged: function(doclet, tag) {
doclet.emits = doclet.emits || [];
doclet.emits.push(tag.value);
},
mustHaveValue: true
});
};
exports.handlers = {
processingComplete : function(e) {
var doclets = e.doclets;
var i;
for (i =0; i <doclets.length; i++) {
if (doclets[i].kind === 'function') {
doclets[i].signal = doclets[i].signal || false;
doclets[i].slot = doclets[i].slot || false;
}
}
}
};
\ No newline at end of file