Skip to content

Commit

Permalink
Add news banner and log (#215)
Browse files Browse the repository at this point in the history
* add news banner and log

* docs: create a nbclassic_notebook page

* Update docs/source/nbclassic.rst

Co-authored-by: Isabela Presedo-Floyd <50221806+isabela-pf@users.noreply.github.com>

* Update nbclassic/templates/page.html

Co-authored-by: Isabela Presedo-Floyd <50221806+isabela-pf@users.noreply.github.com>

* Update docs/source/nbclassic_notebook.rst

Co-authored-by: Afshin Taylor Darian <git@darian.email>

* Update docs/source/nbclassic_notebook.rst

Co-authored-by: Afshin Taylor Darian <git@darian.email>

* Update docs/source/nbclassic_notebook.rst

Co-authored-by: Afshin Taylor Darian <git@darian.email>

* 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 <50221806+isabela-pf@users.noreply.github.com>
Co-authored-by: Afshin Taylor Darian <git@darian.email>
  • Loading branch information
3 people authored Feb 17, 2023
1 parent 16441f6 commit 00e3836
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 68 deletions.
71 changes: 4 additions & 67 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 Down Expand Up @@ -148,5 +85,5 @@ Jupyter Notebook 7.
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

.. _JEP #79: https://jupyter.org/enhancement-proposals/79-notebook-v7/notebook-v7.html
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

0 comments on commit 00e3836

Please sign in to comment.