diff --git a/javascript/DocumentationViewer.js b/javascript/DocumentationViewer.js
index 1d0e7a5..129184c 100644
--- a/javascript/DocumentationViewer.js
+++ b/javascript/DocumentationViewer.js
@@ -7,7 +7,6 @@
*
* Transform a #table-of-contents div to a nested list
*/
-
if($("#table-of-contents").length > 0) {
var toc = '
In this document:
';
@@ -21,6 +20,24 @@
$('#table-of-contents').prepend(toc);
}
+ /** ---------------------------------------------
+ * HEADING ANCHOR LINKS
+ *
+ * Automatically adds anchor links to headings that have IDs
+ */
+ $("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").each(function() {
+ var link = '¶';
+ $(this).append(' ' + link);
+ });
+
+ $("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").mouseenter(function() {
+ $(this).addClass('hover');
+ });
+
+ $("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").mouseleave(function() {
+ $(this).removeClass('hover');
+ });
+
/** ---------------------------------------------
* LANGAUGE SELECTER
*