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

Add news banner and log #215

Merged
merged 11 commits into from
Feb 17, 2023
72 changes: 3 additions & 69 deletions docs/source/nbclassic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ way to continue using the Jupyter Notebook 6 tech-stack as they
transition to using the Jupyter Notebook 7. The NbClassic package
intends to address that need.

You can read more about the migration impacts and coexistence of NbClassic and Notebook package on
the `NbClassic and Notebook mibration plan <https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html>`_ page.

.. _Jupyter Enhancement Proposal #79: https://jupyter.org/enhancement-proposals/79-notebook-v7/notebook-v7.html

.. _NbClassicUsage:
Expand Down Expand Up @@ -55,72 +58,6 @@ You can view a list of the available options by typing::
$ jupyter nbclassic --help


NbClassic in the Jupyter Ecosystem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Read more details about the changes currently taking place in the
Jupyter Ecosystem in this `team-compass issue`_.

**NbClassic and Notebook 7**

You can install NbClassic, Notebook 7 and JupyterLab, all three of
which will be providing different user interfaces that will be available
on the same server. When Notebook 7 is available, the NbClassic UI, will
be served at the ``/nbclassic/tree`` base path rather than the
base path ``/tree`` used otherwise. If you are using Notebook 7 along
with NbClassic, you wil also have JupyterLab installed as it is a
dependency of Notebook 7, and these front ends will be available
through the following base paths: JupyterLab at ``/lab``, Notebook 7 at
``/tree``, and NbClassic at ``/nbclassic/tree``.

**NbClassic and Notebook 6.5.x**

As NbClassic provides the static assets for Notebook 6.5.x, while
having both installed should cause no issues, the user interface provided
by these two packages will be the same. These UIs would be available in
different servers. An NbClassic instance will be at a server with the
``/tree`` path and opening a Notebook 6.5.x instance will open on a
different server with the ``/tree`` path as well, presenting the same
static assets. When starting an instance of JupyterLab you will be able
to access the classic view of Notebook with NbClassic served on the same
server at ``/tree``.

**NbClassic and Notebook <= 6.4.x**

When using NbClassic and Notebook <= 6.4.x you can expect that these UIs
will not be only presented at different servers, meaning they will both
be available at their respective server under ``/tree`` but they
may also differ as potential changes to the NbClassic UI will not be
reflected in Notebook versions <= 6.4.x. In this case as well, you would
be able to access the classic view of Notebook with NbClassic served on
the same server, at ``/tree``.

**NbClassic and JupyterLab 3.x**

When only JupyterLab 3.x is installed, then NbClassic does not have to be
explicitly installed as JupyterLab 3.x depends on it. They will run on
the same server, and are reachable via ``/tree`` for NbClassic and
``/lab`` for JupyterLab.

**NbClassic and JupyterLab 4.x**

When only JupyterLab 4.x is installed, then NbClassic has to be installed
explictly. They will run on the same server, and are reachable via
``/tree`` for NbClassic, and ``/lab`` for JupyterLab.

**NbClassic Independently**

When you choose to install only NbClassic via ``pip install nbclassic``,
the classic Notebook UI will be presented at the ``/tree`` path. As the
other frontends are not installed, attempting to access the other paths
will return errors. Note that NbClassic being a Jupyter Server extension,
indicated Jupyter Server will be available. This provides an additional
way to view the NbClassic frontend. You would be able to manually
enable the extension when running an instance of Jupyter Server,
``> jupyter server --ServerApp.jpserver_extensions="nbclassic=True"``,
which will provide the NbClassic frontend at ``/tree`` path when visited.

.. _team-compass issue: https://github.com/jupyter/notebook-team-compass/issues/5#issuecomment-1085254000

NbClassic Development
---------------------

Expand All @@ -147,6 +84,3 @@ Jupyter Notebook 7.
**Porting Notebook 6 Extensions**: Work being done in parallel.
ou can find a helpful list of classical Notebook extensions and corresponding Jupyterlab extensions
if available at the `Jupyterlab-contrib website <https://jupyterlab-contrib.github.io/migrate_from_classical.html>`_.


.. _JEP #79: https://jupyter.org/enhancement-proposals/79-notebook-v7/notebook-v7.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this link has been removed, maybe the syntax in the first line under NbClassic Timeline can be removed? Or the link can be updated to the previously referenced JEP79 link "Jupyter Enhancement Proposal #79"?
Screen Shot 2023-02-17 at 8 12 30 AM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added back the link to the JEP 79

14 changes: 14 additions & 0 deletions nbclassic/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,20 @@ def initialize_handlers(self):
router.add_rules(core_rules)
router.add_rules(static_handlers)
router.add_rules(final_rules)
print("""
_ _ _ _
| | | |_ __ __| |__ _| |_ ___
| |_| | '_ \/ _` / _` | _/ -_)
\___/| .__/\__,_\__,_|\__\___|
|_|

Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.

https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

Please note that updating to Notebook 7 might break some of your extensions.
""")


# -----------------------------------------------------------------------------
# Main entry point
Expand Down
2 changes: 1 addition & 1 deletion nbclassic/static/base/js/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ define(function(){
// tree
jglobal('SessionList','tree/js/sessionlist');

Jupyter.version = "0.5.1";
Jupyter.version = "0.6.0.dev0";
Jupyter._target = '_blank';

return Jupyter;
Expand Down
30 changes: 30 additions & 0 deletions nbclassic/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,26 @@
</noscript>

<div id="header" role="navigation" aria-label="{% trans %}Top Menu{% endtrans %}">
<div id="newsId" style="display: none">
<div class="alert alert-info" role="alert">
<div style="display: flex">
<div>
<span class="label label-warning">UPDATE</span>
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
-
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
Please note that updating to Notebook 7 might break some of your extensions.
</div>
<div style="margin-left: auto;">
<a href="" onclick="alert('This message will not be shown anymore.'); return false;">
<button type="button" class="btn btn-default btn-xs" id="dontShowId">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Don't show anymore
</button>
</a>
</div>
</div>
</div>
</div>
<div id="header-container" class="container">
<div id="ipython_notebook" class="nav navbar-brand"><a href="
<div id="ipython_notebook" class="nav navbar-brand"><a href="{{default_url}}
Expand Down Expand Up @@ -205,6 +225,16 @@
}
}
_remove_token_from_url();
document.addEventListener('DOMContentLoaded', function () {
const newsId = document.querySelector('#newsId');
const dontShowId = document.querySelector('#dontShowId');
const showNbClassicNews = localStorage.getItem('showNbClassicNews');
dontShowId.addEventListener('click', () => {
localStorage.setItem('showNbClassicNews', false);
newsId.style.display = 'none';
});
if (!showNbClassicNews) newsId.style.display = 'inline';
});
</script>
</body>

Expand Down