diff --git a/book/style.css b/book/style.css index 7a1c2a2..7d919df 100644 --- a/book/style.css +++ b/book/style.css @@ -62,6 +62,18 @@ main.main-content,main.titlepage,div.footnotes{ padding:1rem; } +.sectionHead a.permalink { + opacity: 0.5; + text-decoration: none; + font-size: 0.75rem; + vertical-align: top; + line-height: 0.8rem; + margin-left: 0.25rem; + padding-top: 0.2rem; + color: black; + display: inline-block; +} + p.indent, p.noindent{ text-indent: 0; text-align: justify; diff --git a/website/assets/script.js b/website/assets/script.js index 69c4906..e7127e5 100644 --- a/website/assets/script.js +++ b/website/assets/script.js @@ -8,4 +8,14 @@ document.addEventListener('DOMContentLoaded', function() { }); } }); + + // Add permalinks to headers + var heads = document.querySelectorAll('.sectionHead'); + heads.forEach(function (head) { + let permalink = document.createElement("a"); + permalink.href = '#' + head.id; + permalink.classList.add('permalink'); + permalink.append('🔗'); + head.append(permalink); + }); });