jupyter-js-notebook icon indicating copy to clipboard operation
jupyter-js-notebook copied to clipboard

Web Version of Qt Console

Open afshin opened this issue 9 years ago • 23 comments

In addition to the notebook interface, we need to implement a web-based version of the console interface. Here are some of the tasks that will get us there:

  • [x] Create a ConsolePanel as a container that holds a ConsoleWidget, similar to the way the notebook works.
  • [x] Create a ConsoleModel that is similar to a NotebookModel but does not have a notion of arbitrary cell insertion.
  • [x] The first child of the ConsoleWidget needs to be a RawCellWidget to hold a banner and the second needs to be a CodeCellWidget to hold the prompt.
  • [ ] The ConsoleWidget needs a set of keyboard bindings to emulate the Qt Console application.
  • [x] The execution of the code cell needs to be separated from the notebook because it is common functionality.
  • [x] After every prompt execution, a new CodeCell needs to be generated to become the new prompt.
  • [ ] The UI needs to be styled to look like the Qt Console application.
  • [x] The history functionality of the Qt Console needs to be implemented (i.e. navigating through past commands via arrow keys).
  • [x] The contextual tooltip feature of the Qt Console needs to be implemented.
  • [ ] The pager functionality of leaving the prompt and residing within a different interactive context (i.e., entering the interactive help) needs to be implemented.
  • [x] The completion functionality (i.e., tab completion) of the Qt Console needs to be implemented. This should be done in a way that allows the notebook, or other widgets potentially, to use it as well.

cc @blink1073 @jasongrout

afshin avatar Apr 11 '16 20:04 afshin

Yep, and a lot of this refactoring will also help us in hooking up kernels to standalone text editors.

On Mon, Apr 11, 2016 at 1:17 PM, A. Darian [email protected] wrote:

In addition to the notebook interface, we need to implement a web-based version of the console interface. Here are some of the tasks that will get us there:

  • Create a ConsolePanel as a container that holds a ConsoleWidget, similar to the way the notebook works.
  • The first child of the ConsoleWidget needs to be a CodeCell
  • The ConsoleWidget needs a set of keyboard bindings to emulate the Qt Console application.
  • The execution of the code cell needs to be separated from the notebook because it is common functionality.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/jupyter/jupyter-js-notebook/issues/170

Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub [email protected] and [email protected]

ellisonbg avatar Apr 12 '16 00:04 ellisonbg

@afshin,

Up/down at the edge of a codemirror: https://github.com/jupyter/notebook/blob/master/notebook/static/notebook/js/cell.js#L234

blink1073 avatar Apr 22 '16 20:04 blink1073

It looks like the current notebook is still using the deprecated payload shell response for the pager:

https://github.com/jupyter/notebook/blob/master/notebook/static/notebook/js/codecell.js#L347

http://jupyter-client.readthedocs.org/en/latest/messaging.html#execution-results

cc @minrk

blink1073 avatar Apr 22 '16 21:04 blink1073

@afshin,

Completion: https://github.com/jupyter/notebook/blob/41d6da235cbf3bcf6d7f818e11a066e0fd12ff8b/notebook/static/notebook/js/completer.js#L173 Tooltip for inspection: https://github.com/jupyter/notebook/blob/41d6da235cbf3bcf6d7f818e11a066e0fd12ff8b/notebook/static/notebook/js/tooltip.js#L189

blink1073 avatar Apr 22 '16 21:04 blink1073

@minrk, ah, I see now "Payloads are considered deprecated, though their replacement is not yet implemented."

This statement is confusing, I would say it isn't deprecated until there is actually a preferred replacement.

blink1073 avatar Apr 22 '16 21:04 blink1073

@afshin, it looks like all of these will be relevant to you: http://jupyter-client.readthedocs.org/en/latest/messaging.html#payloads-deprecated

blink1073 avatar Apr 22 '16 21:04 blink1073

@blink1073 you're a monster. Thank you!

afshin avatar Apr 22 '16 21:04 afshin

@blink1073 payloads are something that we don't like, and know that we will remove/replace when we get the chance. Since we know that, we want to avoid things like proposing new payloads, etc., but they still exist because we haven't come up with a replacement for the few things they are used for. If you have a better way to communicate "avoid using these if you can, but that's not always possible," A PR to the doc would be welcome.

minrk avatar Apr 25 '16 09:04 minrk

@minrk in order to cover functionality that the Qt Console currently offers, e.g., using the interactive help system, we'll need to use payloads. Do you have any input on how we should approach this?

cc: @blink1073 @sccolbert

help

afshin avatar Apr 25 '16 15:04 afshin

Does the qtconsole use payloads to implement the interactive help? It looks to me like help() just uses raw_input() to do help. You can see that if you do help() in the Jupyter notebook. It looks like you just have to implement the stdin connection: http://jupyter-client.readthedocs.org/en/latest/messaging.html#messages-on-the-stdin-router-dealer-sockets

jasongrout avatar Apr 25 '16 16:04 jasongrout

@jasongrout pager output is a payload. @afshin yes, I think the frontend should support payloads. Sorry for the confusion. The comment in the docs mainly pertains to kernels, where we would like to avoid doing new things with payloads until we can come up with their replacement, express a preference to do things without payloads where there's an option.

minrk avatar Apr 26 '16 07:04 minrk

@minrk Thanks for the clarification!

afshin avatar Apr 26 '16 11:04 afshin

Ah, thanks for the clarification, @minrk.

jasongrout avatar Apr 26 '16 16:04 jasongrout

FYI, this is the current state of affairs (which now includes history):

console

afshin avatar Apr 29 '16 11:04 afshin

tooltip

afshin avatar May 16 '16 17:05 afshin

Nitpick from screenshots, Out[ don't have space before the square bracket to align.

Carreau avatar May 24 '16 17:05 Carreau

@Carreau, thanks for the input. @blink1073 just created this issue for it: https://github.com/jupyter/jupyter-js-notebook/issues/221

afshin avatar May 26 '16 15:05 afshin

The output input, as it were.

blink1073 avatar May 26 '16 15:05 blink1073

Current state of affairs:

completion

afshin avatar May 27 '16 21:05 afshin

Not sure if this is the right place to throw this in: It would be very handy to have the web console closely integrated with the notebook, e.g. through magic commands. Something like %qtweb could spawn a console connected to the current kernel in a new tab or in an overlay. %qtdebug might spawn a web console with %debug executed inside, so that ipdb can be used with autocompletion and history.

jan-matthis avatar Jun 15 '16 11:06 jan-matthis

Hi @jan-matthis, thank you, those are both excellent suggestions. We've moved development over to https://github.com/jupyter/jupyterlab. @afshin, do you want to migrate the top level comment over there and link to this issue?

blink1073 avatar Jun 15 '16 11:06 blink1073

@blink1073 @jan-matthis Sure, will do. Great suggestions.

afshin avatar Jun 15 '16 11:06 afshin

Migrated to https://github.com/jupyter/jupyterlab/issues/76

blink1073 avatar Jul 01 '16 15:07 blink1073