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

Fix Help menu breakdown in external jupyterlab case #38005

Merged

Conversation

kwankyu
Copy link
Collaborator

@kwankyu kwankyu commented May 15, 2024

#37878 introduced a local documentation server for jupyterlab. But it missed a case for which the Help menu of jupyterlab may break down.

In the setup explained in https://doc.sagemath.org/html/en/installation/launching.html#setting-up-sagemath-as-a-jupyter-kernel-in-an-existing-jupyter-notebook-or-jupyterlab-installation, external jupyterlab is launched and connected to sage kernel. In this case, the local doc server does not run, but the Help menu of the jupyterlab still expects a local doc server, and thus the Help menu does not work well.

In this PR, local doc server is detected by testing the port number, and the Help menu uses the online official documentation if local doc server is not running.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@kwankyu kwankyu changed the title Detect local doc server by nonzero port number Fix a bug related with local doc server for external jupyterlab case May 15, 2024
@kwankyu kwankyu changed the title Fix a bug related with local doc server for external jupyterlab case Fix Help menu breakdown in external jupyterlab case May 15, 2024
@kwankyu kwankyu force-pushed the documentation-for-external-jupyterlab branch from 1e02202 to def978a Compare May 15, 2024 11:28
@kwankyu
Copy link
Collaborator Author

kwankyu commented May 15, 2024

I cannot test this PR because my sage is broken...

Copy link

Documentation preview for this PR (built with commit def978a; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@mkoeppe
Copy link
Contributor

mkoeppe commented May 15, 2024

Can't test it either, but LGTM.

@kwankyu
Copy link
Collaborator Author

kwankyu commented May 16, 2024

Thanks!

vbraun pushed a commit to vbraun/sage that referenced this pull request May 18, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

sagemath#37878 introduced a local documentation server for jupyterlab. But it
missed a case for which the Help menu of jupyterlab may break down.

In the setup explained in
https://doc.sagemath.org/html/en/installation/launching.html#setting-up-
sagemath-as-a-jupyter-kernel-in-an-existing-jupyter-notebook-or-
jupyterlab-installation, external jupyterlab is launched and connected
to sage kernel. In this case, the local doc server does not run, but the
Help menu of the jupyterlab still expects a local doc server, and thus
the Help menu does not work well.

In this PR, local doc server is detected by testing the port number, and
the Help menu uses the online official documentation if local doc server
is not running.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38005
Reported by: Kwankyu Lee
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request May 18, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

sagemath#37878 introduced a local documentation server for jupyterlab. But it
missed a case for which the Help menu of jupyterlab may break down.

In the setup explained in
https://doc.sagemath.org/html/en/installation/launching.html#setting-up-
sagemath-as-a-jupyter-kernel-in-an-existing-jupyter-notebook-or-
jupyterlab-installation, external jupyterlab is launched and connected
to sage kernel. In this case, the local doc server does not run, but the
Help menu of the jupyterlab still expects a local doc server, and thus
the Help menu does not work well.

In this PR, local doc server is detected by testing the port number, and
the Help menu uses the online official documentation if local doc server
is not running.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38005
Reported by: Kwankyu Lee
Reviewer(s):
@vbraun vbraun merged commit 74f244c into sagemath:develop May 25, 2024
15 of 16 checks passed
@mkoeppe mkoeppe added this to the sage-10.4 milestone May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants