Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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.
  • Loading branch information...
vitorbal authored and koichik committed Sep 15, 2011
1 parent b93a7cc commit 97d355c273583ec6226ab3f4f49bc909164bf801
Showing with 13 additions and 1 deletion.
  1. +10 −1 doc/api_assets/style.css
  2. +3 −0 tools/doctool/doctool.js
@@ -126,6 +126,15 @@ h4 + h4 {
margin: 0 0 0.5em;
}

h3 a,
h4 a {
font-size: 0.8em;
float: right;
color: #000;
text-decoration: none;
opacity: 0.3;
}

h5 {
font-size: 1.125em;
line-height: 1.4em;
@@ -232,4 +241,4 @@ a.octothorpe {
h5:hover > a.octothorpe,
h6:hover > a.octothorpe {
opacity: 1;
}
}
@@ -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;

0 comments on commit 97d355c

Please sign in to comment.
You can’t perform that action at this time.