diff options
author | Hubert Argasinski <argasinski.hubert@gmail.com> | 2016-10-07 20:47:20 -0400 |
---|---|---|
committer | Hubert Argasinski <argasinski.hubert@gmail.com> | 2016-10-07 20:47:20 -0400 |
commit | f71da34695ab46a5b9605c496532f33db49b2069 (patch) | |
tree | 9f66cb3e086320fd4a1b50460a396180a9bd91ab | |
parent | 0b7ebe43f0e18fe7894f52d018cb9846850fdca3 (diff) | |
download | async-f71da34695ab46a5b9605c496532f33db49b2069.tar.gz |
docs: highlight current method in toc when viewing source file
-rw-r--r-- | support/jsdoc/jsdoc-fix-html.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/support/jsdoc/jsdoc-fix-html.js b/support/jsdoc/jsdoc-fix-html.js index 531ba5a..c33de90 100644 --- a/support/jsdoc/jsdoc-fix-html.js +++ b/support/jsdoc/jsdoc-fix-html.js @@ -22,6 +22,12 @@ var additionalFooterText = ' Documentation has been modified from the original. ' For more information, please see the <a href="https://github.com/caolan/async">async</a> repository.'; function generateHTMLFile(filename, $page, callback) { + var methodName = filename.match(/\/(\w+)\.js\.html$/); + if (methodName) { + var $thisMethodDocLink = $page.find('#toc').find('a[href="'+docFilename+'#'+methodName[1]+'"]'); + $thisMethodDocLink.parent().addClass('active'); + } + // generate an HTML file from a cheerio object var HTMLdata = HTMLFileBegin + $page.find('head').html() + HTMLFileHeadBodyJoin + $page.find('body').html() |