Skip to content

Commit d0ecb74

Browse files
authored
Add a banner and log to information about the migration to Notebook 7 plan (#6742)
* Add a banner to inform about the migration plan to notebook 7 * remove trailing spaces
1 parent 8773864 commit d0ecb74

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

notebook/notebookapp.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,20 @@ def __init__(self, jupyter_app, kernel_manager, contents_manager,
185185
if settings['autoreload']:
186186
log.info('Autoreload enabled: the webapp will restart when any Python src file changes.')
187187

188+
print("""
189+
_ _ _ _
190+
| | | |_ __ __| |__ _| |_ ___
191+
| |_| | '_ \/ _` / _` | _/ -_)
192+
\___/| .__/\__,_\__,_|\__\___|
193+
|_|
194+
195+
Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.
196+
197+
https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html
198+
199+
Please note that updating to Notebook 7 might break some of your extensions.
200+
""")
201+
188202
super().__init__(handlers, **settings)
189203

190204
def init_settings(self, jupyter_app, kernel_manager, contents_manager,

notebook/templates/page.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,25 @@
135135
</noscript>
136136

137137
<div id="header" role="navigation" aria-label="{% trans %}Top Menu{% endtrans %}">
138+
<div id="newsId" style="display: none">
139+
<div class="alert alert-info" role="alert">
140+
<div style="display: flex">
141+
<div>
142+
<span class="label label-warning">UPDATE</span>
143+
Read <a href="https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html" style="text-decoration: underline;" target="_blank">the migration plan</a> to Notebook 7 to learn about the new features and the actions to take if you are using extensions
144+
-
145+
Please note that updating to Notebook 7 might break some of your extensions.
146+
</div>
147+
<div style="margin-left: auto;">
148+
<a href="" onclick="alert('This message will not be shown anymore.'); return false;">
149+
<button type="button" class="btn btn-default btn-xs" id="dontShowId">
150+
Don't show anymore
151+
</button>
152+
</a>
153+
</div>
154+
</div>
155+
</div>
156+
</div>
138157
<div id="header-container" class="container">
139158
<div id="ipython_notebook" class="nav navbar-brand"><a href="{{default_url}}
140159
{%- if logged_in and token -%}?token={{token}}{%- endif -%}" title='{% trans %}dashboard{% endtrans %}'>
@@ -203,6 +222,16 @@
203222
}
204223
_remove_token_from_url();
205224
sys_info = {{sys_info|safe}};
225+
document.addEventListener('DOMContentLoaded', function () {
226+
const newsId = document.querySelector('#newsId');
227+
const dontShowId = document.querySelector('#dontShowId');
228+
const showNotebookNews = localStorage.getItem('showNotebookNews');
229+
dontShowId.addEventListener('click', () => {
230+
localStorage.setItem('showNotebookNews', false);
231+
newsId.style.display = 'none';
232+
});
233+
if (!showNotebookNews) newsId.style.display = 'inline';
234+
});
206235
</script>
207236
</body>
208237

0 commit comments

Comments
 (0)