We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This should be good to have the choice between a table or new lines for parameters
In my project I did this:
<?js var isChild = false var origin = '' if (typeof obj === 'object' && obj !== null && obj.subparams) { origin = obj.path + '.' obj = obj.subparams isChild = true } var params = obj function escapeRegExp(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } /* sort subparams under their parent params (like opts.classname) */ var parentParam = null params.forEach(function(param, i) { var paramRegExp if (!param) { return } param.fullname = origin + param.name if (parentParam && parentParam.name && param.name) { try { paramRegExp = new RegExp('^(?:' + escapeRegExp(parentParam.name) + '(?:\\[\\])*)\\.(.+)$') } catch (e) { console.error('Problem parsing comment', e) // there's probably a typo in the JSDoc comment that resulted in a weird // parameter name return } if ( paramRegExp.test(param.name) ) { param.name = RegExp.$1 parentParam.subparams = parentParam.subparams || [] parentParam.subparams.push(param) params[i] = null } else { parentParam = param } } else { parentParam = param } }) ?> <dl> <?js if (isChild) { ?> <h6>Sub properties</h6> <?js } ?> <?js var self = this params.forEach(function(param) { if (!param) { return } ?> <dt> <code class="parameter"><?js= param.fullname ?></code> <?js if (param.type && param.type.names) {?> <?js= self.partial('type.tmpl', param.type.names) ?> <?js } ?> </dt> <dd class="para"> <?js if (params.hasAttributes) {?> <?js if (param.optional) { ?> <optional><br> <?js } ?> <?js if (param.nullable) { ?> <nullable><br> <?js } ?> <?js if (param.variable) { ?> <repeatable><br> <?js } ?> <?js } ?> <?js if (params.hasDefault) {?> <?js if (typeof param.defaultvalue !== 'undefined') { ?> <code><?js= self.htmlsafe(param.defaultvalue) ?></code> <?js } ?> <?js } ?> <?js= param.description ?></p> <?js if (param.subparams) { ?> <?js= self.partial('params.tmpl', { 'subparams': param.subparams, 'path': param.fullname }) ?> <?js } ?> </dd> <?js }) ?> </dl>
config (with jsdoc/jsdoc#1771 ):
{ "opts": { "destination": "./gh-pages/", "tutorials": "./docs/", "template": "node_modules/docdash" }, // ... "templates": { "default": { "staticFiles": { "include": [ "./docs/home/custom.css" ] } }, "overwrite": { "node_modules/docdash/tmpl/params.tmpl": "docs/home/tmpl/params.tmpl" } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This should be good to have the choice between a table or new lines for parameters
In my project I did this:
Before:
After:
Script
config (with jsdoc/jsdoc#1771 ):
The text was updated successfully, but these errors were encountered: