diff options
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/index.js b/index.js new file mode 100644 index 0000000..ff15e83 --- /dev/null +++ b/index.js @@ -0,0 +1,13 @@ +$ = Awesomplete.$; +$$ = Awesomplete.$$; + +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 + }); + } +}); |