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
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Jupyter NbClassic
:caption: User Documentation

nbclassic
nbclassic_notebook
notebook
ui_components
examples/Notebook/examples_index.rst
Expand Down
73 changes: 4 additions & 69 deletions docs/source/nbclassic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ 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 :ref:`NbClassic and Notebook <_NbClassicNotebook>`
page.

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

.. _NbClassicUsage:
Expand Down Expand Up @@ -55,72 +59,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 +85,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

75 changes: 75 additions & 0 deletions docs/source/nbclassic_notebook.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.. _htmlnotebook:

.. _NbClassicNotebook:

NbClassic and Notebook
======================

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

Any extension developed for Notebook < 7 or NbClassic will not be
compatible with Notebook 7 and upwards.

**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
echarles marked this conversation as resolved.
Show resolved Hide resolved
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
echarles marked this conversation as resolved.
Show resolved Hide resolved
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
echarles marked this conversation as resolved.
Show resolved Hide resolved
``/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
13 changes: 13 additions & 0 deletions nbclassic/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,19 @@ def initialize_handlers(self):
router.add_rules(core_rules)
router.add_rules(static_handlers)
router.add_rules(final_rules)
print("""
_ _
| \ | | _____ _____
| \| |/ _ \ \ /\ / / __|
| |\ | __/\ V V /\__ \\
|_| \_|\___| \_/\_/ |___/


If you plan to upgrade to Notebook 7, read https://nbclassic.readthedocs.io/en/latest/nbclassic_notebook.html

Notebook 6 / NbClassic extensions will not work on Notebook 7.
""")


# -----------------------------------------------------------------------------
# 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">NEWS</span>
echarles marked this conversation as resolved.
Show resolved Hide resolved
If you plan to upgrade to Notebook 7, read <a href="https://nbclassic.readthedocs.io/en/latest/nbclassic_notebook.html" target="_top">NbClassic to Notebook 7 documentation.</a>
-
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
Notebook 6 / NbClassic extensions will not work on Notebook 7.
</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