From 6f95e7b8ceaa8306ae9aba8d671ec063890fada2 Mon Sep 17 00:00:00 2001 From: yacchin1205 <968739+yacchin1205@users.noreply.github.com> Date: Tue, 8 Oct 2024 16:09:14 +0900 Subject: [PATCH] Fix README --- Dockerfile | 4 +++- README.md | 50 ++++++++++++++++++++++++++++++++------------ example/update-index | 2 +- 3 files changed, 41 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 31b0876..bf406cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,7 @@ RUN pip install -e /tmp/nbsearch && \ jupyter labextension develop /tmp/nbsearch --overwrite && \ jupyter server extension enable nbsearch && \ jupyter labextension enable nbsearch && \ + jupyter labextension enable lc_notebook_diff && \ jupyter labextension enable lc_index RUN mkdir -p /usr/local/bin/before-notebook.d && \ @@ -70,7 +71,8 @@ RUN mkdir -p /opt/nbsearch/original/bin/ && \ RUN jupyter nbclassic-extension install --py --sys-prefix nbsearch && \ jupyter nbclassic-serverextension enable --py --sys-prefix nbsearch && \ jupyter nbclassic-extension enable --py --sys-prefix nbsearch && \ - jupyter nbclassic-extension enable --py --sys-prefix lc_notebook_diff + jupyter nbclassic-extension enable --py --sys-prefix lc_notebook_diff && \ + jupyter nblineage quick-setup --sys-prefix # Configuration for Server Proxy RUN cat /tmp/nbsearch/example/jupyter_notebook_config.py >> $CONDA_DIR/etc/jupyter/jupyter_notebook_config.py diff --git a/README.md b/README.md index e36148d..c3d7e5f 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,65 @@ # nbsearch -[![Github Actions Status](https://github.com/NII-cloud-operation/nbsearch//workflows/Build/badge.svg)](https://github.com/NII-cloud-operation/nbsearch//actions/workflows/build.yml)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/NII-cloud-operation/nbsearch//main?urlpath=lab) +[![Release](https://github.com/NII-cloud-operation/nbsearch/actions/workflows/release.yml/badge.svg)](https://github.com/NII-cloud-operation/nbsearch/actions/workflows/release.yml) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/NII-cloud-operation/nbsearch/feature/lab?urlpath=lab) nbsearch extension provides search capabilities for Jupyter Notebooks, which you created. It supports search by MEME in addition to search by keywords and modified times like a search engine. Therefore, users can easily find cells of the same origin in sticky notes added by sidestickies. +## Try it out on mybinder.org + +You can try out the extension on mybinder.org by clicking the Binder badge above, and refer to the [Usage](#usage) section for more information. + +The following software is installed in this environment. + +- Services + - JupyterLab + - Jupyter Notebook 7 + - [Apache Solr](https://solr.apache.org/) + - [MinIO](https://min.io/) + +- Extensions + - nbsearch + - [nblineage](https://github.com/NII-cloud-operation/Jupyter-LC_nblineage) + - [lc_notebook_diff](https://github.com/NII-cloud-operation/Jupyter-LC_notebook_diff) + +If you create a Notebook file in this environment, it will be automatically indexed in Solr and you will be able to search for it using the Search. Please refer to the [Usage](#usage) section for more information. + +> **Note**: It may take some time for Apache Solr and MinIO to start up. If your search fails, please wait a while and try again. + ## Requirements - JupyterLab >= 4.0.0 +- Jupyter Notebook >= 7.0.0 ## Install To install the extension, execute: -*TBD* - ```bash pip install git+https://github.com/NII-cloud-operation/nbsearch ``` To use nbsearch extension, you will also need to install and enable. You can use Jupyter subcommand: -*TBD* - ``` -jupyter nbextension install --py nbsearch -jupyter serverextension enable --py nbsearch -jupyter nbextension enable --py nbsearch +jupyter server extension enable nbsearch +jupyter labextension enable nbsearch + +# If you want to use the extension with the classic notebook, +# you need to install and enable the nbclassic notebook extension. +jupyter nbclassic-extension install --py --sys-prefix nbsearch +jupyter nbclassic-serverextension enable --py --sys-prefix nbsearch +jupyter nbclassic-extension enable --py --sys-prefix nbsearch ``` To compare multiple Notebooks, you need to install [Jupyter-LC_notebook_diff](https://github.com/NII-cloud-operation/Jupyter-LC_notebook_diff), as shown below. -*TBD* - ``` -pip install git+https://github.com/NII-cloud-operation/Jupyter-LC_notebook_diff -jupyter nbextension install --py lc_notebook_diff -jupyter nbextension enable --py lc_notebook_diff +pip install git+https://github.com/NII-cloud-operation/Jupyter-LC_notebook_diff.git@feature/lab +jupyter labextension enable lc_notebook_diff + +# If you want to use the extension with the classic notebook, +# you need to install and enable the nbclassic notebook extension. +jupyter nbclassic-extension enable --py --sys-prefix lc_notebook_diff ``` then restart Jupyter notebook. diff --git a/example/update-index b/example/update-index index fe84259..8d90d68 100644 --- a/example/update-index +++ b/example/update-index @@ -14,5 +14,5 @@ if [[ -f /home/$NB_USER/.nbsearch/config_local.py ]] ; then exit 0 fi -jupyter nbsearch update-index --debug /home/$NB_USER/.jupyter/jupyter_notebook_config.py local $file +jupyter nbsearch update-index --debug $CONDA_DIR/etc/jupyter/jupyter_notebook_config.py local $file exit 0