Skip to content

Commit

Permalink
Disable the annotation, but keep the javascript link processing for f…
Browse files Browse the repository at this point in the history
…uture re-use
  • Loading branch information
ptheywood committed Feb 28, 2024
1 parent 7795429 commit d5be8f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
22 changes: 5 additions & 17 deletions _static/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,15 @@ so cannot use sphinx :ref: for output destination URIs relative to the current p
Instead, find the appropriate link within the current page, to add the anchor to the announcement.
This does not currently support linking outside of the documentation website.
*/
/*
window.onload = function () {
// Only apply the link if the annoucement content matches (incase the announcement is changed but this file is not.)
expectedAnnouncementContent = "MFA Deployment in Progress";
// The label for the TOC navigation link which is to be linked against, i.e. the top level title in the page.
expectedAnchorContent = "Using Bede";
// If linking to a specific sub-section via sphinx generated ID, manually specify it here.
optionalTargetID = "#multi-factor-authentication";
// Remove a potential initial # from the above URI, to make latter processing simpler.
// This could be made more robust, in case of multiple hashes.
if (optionalTargetID && optionalTargetID.startsWith("#")) {
optionalTargetID = optionalTargetID.slice(1);
}
/* window.onload = function () {
expectedAnnouncementContent = "";
expectedAnchorContent = "";
var elements = document.getElementsByClassName("announcement");
for (var i = 0; i < elements.length; i++) {
var element = elements.item(i);
originalContent = element.innerHTML;
if(originalContent.toLowerCase().includes(expectedAnnouncementContent.toLowerCase())) {
// Iterate the TOC until the link with the expected content is found for the requested page.
// Grab the link to the destination page from the toc.
anchorList = document.querySelectorAll(".toctree-l1>a.reference.internal");
for (var j = 0; j < anchorList.length; j++) {
anchor = anchorList[j];
Expand All @@ -45,5 +34,4 @@ window.onload = function () {
}
}
}
}
*/
} */
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
# Reset the navigation bar footer (html)
"extra_navbar": "",
# Add an announcement bar, visible at the top of each page.
# "announcement": "MFA Deployment in Progress",
# "announcement": "",
# Add the traditional footer theme and sphinx acknowledgements
"extra_footer": f"Built with <a href=\"http://sphinx-doc.org/\">Sphinx</a> {sphinx.__version__} using a theme by the <a href=\"https://ebp.jupyterbook.org/\">Executable Book Project</a>."
}
Expand Down

0 comments on commit d5be8f3

Please sign in to comment.