Skip to content

Commit 00e3836

Browse files
echarlesisabela-pfafshin
authored
Add news banner and log (#215)
* add news banner and log * docs: create a nbclassic_notebook page * Update docs/source/nbclassic.rst Co-authored-by: Isabela Presedo-Floyd <[email protected]> * Update nbclassic/templates/page.html Co-authored-by: Isabela Presedo-Floyd <[email protected]> * Update docs/source/nbclassic_notebook.rst Co-authored-by: Afshin Taylor Darian <[email protected]> * Update docs/source/nbclassic_notebook.rst Co-authored-by: Afshin Taylor Darian <[email protected]> * Update docs/source/nbclassic_notebook.rst Co-authored-by: Afshin Taylor Darian <[email protected]> * update banner and log based on #214 * remove nbclassic_notebook doc, and move it to latest notebook rtd * docs: fix link to migration plan * docs: add back link in nbclassic.rst --------- Co-authored-by: Isabela Presedo-Floyd <[email protected]> Co-authored-by: Afshin Taylor Darian <[email protected]>
1 parent 16441f6 commit 00e3836

File tree

4 files changed

+49
-68
lines changed

4 files changed

+49
-68
lines changed

docs/source/nbclassic.rst

Lines changed: 4 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ way to continue using the Jupyter Notebook 6 tech-stack as they
2020
transition to using the Jupyter Notebook 7. The NbClassic package
2121
intends to address that need.
2222

23+
You can read more about the migration impacts and coexistence of NbClassic and Notebook package on
24+
the `NbClassic and Notebook mibration plan <https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html>`_ page.
25+
2326
.. _Jupyter Enhancement Proposal #79: https://jupyter.org/enhancement-proposals/79-notebook-v7/notebook-v7.html
2427

2528
.. _NbClassicUsage:
@@ -55,72 +58,6 @@ You can view a list of the available options by typing::
5558
$ jupyter nbclassic --help
5659
5760

58-
NbClassic in the Jupyter Ecosystem
59-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60-
Read more details about the changes currently taking place in the
61-
Jupyter Ecosystem in this `team-compass issue`_.
62-
63-
**NbClassic and Notebook 7**
64-
65-
You can install NbClassic, Notebook 7 and JupyterLab, all three of
66-
which will be providing different user interfaces that will be available
67-
on the same server. When Notebook 7 is available, the NbClassic UI, will
68-
be served at the ``/nbclassic/tree`` base path rather than the
69-
base path ``/tree`` used otherwise. If you are using Notebook 7 along
70-
with NbClassic, you wil also have JupyterLab installed as it is a
71-
dependency of Notebook 7, and these front ends will be available
72-
through the following base paths: JupyterLab at ``/lab``, Notebook 7 at
73-
``/tree``, and NbClassic at ``/nbclassic/tree``.
74-
75-
**NbClassic and Notebook 6.5.x**
76-
77-
As NbClassic provides the static assets for Notebook 6.5.x, while
78-
having both installed should cause no issues, the user interface provided
79-
by these two packages will be the same. These UIs would be available in
80-
different servers. An NbClassic instance will be at a server with the
81-
``/tree`` path and opening a Notebook 6.5.x instance will open on a
82-
different server with the ``/tree`` path as well, presenting the same
83-
static assets. When starting an instance of JupyterLab you will be able
84-
to access the classic view of Notebook with NbClassic served on the same
85-
server at ``/tree``.
86-
87-
**NbClassic and Notebook <= 6.4.x**
88-
89-
When using NbClassic and Notebook <= 6.4.x you can expect that these UIs
90-
will not be only presented at different servers, meaning they will both
91-
be available at their respective server under ``/tree`` but they
92-
may also differ as potential changes to the NbClassic UI will not be
93-
reflected in Notebook versions <= 6.4.x. In this case as well, you would
94-
be able to access the classic view of Notebook with NbClassic served on
95-
the same server, at ``/tree``.
96-
97-
**NbClassic and JupyterLab 3.x**
98-
99-
When only JupyterLab 3.x is installed, then NbClassic does not have to be
100-
explicitly installed as JupyterLab 3.x depends on it. They will run on
101-
the same server, and are reachable via ``/tree`` for NbClassic and
102-
``/lab`` for JupyterLab.
103-
104-
**NbClassic and JupyterLab 4.x**
105-
106-
When only JupyterLab 4.x is installed, then NbClassic has to be installed
107-
explictly. They will run on the same server, and are reachable via
108-
``/tree`` for NbClassic, and ``/lab`` for JupyterLab.
109-
110-
**NbClassic Independently**
111-
112-
When you choose to install only NbClassic via ``pip install nbclassic``,
113-
the classic Notebook UI will be presented at the ``/tree`` path. As the
114-
other frontends are not installed, attempting to access the other paths
115-
will return errors. Note that NbClassic being a Jupyter Server extension,
116-
indicated Jupyter Server will be available. This provides an additional
117-
way to view the NbClassic frontend. You would be able to manually
118-
enable the extension when running an instance of Jupyter Server,
119-
``> jupyter server --ServerApp.jpserver_extensions="nbclassic=True"``,
120-
which will provide the NbClassic frontend at ``/tree`` path when visited.
121-
122-
.. _team-compass issue: https://github.com/jupyter/notebook-team-compass/issues/5#issuecomment-1085254000
123-
12461
NbClassic Development
12562
---------------------
12663

@@ -148,5 +85,5 @@ Jupyter Notebook 7.
14885
ou can find a helpful list of classical Notebook extensions and corresponding Jupyterlab extensions
14986
if available at the `Jupyterlab-contrib website <https://jupyterlab-contrib.github.io/migrate_from_classical.html>`_.
15087

88+
.. _JEP #79: https://jupyter.org/enhancement-proposals/79-notebook-v7/notebook-v7.html
15189

152-
.. _JEP #79: https://jupyter.org/enhancement-proposals/79-notebook-v7/notebook-v7.html

nbclassic/notebookapp.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,20 @@ def initialize_handlers(self):
325325
router.add_rules(core_rules)
326326
router.add_rules(static_handlers)
327327
router.add_rules(final_rules)
328+
print("""
329+
_ _ _ _
330+
| | | |_ __ __| |__ _| |_ ___
331+
| |_| | '_ \/ _` / _` | _/ -_)
332+
\___/| .__/\__,_\__,_|\__\___|
333+
|_|
334+
335+
Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.
336+
337+
https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html
338+
339+
Please note that updating to Notebook 7 might break some of your extensions.
340+
""")
341+
328342

329343
# -----------------------------------------------------------------------------
330344
# Main entry point

nbclassic/static/base/js/namespace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ define(function(){
7373
// tree
7474
jglobal('SessionList','tree/js/sessionlist');
7575

76-
Jupyter.version = "0.5.1";
76+
Jupyter.version = "0.6.0.dev0";
7777
Jupyter._target = '_blank';
7878

7979
return Jupyter;

nbclassic/templates/page.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,26 @@
137137
</noscript>
138138

139139
<div id="header" role="navigation" aria-label="{% trans %}Top Menu{% endtrans %}">
140+
<div id="newsId" style="display: none">
141+
<div class="alert alert-info" role="alert">
142+
<div style="display: flex">
143+
<div>
144+
<span class="label label-warning">UPDATE</span>
145+
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
146+
-
147+
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
148+
Please note that updating to Notebook 7 might break some of your extensions.
149+
</div>
150+
<div style="margin-left: auto;">
151+
<a href="" onclick="alert('This message will not be shown anymore.'); return false;">
152+
<button type="button" class="btn btn-default btn-xs" id="dontShowId">
153+
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Don't show anymore
154+
</button>
155+
</a>
156+
</div>
157+
</div>
158+
</div>
159+
</div>
140160
<div id="header-container" class="container">
141161
<div id="ipython_notebook" class="nav navbar-brand"><a href="
142162
<div id="ipython_notebook" class="nav navbar-brand"><a href="{{default_url}}
@@ -205,6 +225,16 @@
205225
}
206226
}
207227
_remove_token_from_url();
228+
document.addEventListener('DOMContentLoaded', function () {
229+
const newsId = document.querySelector('#newsId');
230+
const dontShowId = document.querySelector('#dontShowId');
231+
const showNbClassicNews = localStorage.getItem('showNbClassicNews');
232+
dontShowId.addEventListener('click', () => {
233+
localStorage.setItem('showNbClassicNews', false);
234+
newsId.style.display = 'none';
235+
});
236+
if (!showNbClassicNews) newsId.style.display = 'inline';
237+
});
208238
</script>
209239
</body>
210240

0 commit comments

Comments
 (0)