I have the next code
element.js
(function(){
/**
* Element builder
* @param {string} url
* @constructor
**/
element = function(url){
/**
* Web service url
* @type {string} Url service
* @private
*/
this._url = url;
};
/**
* Open web service
* @param {Object} param
**/
element.prototype.open = function(param){
};
})();
I'm trying to test js doc and gets some documentation about my code.
I run the next mand
jsdoc --debug element.js
I got the next messages
DEBUG: JSDoc 3.3.2 (Sat, 13 Jun 2015 22:20:28 GMT)
DEBUG: Environment info: {"env":{"conf":{"tags":{"allowUnknownTags":true,"dictionaries":["jsdoc","closure"]},"templates":{"monospaceLinks":false,"cleverLinks":false,"default":{"outputSourceFiles":true}},"source":{"includePattern":".+\\.js(doc)?$","excludePattern":"(^|\\/|\\\\)_"},"plugins":[]},"opts":{"_":["element.js"],"debug":true,"destination":"./out/","encoding":"utf8"}}}
DEBUG: Parsing source files: ["/home/ismael-trabajo/Escritorio/js/element.js"]
Parsing /home/ismael-trabajo/Escritorio/js/element.js ...WARNING: The @type tag does not permit a description; the description will be ignored. File: element.js, line: 9
WARNING: The @type tag does not permit a description; the description will be ignored. File: element.js, line: 14
plete.
DEBUG: Finished parsing source files.
DEBUG: Indexing doclets...
DEBUG: Adding inherited symbols, mixins, and interface implementations...
DEBUG: Adding borrowed doclets...
DEBUG: Post-processing plete.
Generating output files..plete.
Finished running in 0.31 seconds.
And the output is index.html
, empty file. What I'm doing wrong?
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Home</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Home</h1>
<h3> </h3>
</div>
<nav>
<h2><a href="index.html">Home</a></h2>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="">JSDoc 3.3.2</a> on Tue Sep 08 2015 15:35:49 GMT+0200 (CEST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
Thank you all !
I have the next code
element.js
(function(){
/**
* Element builder
* @param {string} url
* @constructor
**/
element = function(url){
/**
* Web service url
* @type {string} Url service
* @private
*/
this._url = url;
};
/**
* Open web service
* @param {Object} param
**/
element.prototype.open = function(param){
};
})();
I'm trying to test js doc and gets some documentation about my code.
I run the next mand
jsdoc --debug element.js
I got the next messages
DEBUG: JSDoc 3.3.2 (Sat, 13 Jun 2015 22:20:28 GMT)
DEBUG: Environment info: {"env":{"conf":{"tags":{"allowUnknownTags":true,"dictionaries":["jsdoc","closure"]},"templates":{"monospaceLinks":false,"cleverLinks":false,"default":{"outputSourceFiles":true}},"source":{"includePattern":".+\\.js(doc)?$","excludePattern":"(^|\\/|\\\\)_"},"plugins":[]},"opts":{"_":["element.js"],"debug":true,"destination":"./out/","encoding":"utf8"}}}
DEBUG: Parsing source files: ["/home/ismael-trabajo/Escritorio/js/element.js"]
Parsing /home/ismael-trabajo/Escritorio/js/element.js ...WARNING: The @type tag does not permit a description; the description will be ignored. File: element.js, line: 9
WARNING: The @type tag does not permit a description; the description will be ignored. File: element.js, line: 14
plete.
DEBUG: Finished parsing source files.
DEBUG: Indexing doclets...
DEBUG: Adding inherited symbols, mixins, and interface implementations...
DEBUG: Adding borrowed doclets...
DEBUG: Post-processing plete.
Generating output files...plete.
Finished running in 0.31 seconds.
And the output is index.html
, empty file. What I'm doing wrong?
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Home</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode./svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Home</h1>
<h3> </h3>
</div>
<nav>
<h2><a href="index.html">Home</a></h2>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github./jsdoc3/jsdoc">JSDoc 3.3.2</a> on Tue Sep 08 2015 15:35:49 GMT+0200 (CEST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
Thank you all !
Share asked Sep 8, 2015 at 13:50 Ismael MoralIsmael Moral 7321 gold badge14 silver badges35 bronze badges 01 Answer
Reset to default 8The solution I found for this is using namespaces.
/**
* Handles elements
* @namespace myNameSpace
*/
(function(){
/**
* Element builder
* @param {string} url
* @constructor
* @memberof myNameSpace
**/
element = function(url){
/**
* Web service url
* @type {string} Url service
* @private
*/
this._url = url;
};
/**
* Open web service
* @param {Object} param
* @memberof myNameSpace
**/
element.prototype.open = function(param){
};
})();