├── .gitignore ├── custom-template ├── README.md ├── publish.js ├── static │ ├── fonts │ │ ├── OpenSans-Bold-webfont.eot │ │ ├── OpenSans-Bold-webfont.svg │ │ ├── OpenSans-Bold-webfont.woff │ │ ├── OpenSans-BoldItalic-webfont.eot │ │ ├── OpenSans-BoldItalic-webfont.svg │ │ ├── OpenSans-BoldItalic-webfont.woff │ │ ├── OpenSans-Italic-webfont.eot │ │ ├── OpenSans-Italic-webfont.svg │ │ ├── OpenSans-Italic-webfont.woff │ │ ├── OpenSans-Light-webfont.eot │ │ ├── OpenSans-Light-webfont.svg │ │ ├── OpenSans-Light-webfont.woff │ │ ├── OpenSans-LightItalic-webfont.eot │ │ ├── OpenSans-LightItalic-webfont.svg │ │ ├── OpenSans-LightItalic-webfont.woff │ │ ├── OpenSans-Regular-webfont.eot │ │ ├── OpenSans-Regular-webfont.svg │ │ └── OpenSans-Regular-webfont.woff │ ├── scripts │ │ ├── linenumber.js │ │ └── prettify │ │ │ ├── Apache-License-2.0.txt │ │ │ ├── lang-css.js │ │ │ └── prettify.js │ └── styles │ │ ├── jsdoc-default.css │ │ ├── prettify-jsdoc.css │ │ └── prettify-tomorrow.css └── tmpl │ ├── augments.tmpl │ ├── container.tmpl │ ├── details.tmpl │ ├── example.tmpl │ ├── examples.tmpl │ ├── exceptions.tmpl │ ├── layout.tmpl │ ├── mainpage.tmpl │ ├── members.tmpl │ ├── method.tmpl │ ├── modifies.tmpl │ ├── params.tmpl │ ├── properties.tmpl │ ├── returns.tmpl │ ├── source.tmpl │ ├── tutorial.tmpl │ └── type.tmpl ├── jsdoc.json ├── package-lock.json ├── package.json ├── readme.md ├── readme └── readme.md ├── src ├── calculator.js └── index.js └── tutorials ├── calculator-tutorial.md ├── program-tutorial.html └── tutorials.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | docs/ -------------------------------------------------------------------------------- /custom-template/README.md: -------------------------------------------------------------------------------- 1 | The default template for JSDoc 3 uses: [the Taffy Database library](http://taffydb.com/) and the [Underscore Template library](http://underscorejs.org/). 2 | 3 | 4 | ## Generating Typeface Fonts 5 | 6 | The default template uses the [OpenSans](https://www.google.com/fonts/specimen/Open+Sans) typeface. The font files can be regenerated as follows: 7 | 8 | 1. Open the [OpenSans page at Font Squirrel](). 9 | 2. Click on the 'Webfont Kit' tab. 10 | 3. Either leave the subset drop-down as 'Western Latin (Default)', or, if we decide we need more glyphs, than change it to 'No Subsetting'. 11 | 4. Click the 'DOWNLOAD @FONT-FACE KIT' button. 12 | 5. For each typeface variant we plan to use, copy the 'eot', 'svg' and 'woff' files into the 'templates/default/static/fonts' directory. 13 | -------------------------------------------------------------------------------- /custom-template/publish.js: -------------------------------------------------------------------------------- 1 | const doop = require('jsdoc/util/doop'); 2 | const env = require('jsdoc/env'); 3 | const fs = require('jsdoc/fs'); 4 | const helper = require('jsdoc/util/templateHelper'); 5 | const logger = require('jsdoc/util/logger'); 6 | const path = require('jsdoc/path'); 7 | const taffy = require('taffydb').taffy; 8 | const template = require('jsdoc/template'); 9 | const util = require('util'); 10 | 11 | const htmlsafe = helper.htmlsafe; 12 | const linkto = helper.linkto; 13 | const resolveAuthorLinks = helper.resolveAuthorLinks; 14 | const hasOwnProp = Object.prototype.hasOwnProperty; 15 | 16 | let data; 17 | let view; 18 | 19 | let outdir = path.normalize(env.opts.destination); 20 | 21 | function find(spec) { 22 | return helper.find(data, spec); 23 | } 24 | 25 | function tutoriallink(tutorial) { 26 | return helper.toTutorial(tutorial, null, { 27 | tag: 'em', 28 | classname: 'disabled', 29 | prefix: 'Tutorial: ' 30 | }); 31 | } 32 | 33 | function getAncestorLinks(doclet) { 34 | return helper.getAncestorLinks(data, doclet); 35 | } 36 | 37 | function hashToLink(doclet, hash) { 38 | let url; 39 | 40 | if (!/^(#.+)/.test(hash)) { 41 | return hash; 42 | } 43 | 44 | url = helper.createLink(doclet); 45 | url = url.replace(/(#.+|$)/, hash); 46 | 47 | return `${hash}`; 48 | } 49 | 50 | function needsSignature({ kind, type, meta }) { 51 | let needsSig = false; 52 | 53 | // function and class definitions always get a signature 54 | if (kind === 'function' || kind === 'class') { 55 | needsSig = true; 56 | } 57 | // typedefs that contain functions get a signature, too 58 | else if (kind === 'typedef' && type && type.names && type.names.length) { 59 | for (let i = 0, l = type.names.length; i < l; i++) { 60 | if (type.names[i].toLowerCase() === 'function') { 61 | needsSig = true; 62 | break; 63 | } 64 | } 65 | } 66 | // and namespaces that are functions get a signature (but finding them is a 67 | // bit messy) 68 | else if ( 69 | kind === 'namespace' && 70 | meta && 71 | meta.code && 72 | meta.code.type && 73 | meta.code.type.match(/[Ff]unction/) 74 | ) { 75 | needsSig = true; 76 | } 77 | 78 | return needsSig; 79 | } 80 | 81 | function getSignatureAttributes({ optional, nullable }) { 82 | const attributes = []; 83 | 84 | if (optional) { 85 | attributes.push('opt'); 86 | } 87 | 88 | if (nullable === true) { 89 | attributes.push('nullable'); 90 | } else if (nullable === false) { 91 | attributes.push('non-null'); 92 | } 93 | 94 | return attributes; 95 | } 96 | 97 | function updateItemName(item) { 98 | const attributes = getSignatureAttributes(item); 99 | let itemName = item.name || ''; 100 | 101 | if (item.variable) { 102 | itemName = `…${itemName}`; 103 | } 104 | 105 | if (attributes && attributes.length) { 106 | itemName = util.format( 107 | '%s%s', 108 | itemName, 109 | attributes.join(', ') 110 | ); 111 | } 112 | 113 | return itemName; 114 | } 115 | 116 | function addParamAttributes(params) { 117 | return params 118 | .filter(({ name }) => name && !name.includes('.')) 119 | .map(updateItemName); 120 | } 121 | 122 | function buildItemTypeStrings(item) { 123 | const types = []; 124 | 125 | if (item && item.type && item.type.names) { 126 | item.type.names.forEach(name => { 127 | types.push(linkto(name, htmlsafe(name))); 128 | }); 129 | } 130 | 131 | return types; 132 | } 133 | 134 | function buildAttribsString(attribs) { 135 | let attribsString = ''; 136 | 137 | if (attribs && attribs.length) { 138 | attribsString = htmlsafe(util.format('(%s) ', attribs.join(', '))); 139 | } 140 | 141 | return attribsString; 142 | } 143 | 144 | function addNonParamAttributes(items) { 145 | let types = []; 146 | 147 | items.forEach(item => { 148 | types = types.concat(buildItemTypeStrings(item)); 149 | }); 150 | 151 | return types; 152 | } 153 | 154 | function addSignatureParams(f) { 155 | const params = f.params ? addParamAttributes(f.params) : []; 156 | 157 | f.signature = util.format('%s(%s)', f.signature || '', params.join(', ')); 158 | } 159 | 160 | function addSignatureReturns(f) { 161 | const attribs = []; 162 | let attribsString = ''; 163 | let returnTypes = []; 164 | let returnTypesString = ''; 165 | const source = f.yields || f.returns; 166 | 167 | // jam all the return-type attributes into an array. this could create odd results (for example, 168 | // if there are both nullable and non-nullable return types), but let's assume that most people 169 | // who use multiple @return tags aren't using Closure Compiler type annotations, and vice-versa. 170 | if (source) { 171 | source.forEach(item => { 172 | helper.getAttribs(item).forEach(attrib => { 173 | if (!attribs.includes(attrib)) { 174 | attribs.push(attrib); 175 | } 176 | }); 177 | }); 178 | 179 | attribsString = buildAttribsString(attribs); 180 | } 181 | 182 | if (source) { 183 | returnTypes = addNonParamAttributes(source); 184 | } 185 | if (returnTypes.length) { 186 | returnTypesString = util.format( 187 | ' → %s{%s}', 188 | attribsString, 189 | returnTypes.join('|') 190 | ); 191 | } 192 | 193 | f.signature = `${f.signature || 194 | ''}${returnTypesString}`; 195 | } 196 | 197 | function addSignatureTypes(f) { 198 | const types = f.type ? buildItemTypeStrings(f) : []; 199 | 200 | f.signature = `${f.signature || ''}${ 201 | types.length ? ` :${types.join('|')}` : '' 202 | }`; 203 | } 204 | 205 | function addAttribs(f) { 206 | const attribs = helper.getAttribs(f); 207 | const attribsString = buildAttribsString(attribs); 208 | 209 | f.attribs = util.format( 210 | '%s', 211 | attribsString 212 | ); 213 | } 214 | 215 | function shortenPaths(files, commonPrefix) { 216 | Object.keys(files).forEach(file => { 217 | files[file].shortened = files[file].resolved 218 | .replace(commonPrefix, '') 219 | // always use forward slashes 220 | .replace(/\\/g, '/'); 221 | }); 222 | 223 | return files; 224 | } 225 | 226 | function getPathFromDoclet({ meta }) { 227 | if (!meta) { 228 | return null; 229 | } 230 | 231 | return meta.path && meta.path !== 'null' 232 | ? path.join(meta.path, meta.filename) 233 | : meta.filename; 234 | } 235 | 236 | function generate(title, docs, filename, resolveLinks) { 237 | let docData; 238 | let html; 239 | let outpath; 240 | 241 | resolveLinks = resolveLinks !== false; 242 | 243 | docData = { 244 | env: env, 245 | title: title, 246 | docs: docs 247 | }; 248 | 249 | outpath = path.join(outdir, filename); 250 | html = view.render('container.tmpl', docData); 251 | 252 | if (resolveLinks) { 253 | html = helper.resolveLinks(html); // turn {@link foo} into foo 254 | } 255 | 256 | fs.writeFileSync(outpath, html, 'utf8'); 257 | } 258 | 259 | function generateSourceFiles(sourceFiles, encoding = 'utf8') { 260 | Object.keys(sourceFiles).forEach(file => { 261 | let source; 262 | // links are keyed to the shortened path in each doclet's `meta.shortpath` property 263 | const sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened); 264 | 265 | helper.registerLink(sourceFiles[file].shortened, sourceOutfile); 266 | 267 | try { 268 | source = { 269 | kind: 'source', 270 | code: helper.htmlsafe( 271 | fs.readFileSync(sourceFiles[file].resolved, encoding) 272 | ) 273 | }; 274 | } catch (e) { 275 | logger.error( 276 | 'Error while generating source file %s: %s', 277 | file, 278 | e.message 279 | ); 280 | } 281 | 282 | generate( 283 | `Source: ${sourceFiles[file].shortened}`, 284 | [source], 285 | sourceOutfile, 286 | false 287 | ); 288 | }); 289 | } 290 | 291 | /** 292 | * Look for classes or functions with the same name as modules (which indicates that the module 293 | * exports only that class or function), then attach the classes or functions to the `module` 294 | * property of the appropriate module doclets. The name of each class or function is also updated 295 | * for display purposes. This function mutates the original arrays. 296 | * 297 | * @private 298 | * @param {Array.} doclets - The array of classes and functions to 299 | * check. 300 | * @param {Array.} modules - The array of module doclets to search. 301 | */ 302 | function attachModuleSymbols(doclets, modules) { 303 | const symbols = {}; 304 | 305 | // build a lookup table 306 | doclets.forEach(symbol => { 307 | symbols[symbol.longname] = symbols[symbol.longname] || []; 308 | symbols[symbol.longname].push(symbol); 309 | }); 310 | 311 | modules.forEach(module => { 312 | if (symbols[module.longname]) { 313 | module.modules = symbols[module.longname] 314 | // Only show symbols that have a description. Make an exception for classes, because 315 | // we want to show the constructor-signature heading no matter what. 316 | .filter(({ description, kind }) => description || kind === 'class') 317 | .map(symbol => { 318 | symbol = doop(symbol); 319 | 320 | if (symbol.kind === 'class' || symbol.kind === 'function') { 321 | symbol.name = `${symbol.name.replace('module:', '(require("')}"))`; 322 | } 323 | 324 | return symbol; 325 | }); 326 | } 327 | }); 328 | } 329 | 330 | function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) { 331 | let nav = ''; 332 | 333 | if (items.length) { 334 | let itemsNav = ''; 335 | 336 | items.forEach(item => { 337 | let displayName; 338 | 339 | if (!hasOwnProp.call(item, 'longname')) { 340 | itemsNav += `
  • ${linktoFn('', item.name)}
  • `; 341 | } else if (!hasOwnProp.call(itemsSeen, item.longname)) { 342 | if (env.conf.templates.default.useLongnameInNav) { 343 | displayName = item.longname; 344 | } else { 345 | displayName = item.name; 346 | } 347 | itemsNav += `
  • ${linktoFn( 348 | item.longname, 349 | displayName.replace(/\b(module|event):/g, '') 350 | )}
  • `; 351 | 352 | itemsSeen[item.longname] = true; 353 | } 354 | }); 355 | 356 | if (itemsNav !== '') { 357 | nav += `

    ${itemHeading}

      ${itemsNav}
    `; 358 | } 359 | } 360 | 361 | return nav; 362 | } 363 | 364 | function linktoTutorial(longName, name) { 365 | return tutoriallink(name); 366 | } 367 | 368 | function linktoExternal(longName, name) { 369 | return linkto(longName, name.replace(/(^"|"$)/g, '')); 370 | } 371 | 372 | /** 373 | * Create the navigation sidebar. 374 | * @param {object} members The members that will be used to create the sidebar. 375 | * @param {array} members.classes 376 | * @param {array} members.externals 377 | * @param {array} members.globals 378 | * @param {array} members.mixins 379 | * @param {array} members.modules 380 | * @param {array} members.namespaces 381 | * @param {array} members.tutorials 382 | * @param {array} members.events 383 | * @param {array} members.interfaces 384 | * @return {string} The HTML for the navigation sidebar. 385 | */ 386 | function buildNav(members) { 387 | let globalNav; 388 | let nav = '

    JSDoc Example

    '; 389 | const seen = {}; 390 | const seenTutorials = {}; 391 | 392 | nav += buildMemberNav(members.modules, 'Modules', {}, linkto); 393 | nav += buildMemberNav(members.externals, 'Externals', seen, linktoExternal); 394 | nav += buildMemberNav(members.namespaces, 'Namespaces', seen, linkto); 395 | nav += buildMemberNav(members.classes, 'Classes', seen, linkto); 396 | nav += buildMemberNav(members.interfaces, 'Interfaces', seen, linkto); 397 | nav += buildMemberNav(members.events, 'Events', seen, linkto); 398 | nav += buildMemberNav(members.mixins, 'Mixins', seen, linkto); 399 | nav += buildMemberNav( 400 | members.tutorials, 401 | 'Tutorials', 402 | seenTutorials, 403 | linktoTutorial 404 | ); 405 | 406 | if (members.globals.length) { 407 | globalNav = ''; 408 | 409 | members.globals.forEach(({ kind, longname, name }) => { 410 | if (kind !== 'typedef' && !hasOwnProp.call(seen, longname)) { 411 | globalNav += `
  • ${linkto(longname, name)}
  • `; 412 | } 413 | seen[longname] = true; 414 | }); 415 | 416 | if (!globalNav) { 417 | // turn the heading into a link so you can actually get to the global page 418 | nav += `

    ${linkto('global', 'Global')}

    `; 419 | } else { 420 | nav += `

    Global

      ${globalNav}
    `; 421 | } 422 | } 423 | 424 | return nav; 425 | } 426 | 427 | /** 428 | @param {TAFFY} taffyData See . 429 | @param {object} opts 430 | @param {Tutorial} tutorials 431 | */ 432 | exports.publish = (taffyData, opts, tutorials) => { 433 | let classes; 434 | let conf; 435 | let externals; 436 | let files; 437 | let fromDir; 438 | let globalUrl; 439 | let indexUrl; 440 | let interfaces; 441 | let members; 442 | let mixins; 443 | let modules; 444 | let namespaces; 445 | let outputSourceFiles; 446 | let packageInfo; 447 | let packages; 448 | const sourceFilePaths = []; 449 | let sourceFiles = {}; 450 | let staticFileFilter; 451 | let staticFilePaths; 452 | let staticFiles; 453 | let staticFileScanner; 454 | let templatePath; 455 | 456 | data = taffyData; 457 | 458 | conf = env.conf.templates || {}; 459 | conf.default = conf.default || {}; 460 | 461 | templatePath = path.normalize(opts.template); 462 | view = new template.Template(path.join(templatePath, 'tmpl')); 463 | 464 | // claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness 465 | // doesn't try to hand them out later 466 | indexUrl = helper.getUniqueFilename('index'); 467 | // don't call registerLink() on this one! 'index' is also a valid longname 468 | 469 | globalUrl = helper.getUniqueFilename('global'); 470 | helper.registerLink('global', globalUrl); 471 | 472 | // set up templating 473 | view.layout = conf.default.layoutFile 474 | ? path.getResourcePath( 475 | path.dirname(conf.default.layoutFile), 476 | path.basename(conf.default.layoutFile) 477 | ) 478 | : 'layout.tmpl'; 479 | 480 | // set up tutorials for helper 481 | helper.setTutorials(tutorials); 482 | 483 | data = helper.prune(data); 484 | data.sort('longname, version, since'); 485 | helper.addEventListeners(data); 486 | 487 | data().each(doclet => { 488 | let sourcePath; 489 | 490 | doclet.attribs = ''; 491 | 492 | if (doclet.examples) { 493 | doclet.examples = doclet.examples.map(example => { 494 | let caption; 495 | let code; 496 | 497 | if ( 498 | example.match( 499 | /^\s*([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i 500 | ) 501 | ) { 502 | caption = RegExp.$1; 503 | code = RegExp.$3; 504 | } 505 | 506 | return { 507 | caption: caption || '', 508 | code: code || example 509 | }; 510 | }); 511 | } 512 | if (doclet.see) { 513 | doclet.see.forEach((seeItem, i) => { 514 | doclet.see[i] = hashToLink(doclet, seeItem); 515 | }); 516 | } 517 | 518 | // build a list of source files 519 | if (doclet.meta) { 520 | sourcePath = getPathFromDoclet(doclet); 521 | sourceFiles[sourcePath] = { 522 | resolved: sourcePath, 523 | shortened: null 524 | }; 525 | if (!sourceFilePaths.includes(sourcePath)) { 526 | sourceFilePaths.push(sourcePath); 527 | } 528 | } 529 | }); 530 | 531 | // update outdir if necessary, then create outdir 532 | packageInfo = (find({ kind: 'package' }) || [])[0]; 533 | if (packageInfo && packageInfo.name) { 534 | outdir = path.join(outdir, packageInfo.name, packageInfo.version || ''); 535 | } 536 | fs.mkPath(outdir); 537 | 538 | // copy the template's static files to outdir 539 | fromDir = path.join(templatePath, 'static'); 540 | staticFiles = fs.ls(fromDir, 3); 541 | 542 | staticFiles.forEach(fileName => { 543 | const toDir = fs.toDir(fileName.replace(fromDir, outdir)); 544 | 545 | fs.mkPath(toDir); 546 | fs.copyFileSync(fileName, toDir); 547 | }); 548 | 549 | // copy user-specified static files to outdir 550 | if (conf.default.staticFiles) { 551 | // The canonical property name is `include`. We accept `paths` for backwards compatibility 552 | // with a bug in JSDoc 3.2.x. 553 | staticFilePaths = 554 | conf.default.staticFiles.include || conf.default.staticFiles.paths || []; 555 | staticFileFilter = new (require('jsdoc/src/filter').Filter)( 556 | conf.default.staticFiles 557 | ); 558 | staticFileScanner = new (require('jsdoc/src/scanner').Scanner)(); 559 | 560 | staticFilePaths.forEach(filePath => { 561 | let extraStaticFiles; 562 | 563 | filePath = path.resolve(env.pwd, filePath); 564 | extraStaticFiles = staticFileScanner.scan( 565 | [filePath], 566 | 10, 567 | staticFileFilter 568 | ); 569 | 570 | extraStaticFiles.forEach(fileName => { 571 | const sourcePath = fs.toDir(filePath); 572 | const toDir = fs.toDir(fileName.replace(sourcePath, outdir)); 573 | 574 | fs.mkPath(toDir); 575 | fs.copyFileSync(fileName, toDir); 576 | }); 577 | }); 578 | } 579 | 580 | if (sourceFilePaths.length) { 581 | sourceFiles = shortenPaths(sourceFiles, path.commonPrefix(sourceFilePaths)); 582 | } 583 | data().each(doclet => { 584 | let docletPath; 585 | const url = helper.createLink(doclet); 586 | 587 | helper.registerLink(doclet.longname, url); 588 | 589 | // add a shortened version of the full path 590 | if (doclet.meta) { 591 | docletPath = getPathFromDoclet(doclet); 592 | docletPath = sourceFiles[docletPath].shortened; 593 | if (docletPath) { 594 | doclet.meta.shortpath = docletPath; 595 | } 596 | } 597 | }); 598 | 599 | data().each(doclet => { 600 | const url = helper.longnameToUrl[doclet.longname]; 601 | 602 | if (url.includes('#')) { 603 | doclet.id = helper.longnameToUrl[doclet.longname].split(/#/).pop(); 604 | } else { 605 | doclet.id = doclet.name; 606 | } 607 | 608 | if (needsSignature(doclet)) { 609 | addSignatureParams(doclet); 610 | addSignatureReturns(doclet); 611 | addAttribs(doclet); 612 | } 613 | }); 614 | 615 | // do this after the urls have all been generated 616 | data().each(doclet => { 617 | doclet.ancestors = getAncestorLinks(doclet); 618 | 619 | if (doclet.kind === 'member') { 620 | addSignatureTypes(doclet); 621 | addAttribs(doclet); 622 | } 623 | 624 | if (doclet.kind === 'constant') { 625 | addSignatureTypes(doclet); 626 | addAttribs(doclet); 627 | doclet.kind = 'member'; 628 | } 629 | }); 630 | 631 | members = helper.getMembers(data); 632 | members.tutorials = tutorials.children; 633 | 634 | // output pretty-printed source files by default 635 | outputSourceFiles = conf.default && conf.default.outputSourceFiles !== false; 636 | 637 | // add template helpers 638 | view.find = find; 639 | view.linkto = linkto; 640 | view.resolveAuthorLinks = resolveAuthorLinks; 641 | view.tutoriallink = tutoriallink; 642 | view.htmlsafe = htmlsafe; 643 | view.outputSourceFiles = outputSourceFiles; 644 | 645 | // once for all 646 | view.nav = buildNav(members); 647 | attachModuleSymbols(find({ longname: { left: 'module:' } }), members.modules); 648 | 649 | // generate the pretty-printed source files first so other pages can link to them 650 | if (outputSourceFiles) { 651 | generateSourceFiles(sourceFiles, opts.encoding); 652 | } 653 | 654 | if (members.globals.length) { 655 | generate('Global', [{ kind: 'globalobj' }], globalUrl); 656 | } 657 | 658 | // index page displays information from package.json and lists files 659 | files = find({ kind: 'file' }); 660 | packages = find({ kind: 'package' }); 661 | 662 | generate( 663 | 'JSDoc Example', 664 | packages 665 | .concat([ 666 | { 667 | kind: 'mainpage', 668 | readme: opts.readme, 669 | longname: opts.mainpagetitle ? opts.mainpagetitle : 'Main Page' 670 | } 671 | ]) 672 | .concat(files), 673 | indexUrl 674 | ); 675 | 676 | // set up the lists that we'll use to generate pages 677 | classes = taffy(members.classes); 678 | modules = taffy(members.modules); 679 | namespaces = taffy(members.namespaces); 680 | mixins = taffy(members.mixins); 681 | externals = taffy(members.externals); 682 | interfaces = taffy(members.interfaces); 683 | 684 | Object.keys(helper.longnameToUrl).forEach(longname => { 685 | const myClasses = helper.find(classes, { longname: longname }); 686 | const myExternals = helper.find(externals, { longname: longname }); 687 | const myInterfaces = helper.find(interfaces, { longname: longname }); 688 | const myMixins = helper.find(mixins, { longname: longname }); 689 | const myModules = helper.find(modules, { longname: longname }); 690 | const myNamespaces = helper.find(namespaces, { longname: longname }); 691 | 692 | if (myModules.length) { 693 | generate( 694 | `Module: ${myModules[0].name}`, 695 | myModules, 696 | helper.longnameToUrl[longname] 697 | ); 698 | } 699 | 700 | if (myClasses.length) { 701 | generate( 702 | `Class: ${myClasses[0].name}`, 703 | myClasses, 704 | helper.longnameToUrl[longname] 705 | ); 706 | } 707 | 708 | if (myNamespaces.length) { 709 | generate( 710 | `Namespace: ${myNamespaces[0].name}`, 711 | myNamespaces, 712 | helper.longnameToUrl[longname] 713 | ); 714 | } 715 | 716 | if (myMixins.length) { 717 | generate( 718 | `Mixin: ${myMixins[0].name}`, 719 | myMixins, 720 | helper.longnameToUrl[longname] 721 | ); 722 | } 723 | 724 | if (myExternals.length) { 725 | generate( 726 | `External: ${myExternals[0].name}`, 727 | myExternals, 728 | helper.longnameToUrl[longname] 729 | ); 730 | } 731 | 732 | if (myInterfaces.length) { 733 | generate( 734 | `Interface: ${myInterfaces[0].name}`, 735 | myInterfaces, 736 | helper.longnameToUrl[longname] 737 | ); 738 | } 739 | }); 740 | 741 | // TODO: move the tutorial functions to templateHelper.js 742 | function generateTutorial(title, tutorial, filename) { 743 | const tutorialData = { 744 | title: title, 745 | header: tutorial.title, 746 | content: tutorial.parse(), 747 | children: tutorial.children 748 | }; 749 | const tutorialPath = path.join(outdir, filename); 750 | let html = view.render('tutorial.tmpl', tutorialData); 751 | 752 | // yes, you can use {@link} in tutorials too! 753 | html = helper.resolveLinks(html); // turn {@link foo} into foo 754 | 755 | fs.writeFileSync(tutorialPath, html, 'utf8'); 756 | } 757 | 758 | // tutorials can have only one parent so there is no risk for loops 759 | function saveChildren({ children }) { 760 | children.forEach(child => { 761 | generateTutorial( 762 | `Tutorial: ${child.title}`, 763 | child, 764 | helper.tutorialToUrl(child.name) 765 | ); 766 | saveChildren(child); 767 | }); 768 | } 769 | 770 | saveChildren(tutorials); 771 | }; 772 | -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-Bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-Bold-webfont.eot -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-Bold-webfont.woff -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-BoldItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-BoldItalic-webfont.eot -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-BoldItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-BoldItalic-webfont.woff -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-Italic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-Italic-webfont.eot -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-Italic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-Italic-webfont.woff -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-Light-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-Light-webfont.eot -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-Light-webfont.woff -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-LightItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-LightItalic-webfont.eot -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-LightItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-LightItalic-webfont.woff -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-Regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-Regular-webfont.eot -------------------------------------------------------------------------------- /custom-template/static/fonts/OpenSans-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/jsdoc-examples/a10166a3a102e078db814806c0219c30d095f664/custom-template/static/fonts/OpenSans-Regular-webfont.woff -------------------------------------------------------------------------------- /custom-template/static/scripts/linenumber.js: -------------------------------------------------------------------------------- 1 | /*global document */ 2 | (() => { 3 | const source = document.getElementsByClassName('prettyprint source linenums'); 4 | let i = 0; 5 | let lineNumber = 0; 6 | let lineId; 7 | let lines; 8 | let totalLines; 9 | let anchorHash; 10 | 11 | if (source && source[0]) { 12 | anchorHash = document.location.hash.substring(1); 13 | lines = source[0].getElementsByTagName('li'); 14 | totalLines = lines.length; 15 | 16 | for (; i < totalLines; i++) { 17 | lineNumber++; 18 | lineId = `line${lineNumber}`; 19 | lines[i].id = lineId; 20 | if (lineId === anchorHash) { 21 | lines[i].className += ' selected'; 22 | } 23 | } 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /custom-template/static/scripts/prettify/Apache-License-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /custom-template/static/scripts/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", 2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /custom-template/static/scripts/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p th:last-child { border-right: 1px solid #ddd; } 224 | 225 | .ancestors, .attribs { color: #999; } 226 | .ancestors a, .attribs a 227 | { 228 | color: #999 !important; 229 | text-decoration: none; 230 | } 231 | 232 | .clear 233 | { 234 | clear: both; 235 | } 236 | 237 | .important 238 | { 239 | font-weight: bold; 240 | color: #950B02; 241 | } 242 | 243 | .yes-def { 244 | text-indent: -1000px; 245 | } 246 | 247 | .type-signature { 248 | color: #aaa; 249 | } 250 | 251 | .name, .signature { 252 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 253 | } 254 | 255 | .details { margin-top: 14px; border-left: 2px solid #DDD; } 256 | .details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } 257 | .details dd { margin-left: 70px; } 258 | .details ul { margin: 0; } 259 | .details ul { list-style-type: none; } 260 | .details li { margin-left: 30px; padding-top: 6px; } 261 | .details pre.prettyprint { margin: 0 } 262 | .details .object-value { padding-top: 0; } 263 | 264 | .description { 265 | margin-bottom: 1em; 266 | margin-top: 1em; 267 | } 268 | 269 | .code-caption 270 | { 271 | font-style: italic; 272 | font-size: 107%; 273 | margin: 0; 274 | } 275 | 276 | .source 277 | { 278 | border: 1px solid #ddd; 279 | width: 80%; 280 | overflow: auto; 281 | } 282 | 283 | .prettyprint.source { 284 | width: inherit; 285 | } 286 | 287 | .source code 288 | { 289 | font-size: 100%; 290 | line-height: 18px; 291 | display: block; 292 | padding: 4px 12px; 293 | margin: 0; 294 | background-color: #fff; 295 | color: #4D4E53; 296 | } 297 | 298 | .prettyprint code span.line 299 | { 300 | display: inline-block; 301 | } 302 | 303 | .prettyprint.linenums 304 | { 305 | padding-left: 70px; 306 | -webkit-user-select: none; 307 | -moz-user-select: none; 308 | -ms-user-select: none; 309 | user-select: none; 310 | } 311 | 312 | .prettyprint.linenums ol 313 | { 314 | padding-left: 0; 315 | } 316 | 317 | .prettyprint.linenums li 318 | { 319 | border-left: 3px #ddd solid; 320 | } 321 | 322 | .prettyprint.linenums li.selected, 323 | .prettyprint.linenums li.selected * 324 | { 325 | background-color: lightyellow; 326 | } 327 | 328 | .prettyprint.linenums li * 329 | { 330 | -webkit-user-select: text; 331 | -moz-user-select: text; 332 | -ms-user-select: text; 333 | user-select: text; 334 | } 335 | 336 | .params .name, .props .name, .name code { 337 | color: #4D4E53; 338 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 339 | font-size: 100%; 340 | } 341 | 342 | .params td.description > p:first-child, 343 | .props td.description > p:first-child 344 | { 345 | margin-top: 0; 346 | padding-top: 0; 347 | } 348 | 349 | .params td.description > p:last-child, 350 | .props td.description > p:last-child 351 | { 352 | margin-bottom: 0; 353 | padding-bottom: 0; 354 | } 355 | 356 | .disabled { 357 | color: #454545; 358 | } 359 | -------------------------------------------------------------------------------- /custom-template/static/styles/prettify-jsdoc.css: -------------------------------------------------------------------------------- 1 | /* JSDoc prettify.js theme */ 2 | 3 | /* plain text */ 4 | .pln { 5 | color: #000000; 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | 10 | /* string content */ 11 | .str { 12 | color: #006400; 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | 17 | /* a keyword */ 18 | .kwd { 19 | color: #000000; 20 | font-weight: bold; 21 | font-style: normal; 22 | } 23 | 24 | /* a comment */ 25 | .com { 26 | font-weight: normal; 27 | font-style: italic; 28 | } 29 | 30 | /* a type name */ 31 | .typ { 32 | color: #000000; 33 | font-weight: normal; 34 | font-style: normal; 35 | } 36 | 37 | /* a literal value */ 38 | .lit { 39 | color: #006400; 40 | font-weight: normal; 41 | font-style: normal; 42 | } 43 | 44 | /* punctuation */ 45 | .pun { 46 | color: #000000; 47 | font-weight: bold; 48 | font-style: normal; 49 | } 50 | 51 | /* lisp open bracket */ 52 | .opn { 53 | color: #000000; 54 | font-weight: bold; 55 | font-style: normal; 56 | } 57 | 58 | /* lisp close bracket */ 59 | .clo { 60 | color: #000000; 61 | font-weight: bold; 62 | font-style: normal; 63 | } 64 | 65 | /* a markup tag name */ 66 | .tag { 67 | color: #006400; 68 | font-weight: normal; 69 | font-style: normal; 70 | } 71 | 72 | /* a markup attribute name */ 73 | .atn { 74 | color: #006400; 75 | font-weight: normal; 76 | font-style: normal; 77 | } 78 | 79 | /* a markup attribute value */ 80 | .atv { 81 | color: #006400; 82 | font-weight: normal; 83 | font-style: normal; 84 | } 85 | 86 | /* a declaration */ 87 | .dec { 88 | color: #000000; 89 | font-weight: bold; 90 | font-style: normal; 91 | } 92 | 93 | /* a variable name */ 94 | .var { 95 | color: #000000; 96 | font-weight: normal; 97 | font-style: normal; 98 | } 99 | 100 | /* a function name */ 101 | .fun { 102 | color: #000000; 103 | font-weight: bold; 104 | font-style: normal; 105 | } 106 | 107 | /* Specify class=linenums on a pre to get line numbering */ 108 | ol.linenums { 109 | margin-top: 0; 110 | margin-bottom: 0; 111 | } 112 | -------------------------------------------------------------------------------- /custom-template/static/styles/prettify-tomorrow.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* Pretty printing styles. Used with prettify.js. */ 4 | /* SPAN elements with the classes below are added by prettyprint. */ 5 | /* plain text */ 6 | .pln { 7 | color: #4d4d4c; } 8 | 9 | @media screen { 10 | /* string content */ 11 | .str { 12 | color: #718c00; } 13 | 14 | /* a keyword */ 15 | .kwd { 16 | color: #8959a8; } 17 | 18 | /* a comment */ 19 | .com { 20 | color: #8e908c; } 21 | 22 | /* a type name */ 23 | .typ { 24 | color: #4271ae; } 25 | 26 | /* a literal value */ 27 | .lit { 28 | color: #f5871f; } 29 | 30 | /* punctuation */ 31 | .pun { 32 | color: #4d4d4c; } 33 | 34 | /* lisp open bracket */ 35 | .opn { 36 | color: #4d4d4c; } 37 | 38 | /* lisp close bracket */ 39 | .clo { 40 | color: #4d4d4c; } 41 | 42 | /* a markup tag name */ 43 | .tag { 44 | color: #c82829; } 45 | 46 | /* a markup attribute name */ 47 | .atn { 48 | color: #f5871f; } 49 | 50 | /* a markup attribute value */ 51 | .atv { 52 | color: #3e999f; } 53 | 54 | /* a declaration */ 55 | .dec { 56 | color: #f5871f; } 57 | 58 | /* a variable name */ 59 | .var { 60 | color: #c82829; } 61 | 62 | /* a function name */ 63 | .fun { 64 | color: #4271ae; } } 65 | /* Use higher contrast and text-weight for printable form. */ 66 | @media print, projection { 67 | .str { 68 | color: #060; } 69 | 70 | .kwd { 71 | color: #006; 72 | font-weight: bold; } 73 | 74 | .com { 75 | color: #600; 76 | font-style: italic; } 77 | 78 | .typ { 79 | color: #404; 80 | font-weight: bold; } 81 | 82 | .lit { 83 | color: #044; } 84 | 85 | .pun, .opn, .clo { 86 | color: #440; } 87 | 88 | .tag { 89 | color: #006; 90 | font-weight: bold; } 91 | 92 | .atn { 93 | color: #404; } 94 | 95 | .atv { 96 | color: #060; } } 97 | /* Style */ 98 | /* 99 | pre.prettyprint { 100 | background: white; 101 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 102 | font-size: 12px; 103 | line-height: 1.5; 104 | border: 1px solid #ccc; 105 | padding: 10px; } 106 | */ 107 | 108 | /* Specify class=linenums on a pre to get line numbering */ 109 | ol.linenums { 110 | margin-top: 0; 111 | margin-bottom: 0; } 112 | 113 | /* IE indents via margin-left */ 114 | li.L0, 115 | li.L1, 116 | li.L2, 117 | li.L3, 118 | li.L4, 119 | li.L5, 120 | li.L6, 121 | li.L7, 122 | li.L8, 123 | li.L9 { 124 | /* */ } 125 | 126 | /* Alternate shading for lines */ 127 | li.L1, 128 | li.L3, 129 | li.L5, 130 | li.L7, 131 | li.L9 { 132 | /* */ } 133 | -------------------------------------------------------------------------------- /custom-template/tmpl/augments.tmpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 |
      8 |
    • 9 |
    10 | 11 | -------------------------------------------------------------------------------- /custom-template/tmpl/container.tmpl: -------------------------------------------------------------------------------- 1 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
    21 | 22 |
    23 | 24 |

    26 | 30 |

    32 | 33 |
    34 | 35 | 36 | 37 | 38 |
    39 | 40 | 41 | 42 |
    43 | 44 |
    45 |
    46 | 47 | 48 |
    49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 |
    59 | 60 | 61 | 62 | 63 | 64 |

    Example 1? 's':'' ?>

    65 | 66 | 67 | 68 |
    69 | 70 | 71 |

    Extends

    72 | 73 | 74 | 75 | 76 | 77 |

    Requires

    78 | 79 |
      80 |
    • 81 |
    82 | 83 | 84 | 88 |

    Classes

    89 | 90 |
    91 |
    92 |
    93 |
    94 | 95 | 96 | 100 |

    Interfaces

    101 | 102 |
    103 |
    104 |
    105 |
    106 | 107 | 108 | 112 |

    Mixins

    113 | 114 |
    115 |
    116 |
    117 |
    118 | 119 | 120 | 124 |

    Namespaces

    125 | 126 |
    127 |
    128 |
    129 |
    130 | 131 | 132 | 143 |

    Members

    144 | 145 | 146 | 147 | 148 | 149 | 150 | 154 |

    Methods

    155 | 156 | 157 | 158 | 159 | 160 | 161 | 165 |

    Type Definitions

    166 | 167 | 170 | 171 | 175 | 176 | 179 | 180 | 181 | 185 |

    Events

    186 | 187 | 188 | 189 | 190 | 191 |
    192 | 193 |
    194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /custom-template/tmpl/details.tmpl: -------------------------------------------------------------------------------- 1 | " + data.defaultvalue + ""; 9 | defaultObjectClass = ' class="object-value"'; 10 | } 11 | ?> 12 | 16 | 17 |
    Properties:
    18 | 19 | 20 | 21 | 22 | 23 |
    24 | 25 | 26 |
    Version:
    27 |
    28 | 29 | 30 | 31 |
    Since:
    32 |
    33 | 34 | 35 | 36 |
    Inherited From:
    37 |
    • 38 | 39 |
    40 | 41 | 42 | 43 |
    Overrides:
    44 |
    • 45 | 46 |
    47 | 48 | 49 | 50 |
    Implementations:
    51 |
      52 | 53 |
    • 54 | 55 |
    56 | 57 | 58 | 59 |
    Implements:
    60 |
      61 | 62 |
    • 63 | 64 |
    65 | 66 | 67 | 68 |
    Mixes In:
    69 | 70 |
      71 | 72 |
    • 73 | 74 |
    75 | 76 | 77 | 78 |
    Deprecated:
    • Yes
    82 | 83 | 84 | 85 |
    Author:
    86 |
    87 |
      88 |
    • 89 |
    90 |
    91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |
    License:
    100 |
    101 | 102 | 103 | 104 |
    Default Value:
    105 |
      106 | > 107 |
    108 | 109 | 110 | 111 |
    Source:
    112 |
    • 113 | , 114 |
    115 | 116 | 117 | 118 |
    Tutorials:
    119 |
    120 |
      121 |
    • 122 |
    123 |
    124 | 125 | 126 | 127 |
    See:
    128 |
    129 |
      130 |
    • 131 |
    132 |
    133 | 134 | 135 | 136 |
    To Do:
    137 |
    138 |
      139 |
    • 140 |
    141 |
    142 | 143 |
    144 | -------------------------------------------------------------------------------- /custom-template/tmpl/example.tmpl: -------------------------------------------------------------------------------- 1 | 2 |
    3 | -------------------------------------------------------------------------------- /custom-template/tmpl/examples.tmpl: -------------------------------------------------------------------------------- 1 | 8 |

    9 | 10 |
    11 | -------------------------------------------------------------------------------- /custom-template/tmpl/exceptions.tmpl: -------------------------------------------------------------------------------- 1 | 4 | 5 |
    6 |
    7 |
    8 | 9 |
    10 |
    11 |
    12 |
    13 |
    14 |
    15 | Type 16 |
    17 |
    18 | 19 |
    20 |
    21 |
    22 |
    23 |
    24 | 25 |
    26 | 27 | 28 | 29 | 30 | 31 |
    32 | 33 | -------------------------------------------------------------------------------- /custom-template/tmpl/layout.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: <?js= title ?> 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
    19 | 20 |

    21 | 22 | 23 |
    24 | 25 | 28 | 29 |
    30 | 31 |
    32 | Documentation generated by JSDoc on 33 |
    34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /custom-template/tmpl/mainpage.tmpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 |

    8 | 9 | 10 | 11 |
    12 |
    13 |
    14 | 15 | -------------------------------------------------------------------------------- /custom-template/tmpl/members.tmpl: -------------------------------------------------------------------------------- 1 | 5 |

    6 | 7 | 8 |

    9 | 10 | 11 | 12 |
    13 | 14 |
    15 | 16 | 17 | 18 |
    Type:
    19 |
      20 |
    • 21 | 22 |
    • 23 |
    24 | 25 | 26 | 27 | 28 | 29 |
    Fires:
    30 |
      31 |
    • 32 |
    33 | 34 | 35 | 36 |
    Example 1? 's':'' ?>
    37 | 38 | 39 | -------------------------------------------------------------------------------- /custom-template/tmpl/method.tmpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 |

    Constructor

    8 | 9 | 10 | 11 |

    13 | 14 | 15 | 16 |

    17 | 18 | 19 | 20 | 21 |
    22 | 23 |
    24 | 25 | 26 | 27 |
    Extends:
    28 | 29 | 30 | 31 | 32 |
    Type:
    33 |
      34 |
    • 35 | 36 |
    • 37 |
    38 | 39 | 40 | 41 |
    This:
    42 |
    43 | 44 | 45 | 46 |
    Parameters:
    47 | 48 | 49 | 50 | 51 | 52 | 53 |
    Requires:
    54 |
      55 |
    • 56 |
    57 | 58 | 59 | 60 |
    Fires:
    61 |
      62 |
    • 63 |
    64 | 65 | 66 | 67 |
    Listens to Events:
    68 |
      69 |
    • 70 |
    71 | 72 | 73 | 74 |
    Listeners of This Event:
    75 |
      76 |
    • 77 |
    78 | 79 | 80 | 81 |
    Modifies:
    82 | 1) { ?>
      84 |
    • 85 |
    88 | 89 | 91 | 92 | 93 |
    Throws:
    94 | 1) { ?>
      96 |
    • 97 |
    100 | 101 | 103 | 104 | 105 |
    Returns:
    106 | 1) { ?>
      108 |
    • 109 |
    112 | 113 | 115 | 116 | 117 |
    Yields:
    118 | 1) { ?>
      120 |
    • 121 |
    124 | 125 | 127 | 128 | 129 |
    Example 1? 's':'' ?>
    130 | 131 | 132 | -------------------------------------------------------------------------------- /custom-template/tmpl/modifies.tmpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 |
    7 |
    8 | Type 9 |
    10 |
    11 | 12 |
    13 |
    14 | 15 | -------------------------------------------------------------------------------- /custom-template/tmpl/params.tmpl: -------------------------------------------------------------------------------- 1 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 98 | 99 | 100 | 113 | 114 | 115 | 116 | 121 | 122 | 123 | 127 | 128 | 129 | 130 | 131 |
    NameTypeAttributesDefaultDescription
    94 | 95 | 96 | 97 | 101 | 102 | <optional>
    103 | 104 | 105 | 106 | <nullable>
    107 | 108 | 109 | 110 | <repeatable>
    111 | 112 |
    117 | 118 | 119 | 120 | 124 |
    Properties
    125 | 126 |
    132 | -------------------------------------------------------------------------------- /custom-template/tmpl/properties.tmpl: -------------------------------------------------------------------------------- 1 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 80 | 81 | 82 | 91 | 92 | 93 | 94 | 99 | 100 | 101 | 104 | 105 | 106 | 107 | 108 |
    NameTypeAttributesDefaultDescription
    76 | 77 | 78 | 79 | 83 | 84 | <optional>
    85 | 86 | 87 | 88 | <nullable>
    89 | 90 |
    95 | 96 | 97 | 98 | 102 |
    Properties
    103 |
    109 | -------------------------------------------------------------------------------- /custom-template/tmpl/returns.tmpl: -------------------------------------------------------------------------------- 1 | 5 |
    6 | 7 |
    8 | 9 | 10 | 11 |
    12 |
    13 | Type 14 |
    15 |
    16 | 17 |
    18 |
    19 | -------------------------------------------------------------------------------- /custom-template/tmpl/source.tmpl: -------------------------------------------------------------------------------- 1 | 4 |
    5 |
    6 |
    7 |
    8 |
    -------------------------------------------------------------------------------- /custom-template/tmpl/tutorial.tmpl: -------------------------------------------------------------------------------- 1 |
    2 | 3 |
    4 | 0) { ?> 5 |
      8 |
    • 9 |
    10 | 11 | 12 |

    13 |
    14 | 15 |
    16 | 17 |
    18 | 19 |
    20 | -------------------------------------------------------------------------------- /custom-template/tmpl/type.tmpl: -------------------------------------------------------------------------------- 1 | 5 | 6 | | 7 | -------------------------------------------------------------------------------- /jsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": { 3 | "include": ["src"], 4 | "includePattern": ".js$", 5 | "excludePattern": "(node_modules/|docs)" 6 | }, 7 | "plugins": ["plugins/markdown"], 8 | "templates": { 9 | "cleverLinks": true, 10 | "monospaceLinks": true 11 | }, 12 | "opts": { 13 | "recurse": true, 14 | "destination": "./docs/", 15 | "template": "./custom-template", 16 | "tutorials": "./tutorials", 17 | "readme": "./readme/readme.md" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsdoc_example", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@babel/parser": { 8 | "version": "7.7.3", 9 | "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz", 10 | "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==", 11 | "dev": true 12 | }, 13 | "argparse": { 14 | "version": "1.0.10", 15 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 16 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 17 | "dev": true, 18 | "requires": { 19 | "sprintf-js": "~1.0.2" 20 | } 21 | }, 22 | "bluebird": { 23 | "version": "3.7.1", 24 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz", 25 | "integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==", 26 | "dev": true 27 | }, 28 | "catharsis": { 29 | "version": "0.8.11", 30 | "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", 31 | "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", 32 | "dev": true, 33 | "requires": { 34 | "lodash": "^4.17.14" 35 | } 36 | }, 37 | "entities": { 38 | "version": "1.1.2", 39 | "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", 40 | "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", 41 | "dev": true 42 | }, 43 | "escape-string-regexp": { 44 | "version": "2.0.0", 45 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", 46 | "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", 47 | "dev": true 48 | }, 49 | "graceful-fs": { 50 | "version": "4.2.3", 51 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", 52 | "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", 53 | "dev": true 54 | }, 55 | "js2xmlparser": { 56 | "version": "4.0.0", 57 | "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.0.tgz", 58 | "integrity": "sha512-WuNgdZOXVmBk5kUPMcTcVUpbGRzLfNkv7+7APq7WiDihpXVKrgxo6wwRpRl9OQeEBgKCVk9mR7RbzrnNWC8oBw==", 59 | "dev": true, 60 | "requires": { 61 | "xmlcreate": "^2.0.0" 62 | } 63 | }, 64 | "jsdoc": { 65 | "version": "3.6.3", 66 | "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.3.tgz", 67 | "integrity": "sha512-Yf1ZKA3r9nvtMWHO1kEuMZTlHOF8uoQ0vyo5eH7SQy5YeIiHM+B0DgKnn+X6y6KDYZcF7G2SPkKF+JORCXWE/A==", 68 | "dev": true, 69 | "requires": { 70 | "@babel/parser": "^7.4.4", 71 | "bluebird": "^3.5.4", 72 | "catharsis": "^0.8.11", 73 | "escape-string-regexp": "^2.0.0", 74 | "js2xmlparser": "^4.0.0", 75 | "klaw": "^3.0.0", 76 | "markdown-it": "^8.4.2", 77 | "markdown-it-anchor": "^5.0.2", 78 | "marked": "^0.7.0", 79 | "mkdirp": "^0.5.1", 80 | "requizzle": "^0.2.3", 81 | "strip-json-comments": "^3.0.1", 82 | "taffydb": "2.6.2", 83 | "underscore": "~1.9.1" 84 | } 85 | }, 86 | "klaw": { 87 | "version": "3.0.0", 88 | "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", 89 | "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", 90 | "dev": true, 91 | "requires": { 92 | "graceful-fs": "^4.1.9" 93 | } 94 | }, 95 | "linkify-it": { 96 | "version": "2.2.0", 97 | "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", 98 | "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", 99 | "dev": true, 100 | "requires": { 101 | "uc.micro": "^1.0.1" 102 | } 103 | }, 104 | "lodash": { 105 | "version": "4.17.15", 106 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", 107 | "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", 108 | "dev": true 109 | }, 110 | "markdown-it": { 111 | "version": "8.4.2", 112 | "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", 113 | "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", 114 | "dev": true, 115 | "requires": { 116 | "argparse": "^1.0.7", 117 | "entities": "~1.1.1", 118 | "linkify-it": "^2.0.0", 119 | "mdurl": "^1.0.1", 120 | "uc.micro": "^1.0.5" 121 | } 122 | }, 123 | "markdown-it-anchor": { 124 | "version": "5.2.5", 125 | "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.2.5.tgz", 126 | "integrity": "sha512-xLIjLQmtym3QpoY9llBgApknl7pxAcN3WDRc2d3rwpl+/YvDZHPmKscGs+L6E05xf2KrCXPBvosWt7MZukwSpQ==", 127 | "dev": true 128 | }, 129 | "marked": { 130 | "version": "0.7.0", 131 | "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", 132 | "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", 133 | "dev": true 134 | }, 135 | "mdurl": { 136 | "version": "1.0.1", 137 | "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", 138 | "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", 139 | "dev": true 140 | }, 141 | "minimist": { 142 | "version": "0.0.8", 143 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 144 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 145 | "dev": true 146 | }, 147 | "mkdirp": { 148 | "version": "0.5.1", 149 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 150 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 151 | "dev": true, 152 | "requires": { 153 | "minimist": "0.0.8" 154 | } 155 | }, 156 | "requizzle": { 157 | "version": "0.2.3", 158 | "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", 159 | "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", 160 | "dev": true, 161 | "requires": { 162 | "lodash": "^4.17.14" 163 | } 164 | }, 165 | "sprintf-js": { 166 | "version": "1.0.3", 167 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 168 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 169 | "dev": true 170 | }, 171 | "strip-json-comments": { 172 | "version": "3.0.1", 173 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", 174 | "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", 175 | "dev": true 176 | }, 177 | "taffydb": { 178 | "version": "2.6.2", 179 | "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", 180 | "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", 181 | "dev": true 182 | }, 183 | "uc.micro": { 184 | "version": "1.0.6", 185 | "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", 186 | "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", 187 | "dev": true 188 | }, 189 | "underscore": { 190 | "version": "1.9.1", 191 | "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", 192 | "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", 193 | "dev": true 194 | }, 195 | "xmlcreate": { 196 | "version": "2.0.1", 197 | "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.1.tgz", 198 | "integrity": "sha512-MjGsXhKG8YjTKrDCXseFo3ClbMGvUD4en29H2Cev1dv4P/chlpw6KdYmlCWDkhosBVKRDjM836+3e3pm1cBNJA==", 199 | "dev": true 200 | } 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsdoc_example", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "doc": "jsdoc -c jsdoc.json" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "jsdoc": "^3.6.3" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # JSDoc Example 2 | 3 | This is some example code to show you how to use JSDoc for documenting your JavaScript and also using it for type checking. 4 | 5 | ### Usage 6 | 7 | ``` 8 | npm install 9 | # Generate a docs folder with the documentation website 10 | npm run doc 11 | ``` 12 | -------------------------------------------------------------------------------- /readme/readme.md: -------------------------------------------------------------------------------- 1 | This is just a sample script on how to use JSDoc 2 | -------------------------------------------------------------------------------- /src/calculator.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Calculator module - See {@tutorial calculator-tutorial} 3 | * @module calculator 4 | */ 5 | 6 | /** 7 | * Add two numbers 8 | * @param {number} n1 - First number 9 | * @param {number} n2 - Second number 10 | * @returns {number} - Sum of n1 and n2 11 | */ 12 | exports.add = (n1, n2) => n1 + n2; 13 | 14 | /** 15 | * Multiply two numbers 16 | * @param {number} n1 - First number 17 | * @param {number} n2 - Second number 18 | * @returns {number} - Product of n1 and n2 19 | */ 20 | exports.multiply = (n1, n2) => n1 * n2; 21 | 22 | /** 23 | * Subtract two numbers 24 | * @param {number} n1 - First number 25 | * @param {number} n2 - Second number 26 | * @returns {number} - Difference of n1 and n2 27 | */ 28 | exports.subtract = (n1, n2) => n1 - n2; 29 | 30 | /** 31 | * Divide two numbers 32 | * @param {number} n1 - First number 33 | * @param {number} n2 - Second number 34 | * @returns {number} - Quotient of n1 and n2 35 | */ 36 | exports.divide = (n1, n2) => n1 / n2; 37 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | const { add, subtract, divide, multiply } = require('./calculator'); 3 | 4 | /** 5 | * @file index.js is the root file for this example app 6 | * @author Brad Traversy 7 | * @see Traversy Media 8 | */ 9 | 10 | /** 11 | * Student Name 12 | * @type {string} 13 | */ 14 | const studentName = 'John Doe'; 15 | 16 | /** 17 | * Array of grades 18 | * @type {Array} 19 | */ 20 | const grades = [98, 97.7, 76, 89]; 21 | 22 | /** 23 | * Todo object 24 | * @type {{id: number|string, text: string}} 25 | */ 26 | const todo = { 27 | id: '1', 28 | text: 'Hello' 29 | }; 30 | 31 | /** 32 | * Calculate tax 33 | * @param {number} amount - Total amount 34 | * @param {number} tax - Tax percentage 35 | * @returns {string} - Total with a dollar sign 36 | */ 37 | const calculateTax = (amount, tax) => { 38 | return `$${amount + tax * amount}`; 39 | }; 40 | 41 | /** 42 | * A student 43 | * @typedef {Object} Student 44 | * @property {number} id - Student ID 45 | * @property {string} name - Student name 46 | * @property {string|number} [age] - Student age (optional) 47 | * @property {boolean} isActive - Student is active 48 | */ 49 | 50 | /** 51 | * @type {Student} 52 | */ 53 | const student = { 54 | id: 1, 55 | name: 'John Doe', 56 | age: 20, 57 | isActive: true 58 | }; 59 | 60 | /** 61 | * Class to create a person object 62 | */ 63 | class Person { 64 | /** 65 | * 66 | * @param {Object} personInfo Information about the person 67 | */ 68 | constructor(personInfo) { 69 | /** 70 | * @property {string} name Persons name 71 | */ 72 | this.name = personInfo.name; 73 | /** 74 | * @property {string} age Persons age 75 | */ 76 | this.age = personInfo.age; 77 | } 78 | 79 | /** 80 | * @property {Function} greet A greeting with the name and age 81 | * @returns void 82 | */ 83 | greet() { 84 | console.log(`Hello, my name is ${this.name} and I am ${this.age}`); 85 | } 86 | } 87 | 88 | /** 89 | * See {@link Person} 90 | */ 91 | const person1 = new Person({ 92 | name: 'John Doe', 93 | age: 30 94 | }); 95 | 96 | console.log(add(20, 30)); 97 | -------------------------------------------------------------------------------- /tutorials/calculator-tutorial.md: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eligendi at perferendis nesciunt ex impedit amet cumque ullam magni enim. Ab debitisreiciendis, nemo rem eius et quaerat quis iste ea, commodi aliquamdelectus eveniet, ut nisi numquam impedit vero deleniti? Hic aspernatur 2 | cumque laboriosam aliquid tenetur tempora, officia, quas placeat deserunt 3 | -------------------------------------------------------------------------------- /tutorials/program-tutorial.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Program Tutorial 8 | 9 | 10 |

    11 | Lorem ipsum dolor sit amet consectetur adipisicing elit. A consequuntur 12 | saepe libero eveniet quia perferendis autem vitae rem minima, molestias 13 | quo consequatur. Repellat facere enim distinctio culpa tenetur corrupti 14 | sit officia ratione laboriosam quo fuga soluta ducimus necessitatibus 15 | quasi, rerum voluptates, similique voluptas ut quaerat quisquam, pariatur 16 | optio voluptatibus. Reprehenderit. 17 |

    18 | 19 | 20 | -------------------------------------------------------------------------------- /tutorials/tutorials.json: -------------------------------------------------------------------------------- 1 | { 2 | "program-tutorial": { 3 | "title": "Program Tutorial" 4 | }, 5 | "calculator-tutorial": { 6 | "title": "Calculator Tutorial" 7 | } 8 | } 9 | --------------------------------------------------------------------------------