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

Meta-ticket: Improve live documentation in the Jupyter notebook #20893

Open
1 of 13 tasks
videlec opened this issue Jun 27, 2016 · 22 comments
Open
1 of 13 tasks

Meta-ticket: Improve live documentation in the Jupyter notebook #20893

videlec opened this issue Jun 27, 2016 · 22 comments

Comments

@videlec
Copy link
Contributor

videlec commented Jun 27, 2016

Since #20690 we have access to documentation (with live execution)
within the Jupyter notebook. It was decided to keep the code simple.
There are two ongoing projects within Jupyter for having this working.
It might be wiser to wait for them...

Some of the improvements mentioned in #20690 were:

  • [ ] Configure Sphinx to add a small header to our html page with
    Thebe configuration: use the Jupyter instance serving the page.
    We currently use window.location.origin; is this the right thing?

  • Currently it takes 10s for 100 prompts while some sage files
    contain up to 1000 prompts. Profile Thebe and optimize it or use
    a separate thread to properly support large files.

  • Expand the activate button with a menu or other widgets for user customization
    of the Jupyter server. This typically would let the user choose between:

    • tmpnb (will only be useful for Sage
      when tmpnb will include a Sage kernel; there are ongoing discussions for providing an alternative sage-enabled tmpnb)
    • a local Jupyter server,
    • whichever Jupyter server the browser is currently connected to?
    • a user-specified server.
  • Check whether Jupyter could be configured to dynamically
    negotiate incoming connections that don't fall within the
    -NotebookApp.allow_origin pattern, by opening a user dialog such
    as "Page xxx requests starting a new kernel on this server; do
    you accept? yes/no/always for this site".

  • Add support in Thebe for customizable (continuation) prompts, with striping and splitting as above, and automatic setting of the kernel. The customization option could look like:

    prompts = {
        "sage: ": {continuations=["....:", "...  "], kernel="sagemath"},
        ">>>> ": {continuation="...  ", kernel="python"}
    }
    
  • Have Thebe provide good TAB-completion.

  • Let the cursor switch to the next cell after evaluation (SHIFT+ENTER).

  • Extract support for Thebe as a Sphinx extension with (see the related sage-cell extension):

    • Explicit markup to specify which code blocks are editable and with
      which kernel, or setup kernel auto-detection from the prompt.
    • The possibility for setting a default value for the above.
  • Refactor the Sage Sphinx configuration to use the above.

  • Configure sage-sample / sage-package to use it, to enable live documentation for Sage packages.

  • Add support in Thebe for basic export to Jupyter notebooks. A
    quality loss (in particular in terms of the hierarchical
    structure) is acceptable.

  • Allow to save the current state of the webpage as a .ipynb worksheet, to be able to continue working on it later, see [[/ticket/20690#comment:53]].

Tickets:

See also:

Depends on #20690

CC: @vbraun @rbeezer @nthiery @hivert @slel @sagetrac-fcayre @jdemeyer @dimpase @kwankyu

Component: documentation

Keywords: thebe, thebelab

Issue created by migration from https://trac.sagemath.org/ticket/20893

@videlec videlec added this to the sage-7.3 milestone Jun 27, 2016
@videlec

This comment has been minimized.

@sagetrac-tmonteil

This comment has been minimized.

@slel

This comment has been minimized.

@slel
Copy link
Member

slel commented Aug 30, 2016

comment:3

Fix formatting in ticket description.

Regarding "There are two ongoing projects within Jupyter for having this working",
would someone add links?

@slel slel changed the title improving live documentation in the Jupyter notebook Improve live documentation in the Jupyter notebook Aug 30, 2016
@slel

This comment has been minimized.

@slel
Copy link
Member

slel commented Aug 30, 2016

comment:4

Editing ticket description to add link to
tmpnb issue 203: "Octave kernel and SageMath kernel".

@sagetrac-tmonteil

This comment has been minimized.

@sagetrac-tmonteil

This comment has been minimized.

@nthiery

This comment has been minimized.

@nthiery

This comment has been minimized.

@nthiery
Copy link
Contributor

nthiery commented May 4, 2017

comment:11

Update: Min RK reported to me that he had started reimplementing Thebe on top of JupyterLab. At this stage, this seemed to confirm our hope that Thebe will become just a thin layer on top of plain JupyterLab, making it sustainable.

@nthiery

This comment has been minimized.

@nthiery

This comment has been minimized.

@nthiery
Copy link
Contributor

nthiery commented May 4, 2017

comment:14

A source of inspiration: sympylive.

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented May 4, 2017

comment:15

Replying to @nthiery:

Update: Min RK reported to me that he had started reimplementing Thebe on top of JupyterLab. At this stage, this seemed to confirm our hope that Thebe will become just a thin layer on top of plain JupyterLab, making it sustainable.

Is an export to a standalone .ipynb file part of the plan (so that people can save their work on some live doc) ?

@nthiery
Copy link
Contributor

nthiery commented May 8, 2017

comment:16

Replying to @sagetrac-tmonteil:

Is an export to a standalone .ipynb file part of the plan (so that people can save their work on some live doc) ?

Ah, shoot, I forgot to discuss this specific point.

That being said, Thebe is meant to be embedded in any web page. So, at the level of Thebe itself, and without a minimum of structure specified, I believe it would be hard to define a meaningful export to .ipynb.

Plausibly we would instead be shooting for a link "download document as ipynb" pointing to the notebook generated from the original sources, either statically or on the fly. The inconvenient being of course that users won't keep their history in this scenario if they play with Thebe before switching to the notebook.

@nthiery

This comment has been minimized.

@nthiery
Copy link
Contributor

nthiery commented Mar 7, 2018

Changed keywords from none to thebe, thebelab

@mkoeppe
Copy link
Member

mkoeppe commented Aug 19, 2020

comment:18

This ticket needs clarification / update. Is it a meta ticket?

@mkoeppe mkoeppe modified the milestones: sage-7.3, sage-9.2 Aug 19, 2020
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Improve live documentation in the Jupyter notebook Meta-ticket: Improve live documentation in the Jupyter notebook Sep 2, 2020
@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@mkoeppe
Copy link
Member

mkoeppe commented Mar 24, 2021

comment:21

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 24, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants