Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activate pydata-sphinx-theme version banner #13824

Open
mosc9575 opened this issue Apr 12, 2024 · 0 comments
Open

activate pydata-sphinx-theme version banner #13824

mosc9575 opened this issue Apr 12, 2024 · 0 comments

Comments

@mosc9575
Copy link
Contributor

Since bokeh 3.2.2 the version banner is broken and a JS error appears in the browser console. See

The error

Uncaught ReferenceError: $ is not defined
    <anonymous> https://docs.bokeh.org/en/3.2.2/_static/custom.js:11

is caused by

// Display a version warning banner if necessary
$(document).ready(function () {
const randid = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
$.getJSON('/switcher.json?v=' + randid , function (data) {
// old versions have a unified latest/x.y.z, things are split starting with 3.0
if (BOKEH_CURRENT_VERSION != data[1].version) {
let msg
if (data.findIndex((elt) => elt.version == BOKEH_CURRENT_VERSION) < 0 ) {
msg = "DEVELOPMENT / PRE-RELEASE"
} else {
msg = "PREVIOUS RELEASE"
}
const content = $('<div class="version-alert">This page is documentation for a ' + msg + ' version. For the latest release, go to <a href="https://docs.bokeh.org/en/latest/">https://docs.bokeh.org/en/latest/</a></div>')
$('#banner').append(content);
}
})
})

The pydata-sphinx-theme offers the opportunity to add a version banner. This was mentioned in #13789 (comment)

Just noting that I believe version warning banners are now built into the theme, so you could try using that and see if that removes > the error

https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/announcements.html#version-warning-banners

The goal of this issue should be to remove the custom solution, silence the JS error and activate the theme banner by pydata-sphinx-theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants