Changes between Version 8 and Version 10 of Ticket #20690


Ignore:
Timestamp:
05/28/16 09:10:19 (3 years ago)
Author:
nthiery
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20690

    • Property Commit changed from 19f31f8567ac77094d2ee483e7adf9d6963a8dd7 to 5016cd83634381cd6be0f42154ea759744a7b272
  • Ticket #20690 – Description

    v8 v10  
    1 Thebe is a Jupyter javascript plugin for static sites that allows for rendering selected divs of the HTML as live cells connected to a Jupyter server:
     1Thebe is a Jupyter javascript plugin for static sites that allows for
     2rendering selected divs of the HTML as live cells connected to a
     3Jupyter server:
    24
    35  https://oreillymedia.github.io/thebe/
    46
    5 The idea is to use this technology to make
     7The goal of this ticket is to use this technology to implement live
     8documentation in the Jupyter notebook as we had in the legacy Sage
     9notebook.
    610
    711Steps:
     
    1014  - [X] Inclusion of the Thebe javascript
    1115  - [x] Thebe configuration: which divs to make live
    12         Currently, we include all <pre> tags that contain sage:
     16        Currently, we include all <pre> tags that contain the "sage:" prompt
     17        TODO: shall we change to <pre> tags that start with the "sage:" prompt ?
    1318  - [ ] Thebe configuration: use the Jupyter instance serving the page
    14         We use window.location.origin; is this the right thing to do?
    15   - [ ] Only activate Thebe if running inside a Jupyter server
     19        We currently use window.location.origin; is this the right thing to do?
     20  - [x] Only activate Thebe if the page is served by a Jupyter instance
     21        Currently we check that the protocol is http
    1622  - [x] A button to activate live cells
    17   - [ ] Possibly a menu or other widgets for user customization of the server configuration
    18 - [?] Configure the Jupyter notebook in Sage to somehow provide the server configuration to Thebe.
    19 - Customize/configure Thebe to support Sage's doctest syntax:
    20   - [ ] Stripping out the prompts
    21   - [ ] Stripping out the included outputs (bonus: show the included outputs below the cell until the new output is computed)
     23
     24- [X] Configure the Jupyter notebook in Sage to somehow provide the
     25      server configuration to Thebe (not needed in fact)
     26
     27- Preparse or customize/configure Thebe to support Sage's doctest syntax:
     28  - [ ] Strip out the "sage: " prompts and "....:" and "...  " continuation prompts
     29  - [ ] Strip out the outputs
     30        Bonus: show the included outputs below the cell until the new output is computed
    2231  - [ ] Support doctests with several commands by spliting into several cells
     32
     33- Check what's the right way for including thebe.js in the Sage
     34  sources. Should we have a spkg? (to be discussed at Sage Days 74
     35  with Volker).
     36
     37Steps for later tickets:
     38
     39- [ ] Currently it takes 10s for 100 prompts while some sage files
     40      contain up to 1000 prompts. Profile Thebe and optimize it or use
     41      a separate thread to properly support large files.
     42
     43- [ ] Expand the activate button with a menu or other widgets for user
     44      customization of the Jupyter server. This typically would
     45      let the user choose between:
     46      - tmpnb (will only be useful for Sage when tmpnb will include a
     47        Sage kernel)
     48      - A local Jupyter server
     49      - Whichever Jupyter server the browser is currently connected to?
     50      - a user specified server
     51
     52- [ ] Check whether Jupyter could be configured to dynamically
     53      negotiate incoming connections that don't fall within the
     54      -NotebookApp.allow_origin pattern, by opening a user dialog such
     55      as "Page xxx requests starting a new kernel on this server; do
     56      you accept? yes/no/always for this site"
     57
     58- [ ] Add support in Thebe for customizable (continuation) prompts, with
     59      striping and splitting as above, and automatic setting of the kernel.
     60      The customization option could look like:
     61
     62      {{{
     63         prompts = {
     64            "sage: ": {continuations=["....:", "...  "], kernel="sagemath"},
     65            ">>>> ": {continuation="...  ", kernel="python"}
     66         }
     67      }}}
     68
     69- [ ] Contribute support for Thebe upstream in Sphinx, with:
     70
     71      - [ ] Explicit markup to specify which code blocks are editable
     72            and with which kernel, or setup kernel auto-detection from
     73            the prompt.
     74
     75      - [ ] The possibility for setting a default value for the above
     76
     77- [ ] Refactor the Sage sphinx configuration to use the above
     78
     79- [ ] Add support in Thebe for basic export to Jupyter notebooks. A
     80      quality loss (in particular in terms of the hierarchical
     81      structure) is acceptable.