From 23c6749de27fb46cebb4f1502622b75c450a2c1d Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sat, 23 Sep 2023 22:36:20 +1000 Subject: [PATCH] Update footnotes for new Sphinx --- _static/custom.css | 9 +++------ _static/custom.js | 2 +- _static/custom_html.css | 6 +++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/_static/custom.css b/_static/custom.css index 6ea7778..0fee5a6 100644 --- a/_static/custom.css +++ b/_static/custom.css @@ -12,13 +12,10 @@ sup { /* Format multiple footnote backlinks */ -span.fn-backref { +.footnote-list .footnote .backrefs { display: none; } -dl.footnote span.brackets:not(:last-child)::before { - content: '['; -} -dl.footnote span.brackets:not(:last-child)::after { - content: ']'; +.fn-bracket { + display: none; } diff --git a/_static/custom.js b/_static/custom.js index f07c392..862a4a4 100644 --- a/_static/custom.js +++ b/_static/custom.js @@ -2,7 +2,7 @@ function initFootnotes() { var elPreview = document.getElementById('footnote-preview'); function mouseoverFootnote(evt) { - var fnText = document.querySelector(evt.target.getAttribute('href')).nextElementSibling.children[0].innerHTML; + var fnText = document.querySelector(evt.target.getAttribute('href') + ' p').innerHTML; elPreview.innerHTML = fnText; elPreview.style.display = 'block'; elPreview.style.top = (evt.target.getBoundingClientRect().top + 16) + 'px'; diff --git a/_static/custom_html.css b/_static/custom_html.css index 119d3cc..de17dfc 100644 --- a/_static/custom_html.css +++ b/_static/custom_html.css @@ -57,11 +57,11 @@ a, a.reference, a.footnote-reference { /* Footnotes */ -dl.footnote dt { +.footnote-list .footnote { position: relative; } -span.fn-backref { +.footnote-list .footnote .backrefs { position: absolute; background-color: white; z-index: 999; @@ -71,7 +71,7 @@ span.fn-backref { top: -3px; } -dl.footnote dt:hover span.fn-backref { +.footnote-list .footnote:hover .backrefs { display: inline; }