This commit is contained in:
Garrett Moon
2017-03-13 14:31:09 -07:00
parent 1718eb8bd7
commit 9c3c5d7554
359 changed files with 66302 additions and 0 deletions

22
docs/static/linkify.js vendored Executable file
View File

@@ -0,0 +1,22 @@
[].slice.apply(
document.querySelectorAll(
'article h2, article h3, article h4'
)
).forEach(function(header) {
var slug = header.innerText
.toLowerCase()
.replace(/[^a-z0-9]/g, '-')
.replace(/-+/g, '-')
.replace(/^-|-$/g, '');
var hashref = document.createElement('a');
hashref.id = slug;
hashref.className = 'hashref';
header.appendChild(hashref);
var hash = document.createElement('a');
hash.className = 'hash';
hash.href = '#' + slug;
hash.innerText = '#';
header.appendChild(hash);
});