Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorVitor Balocco <vitorbal@gmail.com>2011-09-16 01:22:05 +0400
committerkoichik <koichik@improvement.jp>2011-09-21 16:08:53 +0400
commit97d355c273583ec6226ab3f4f49bc909164bf801 (patch)
tree7c1e2fd5b59b1a6c7d566895a99e04deff02a57c /tools
parentb93a7cc99e0251a2bfc2e4851b833faac49260d2 (diff)
docs: Add anchor links next to each function
Modify doctool.js to automatically create anchor links for every function, for easy linking. Include support for functions that have a <h4> level Fixes: #1718.
Diffstat (limited to 'tools')
-rw-r--r--tools/doctool/doctool.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/doctool/doctool.js b/tools/doctool/doctool.js
index 4b4f2f07b7f..da31445fe13 100644
--- a/tools/doctool/doctool.js
+++ b/tools/doctool/doctool.js
@@ -88,6 +88,9 @@ function convertData(data) {
.replace(/<hr><\/hr>/g, "<hr />")
.replace(/(\<h[2-6])\>([^<]+)(\<\/h[1-6]\>)/gmi, function(o, ts, c, te) {
return ts+' id="'+formatIdString(c)+'">'+c+te;
+ })
+ .replace(/(\<h[3-4][^>]+\>)([^<]+)(\<\/h[3-4]\>)/gmi, function(o, ts, c, te) {
+ return ts+c+' <a href="#'+formatIdString(c)+'">#</a>'+te;
});
return html;