summaryrefslogtreecommitdiffstats
path: root/index.js
blob: f081872e4bd2ca722848a17d6fd61f390d4f6604 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* global Awesomplete, $:true, $$:true */
$ = Awesomplete.$;
$$ = Awesomplete.$$;

document.addEventListener("DOMContentLoaded", function() {
	var nav = $("nav")
	$$("section > h1").forEach(function (h1) {
		if (h1.parentNode.id) {
			$.create("a", {
				href: "#" + h1.parentNode.id,
				textContent: h1.textContent.replace(/\(.+?\)/g, ""),
				inside: nav
			});
		}
	});
});