# ipython/ipython

### Subversion checkout URL

You can clone with
or
.

# Notebook feature requests#977

Open
opened this Issue · 191 comments

### 55 participants

Owner

This is a meta-issue to list, discuss and shake out ideas for improvements to the notebook. It can serve as a central page for users to propose ideas and discuss them; as they get more fleshed out and there's a chance of implementing one of them, we can make a separate issue (or pull request, if there's code) for it.

In our docs we already have some items noted, so that list should be used as a starting point for the discussion.

Owner

Hi,
Because you're asking for it I thought of :

• A post-saving hook (like for example to call a versioning system)
• save a .ipynb~ after each execution in case of the user closing the page (but without the output, for speed)
• Visual indication of which cell are currently busy  forget it, I was using an older version at work... should be more up to date[/edit]
• (as an option ?) if help pannel if visible, update its content when '(' is inserted. kind of a tooltip.
Owner
Owner

I've just created PR #987 which kind of replace my 5th point.
and another idea. Maybe we can add the shortcut for the action at the end of the "tooltip" that apear when hovering the corresponding button. like :
Delete [Delete the selected cell (Ctrl+m d)]

Owner

Adding a few of our existing plans, to be tracked here:

• IPython project == folder == repo. Everything you would have in a project goes here - scripts, notebooks, data. It all gets tracked together, and there will be some simple interface for managing non-notebook contents, and a few VCS actions. You can use multiple projects with one server, but they know nothing of each other (GitHub is used frequently as a reference).
• Notebooks can have multiple worksheets: Our model is that a notebook == a kernel == a namespace, but you can have multiple pages in that notebook separately working against the same kernel.
• Notebooks should have multi-level sections, which should facilitate collapsing groups of cells, as well as a good model for a notebook in rst.
• ReST support - ReST support will be provided at the full document level, so you get all the cross-referencing, linking, scoping, etc. power that you expect from sphinx, which you cannot have if you render text cells with rest one at a time.
Owner

An idea @ivanov had the other day:

• reproducible/copyable urls/anchors per-cell, so you can have links to a particular cell that last (at least for the life of the notebook server).

And one from @stefanv, that we had working briefly, but had to remove as the first implementation caused data loss on renames:

• consistent urls for notebooks - right now, the urls for notebooks are UUIDs, which are regenerated when the server starts. These should be the same from one server session to the next. This is certainly doable, but one has to be careful about what happens when the notebook is renamed.
Owner

@Carreau

• A post-saving hook (like for example to call a versioning system)
• save a .ipynb~ after each execution in case of the user closing the page (but without the output, for speed)

My idea for this is actually something akin to the OSX 10.7 Versions model (in idea, not implementation). The notebook should be autosaved silently, but the true 'save' action is actually a git add && commit. I know how much @fperez hates autosave, but I think that a web-based tool that doesn't do any kind of autosave can never be considered production-ready. With this model properly implemented, it would be impossible for autosave to cause data loss, because your last intentional save is always a git checkout -- foo.ipynb away (for which there should certainly be a simple UI in the web interface).

Owner
Owner

it'd be great to have a cell manipulating API - creating and moving cells from another session hooked to the same kernel. I remember @minrk was telling me that this would require some sort of locking or at least synchronization mechanism, since you can make oodles of cells in the browser and nothing gets sent over the wire until you want to execute some code - but still, this would be a powerful addition to the workflow to be able to create and manipulate the notebook from some other client.

one simpler implementation of this would be something like an 'edit' button, like wikis have, that notifies you of someone else holding a lock requesting that no one else edit the notebook for a while. Nothing would prevent you from overriding it, but at least you'd get the notice that another client is intending to manipulate the NB for a while

Owner

More:

• multi-cell selection and actions. Right now, there's no way to copy/paste/delete multiple cells.

• cell split/join: we should have actions to split a cell at the current point as well as merging a cell with the one previous/next or a group of cells (once we have multi-cell selection implemented).

Owner
Owner
Owner

Throwing more ideas:

Could the <tab> completer keep a list of the completion possibility and do a filtering "as you type", then be dismissed when there is no matches left or escape is pressed. All in js of course to avoid querrying the kernel ...

About the Cell copy/pasting, could it be possible to have a copy, collapse (...) button that appear on the left when hovering a rendered/executed cell, a little like editing your message when you just post it on github.

Is there a way to know if a certain notebook is opened from somewhere else, or if the kernel status has been modified since last execution. I'm not familiar with websocket, but are the messages broadcasted or send on a by-host basis? If so and we get a message that don't belong to us, we might want to prompt the user with a message saying that the kernel status may have changed ? Or just count the prompt number...

Owner

Actually @minrk, it seems you do like how emacs does it, because you haven't actually had a problem with it :) Let me explain: the ~ files that bug you are not the autosave ones, those are backup files that contain a copy of the previous saved version of your current file. You can actually instruct emacs to never create those if you don't want them.

The autosave files (in the sense I described above) are by default named #filename#. The fact you're not complaining about those means that it works fine: you hardly ever see them, the only show up if you had emacs segfault in the middle of a big edit.

And I would argue that by default, those should be saved next to their normal file, because the whole point is to make them easy to find in the case of an accident, and in normal usage patterns they never are a bother. In 15 years of daily emacs use I've probably had to clean those up a handful of times.

Owner

@Carreau: yes, we do know when a notebook has been opened, and I'd love to add to the dashboard a button next to any open notebook to allow me to kill its kernel. It's easy to do, we just haven't put too much work on the dashboard functionality yet because our focus has been on the notebooks themselves.

Owner

@fperez - 'like' is much too strong a word for anything I feel about emacs ;), but it's fine, as long as they do not appear adjacent to real files. A quick search reveals that I do have some of those files lying around, and given how extremely rarely I use emacs, that is not a good sign. Most of the 'foo~' files on my system were created by various other apps, many of which do a bad job at cleaning up.

If emacs is good at cleaning up that's great, but it is not particularly relevant - the model of writing extra files means we have to be extremely aggressive/careful about cleaning up residue, lest we create a huge annoying mess. Putting those files aside somewhere is a big step towards controlling that mess.

I do think this more primitive model is the right solution for us in general, I would just be very sad if IPython becomes one of the far-too-many Linux apps that litter the filesystem with garbage.

Owner

I'd like to have an option in %pycat that output the file in a cell, and not in the pager for the notebook.

Owner
Owner

yes, except that I don't want the cell to be executable... And if I do a "run all" it append the code again ant run it twice ...

Owner
Owner

Yes, I should have been more precise, but I was on the go and post the message not to forgot later...

finally getting to this (better late that never). so here it goes?

• i'd like to see username back. why? because if i'm sharing a read-only or read-write notebook, i would like to know who i'm sharing with. (kind of like google chat). since tornado supports openid, perhaps set a dual authentication scheme, openid and/or password. talking of google chat, integrated chat would be nice :)
• also i'd like to be ping-ed each time somebody else has added or changed a cell. i know this is rather fragile at the moment.
• ctrl+enter should execute the current cell and leave the cursor in the cell without highlighting
• duplicate a notebook that you are working on and haven't saved into a new notebook
• the "stay or leave the page" message should say "you have unsaved changes. do you want to cancel, save and quit or quit with saving"
• notebook diff. what has changed between last saved version and now.
• split a cell at an arbitrary point, merge cell with previous or next cell
• save workspace optionally with the notebook
• ctrl g+?? for git/github key bindings :) i kind of simply stick a cell and do !git ...
• gist like revision history
• any possibility of a key binding to toggle the help display and the sidebar
• open help in a new synched browser tab (one can have it side by side)
• optional layouts for notebooks (on my giant screen, i might want [sidebar, notebook, help] in columns; on my little screen, i might just want notebook)
• open a local notebook in the remote session.
• indicate notebook status: loca/remote, notebook-userid

... more to come

Owner
Owner
• the "stay or leave the page" message should say "you have unsaved changes. do you want to cancel, save and quit or quit with saving"

Unfortunately we can't: that dialog is generated by the browser, not by us, and we have zero control over it. It's the same one you get in gmail if you try to close a page mid-operation.

Not quite, we have control over part of the message here.

Owner
Owner

Note that #888 is a dedicated discussion about reST support, for anyone interested. That's one of the biggest topics and deserves a separate discussion, as there are quite a few complex issues there.

Owner
• i'd like to see username back. why? because if i'm sharing a read-only or read-write notebook, i would like to know who i'm sharing with. (kind of like google chat). since tornado supports openid, perhaps set a dual authentication scheme, openid and/or password. talking of google chat, integrated chat would be nice :)

Brian and I removed the username because it didn't actually do anything, and we didn't want to present the illusion of a multi-user environment we don't actually have. Once the server has some sense of users being distinct, then it should be returned.

referenced this issue
Open

### QTConsole with --ssh option and kernel interrupt #1004

Owner
Owner

That makes sense, but I still think having such a field that has exactly no function is more confusing than anything, so we shouldn't put it back until we have some functionality that uses it, and we can call it a nickname if that best suits whatever functionality it is that we have.

Owner

Agreed, I just wanted to hash out the idea. Definitely shouldn't put it there until there's actual usage code for it.

@minrk: i agree that the username is useless unless it shows up on the app as a list somewhere. but even if all it did was say who is viewing and what ability they have (read/write vs read only) that would be extremely informative. it's like gmail saying that your account is being accessed via the following IPs and browsers.

@fperez: i do want people to view what i'm doing and refresh their content without being able to make any changes. and i think that's what the readonly bit does, right? so it would be good for me to know who is in that mode.

ps. this is a feature request page, so we can dream right :)

Owner

@satra, yes: that's precisely what the read-only mode offers. We figured it could be very useful in teaching/demo scenarios.

Adding IP info (with rw/ro indicator) is definitely the simplest solution, and I wouldn't mind having something that also allows for nicknames and finer control over collaborators (such as a dict of passwords for different nicknames instead of just a global one). But it must remain very clear that it's still at heart a single-user system, and that people are giving out their real shell access to others.

Owner

pps. and yes, dreaming here is OK, that's what this page is for :) Out of these ideas, no matter how crazy, we'll come up with a good list of practical, implementable stuff.

Owner

add a name="someIDwhyNotThePromptNumber" to cell , so that you can reference it by http://x.x.x.x/uuid#cell25

Owner

Still dreaming,
can we parse/get the parsed version of the docstring from the kernel, to have link instead of : :func:'~matplotlib.use' (backquote replace by simple quote ) changed to html link which [open the online doc | open the corresponding help pager | etc. ]

Note that this should be do-able in the qtconsole as well...so that why I'm thinking of passing by the kernel
Maybe we could add an optionnal dependency to sphynx ?

Owner

Yes, eventually we should definitely add better handling of docstrings with formatting, syntax highlighting, etc (if the necessary dependencies are installed, though it shouldn't be mandatory).

Owner

Will it make sens to have a 'user written' javascript file which will be loaded by the notebook and in which you can just set parameters which are on the browser side only.
That will avoid having to go through Python to 'configure' the notebook. And allow al kind of 'user hack' (good or bad) on the notebook.

I'm thinking of it by seeing #1077 (no-matjax) and IMHO, and my little knowlege on JS, I would have only load a script which looked like

var UserConf = function(...
[...]
var matjax.enable=false;
[...]
[some other stuff like tooltip or not, collapsed sidepannel]
[]

Always (try to) load it. And check the values. And why not generating it 'on the fly' later with templates as done for the html, have a per notebook/per user file.
You can even (in the case lage noteebook loading) write your own alert('this notebook is huge, would you like to load matjax') to choose at startup what to do...

you can dream of a --js-profile=thisprofile.js on command line, or several open button on the main page which give you loading options by just selectin the js-profile

Owner

I would suggest going with json, rather than executable javascript, at least for basic config. Executable config files can't be changed programmatically. We can always allow extensions in javascript for things like checking the size of a notebook when it's opened.

I very much like a feature that SAGE has but the notebook not (yet). When executing a cell you get a nice 'Busy' sign at the top in the ipython notebook but SAGE also shows this indicator in the tab title. This means I can visit other tabs in my browser and know exactly when the operation has finished.

referenced this issue
Merged

### write busy in notebook window title... #1084

Owner

Your wish is our (or rather, @Carreau's :) command: #1084.

Thanks for the super fast reaction, awesome!

Owner

@Midnighter: not to be accused of slacking off after an accolade, it's now merged and pushed :)

Owner

I often find myself wanting to move a cell Down , and then do a Ctrl-m d which delete it, even if I know that it is Ctrl-m j. As long as the Ctrl-m z or Ctrl-z is not implemented to undo cell deletion, I'll propose to ship 0.12 with dangerous shortcut removed.

referenced this issue
Open

### %loadpy inconsistent with "run all" in notebook #1110

The simplest (for user) imho it would be the ability to navigate sections defined in the notebook. At the moment I break long notebook into sections using markup cells but lack easy ability (besides PgUp/Down and browser's "search") to navigate the notebook.

Thanks

Owner

Yup, @yarikoptic, we were just having this exact conversation in IRC. The plan is to have special structural cells (rather than trying to infer structure from inline markup). So a cell can be 'level 0', 'level 1', etc, and then we can build into the UI a navigation widget that lets you move around this structure. Furthermore, we want to add tabs like worksheets have, so that it's easier to break up long notebooks into parts.

Owner

I'll +1 having collapsible cells.

Also, I think it would be good to have a 'pylab' flag in the notebook format, triggering the kernel to enter pylab mode when you open that notebook, rather than having to start the nb server with pylab. This could be extended to general options for starting the kernel, to cover things like which profile to use.

I've been seriously using the notebook for a research project now, and I have some feature requests, some possibly simple and one probably not.

1. In the newest version of the notebook with the menus, have the keyboard shortcuts displayed next to each menu item.

2. Be able to change the directory in the Dashboard. I've made launcher in Ubuntu to launch the notebook, but it either starts in my home directory (by default) or I have to hardcode the launcher to start somewhere else. It'd be nice to have a single launcher to fire up new kernel/notebook pairs, as opposed to having to do each at the command line. This might make things easier to make launchers on other platforms (there was a discussion on the mailing list about making one for OS X). There was a discussion about an upload dialog on the mailing list as opposed to the simple drag and drop. The drag and drop is insufficient for me because it copies the file rather than keeping it in my version controlled directory.

3. This is likely the hard one. I'd love it if help via the '?' and tooltip would work while another cell is executing. I have become addicted to the ability to have a cell executing and being able to edit other cells. My workflow often goes:

a) setup long running data analysis code in a cell and execute it.
b) start editing the next cell to plot whatever results come out of the analysis. Having autocomplete and documentation here would make my life so much easier.

I know this would possibly require having another kernel running, and having the two kernels be aware of each other's namespaces. If this were even possible, then it would be useful to not only have a kernel for help and tooltips, but multiple kernels for execution. I think this is similar to how Mathematica works with multiple kernels, but understand that this might be way beyond what the current architecture makes possible. I guess it also might be related to issue #1274?

Owner

In the newest version of the notebook with the menus, have the keyboard shortcuts displayed next to each menu item.

We'd already discussed this one, @ellisonbg looked into it and it wasn't too straightforward with the current jquery menu code, unfortunately. The menu support in jquery is still highly experimental (we're using a dev branch, not even master, of jquery), so hopefully this will just improve soon from upstream and it will then be easy to do.

Be able to change the directory in the Dashboard. I've made launcher in Ubuntu to launch the notebook, but it either starts in my home directory (by default) or I have to hardcode the launcher to start somewhere else. It'd be nice to have a single launcher to fire up new kernel/notebook pairs, as opposed to having to do each at the command line. This might make things easier to make launchers on other platforms (there was a discussion on the mailing list about making one for OS X). There was a discussion about an upload dialog on the mailing list as opposed to the simple drag and drop. The drag and drop is insufficient for me because it copies the file rather than keeping it in my version controlled directory.

Yes, this is important and high on our list. It needs to be paired with a UI element to shut down the server from the dashboard, though, for the GUI launcher not to simply leave zombie servers around.

This is likely the hard one. I'd love it if help via the '?' and tooltip would work while another cell is executing. I have become addicted to the ability to have a cell executing and being able to edit other cells. My workflow often goes:

Yup, nearly impossible, I'm afraid. It would require running multiple threads in the kernel to be able to respond to client queries while executing user code. Doing that in the heart of the kernel is more or less out of the question, due to the brittleness and complexity that it would introduce. I know exactly why you want it, b/c I've also wanted it pretty badly, but right now I don't see a robust way to provide the feature, unfortunately.

• clickable thumbnails for embedded pylab images

very often i would like to work remotely on a notebook (on a flight for example and i shy away from it because many of my notebooks have large sets of images that take a long time to load. but most of the time, i'm not interested in seeing all the images. would it be possible to have a configurable option that loads images as clickable thumbnails (low resolution images) that when clicked or hovered on can pull up a high res image?

Owner

Here's a new one. I've been learning a bit of R and have been using R-studio, with their pretty rad rstudio-server, which is somewhat similar to the IPython notebook. I really like the division of the screen space between the console, editing, plots/help and namespace much like matlab and octave. I much prefer the IPython notebooks cell based editing and layout to Rstudios editor/console, but a frame dedicated to plots might make a cleaner notebook. Inline plots can make my document long and cluttered when I am not making my notebook literate but just doing some quick analysis. If they could all show up in a frame on the right side of the notebook, that would be fantastic. The namespace browser in R-studio can be particularly useful as well, and something like this in IPython would be neat.

My dream layout might be: the entire left portion of the notebook was just for code cells. The right portion would be divided into two halves. The top half would be tabbed with a one tab namespace browser and the other a file browser. The bottom half would have on tab display plots (tabbed or indexed somehow), and the other tab would display help.

I guess this might be cramped on small screens. And certainly some people would want the ability to do inline plots. I can also appreciate that this would be a massive amount of work to alter the layout so massively, so maybe it's unreasonable at the current time, but maybe something to keep in mind going forward?

Owner

Thanks for the response. I figured you guys were aware of Rstudio, but didn't know your feelings about it's layout. I agree that things can looked cramp in the Rstudio layout.

Widgets are an intriguing idea. Especially if there is a good API for making new ones. Your example of a namespace browser is kind of unsatisfactory because it shows up in the output of a cell, which might be a few hundred lines of code away from where I want to access it again. Maybe a collapsible pane (left right top bottom), in which widgets could live might be nice. That way the user could do the cluttering in that particular pane.

I don't know if this came across in my comment, but the notebook is totally rad. I used to use emacs and a console (qt or terminal), but now I just do all of it in a notebook, and it is head and shoulders above. So thanks for that!

Owner

Yes, the inline widgets don't really cover all the usage cases because they scroll off the page.

Glad you are liking the notebook!

It's not mentioned here yet, so don't know if it's already planned... but better saving would be really nice. I think that perhaps a data urified html page (a single file) would be the best choice, unfortunately browsers can't save like that even if they can read the file format. I know that there's also MHTML, maff and WebArchive, but none of those are really cross browser.

Would be also nice to have ipython do the PDF processing too, as saving from the browser usually seems to get pretty badly formatted pages.

With those things the notebook could replace latex for many things. With future interactive elements, the html version could vastly surpass it.

More on the dreaming side, some kind of sandbox would be really nice. Right now the ssl and password protects unauthorized users from accessing the notebook, but there's no way to limit the control those users have on the file system. I could create a new user just for ipython, but for quick and dirty "Hi Bob, my dear co worker, check my calculations and the results here" it would be nice if Bob couldn't also ls my whole home folder, not to mention run shell commands as my user.

Owner

Until that happens, it should already be possible to show Bob a read-only view. Obviously that's less useful if you want Bob to be able to tweak your calculations, though.

Hello to everyone!
I've been using the IPython notebook in the last weeks and i fell completely in love with it!
The whole idea of literate programming got me, and right now I am using it regularly, making commenting my code and deploying reports a lot easier..almost fun (but don't tell my boss :) )

There are just a couple of small details that, without being a problem, could really improve my user experience:

Freezing text: sometimes i just want to read the text that is formatted as markdown, without modify it. Could it be possible to add a check box or something similar that prevent the text to enter the editing mode, showing only the formatted HTML?

Commenting and uncommenting the code: some button to just comment a whole block...just a small thing, but very useful in the exploratory phase, without having to repeatedly push those #

an optional way to use the MarkDown formatting on the output of a text: nothing big, but using sympy for symbolic calculus would look very very cooler if i could see the latex formatted formulas instead of the ascii version.

Thank you very much for this wonderful piece of software, and keep the good job!

Owner

You can already get Sympy expressions rendered in latex - run %load_ext sympyprinting

Thank you, worked like a charm!

Owner

@satra already mentioned optionally saving the workspace - it'd be nice to actually do that selectively - like adding a _sticky_ attribute to things that you want saved along with the notebook, so that anyone else opening the notebook would have access to it. This could then live in the previously mentioned "preamble" type of worksheet.

I can imagine a little dialog that pops up with the info available in %whos and allows you to place checkboxes next to the variables you'd like saved with the notebook

First of all: What you guys have done is mind-blowing. I have just started to use the new ipython notebooks and they are awesome!

My feature requests is an interactive plotting in the html5 notebook and matplotlib. I know there's the html5 canvas for mpl and I wonder if it's possible to combine those. Is this in the works? If so it would be nice to add multitouch support for tablet users (not in the html5 canvas currently).

again, great work!

Owner

Hi, and thanks for the great work!

Two small issues I would really like to see:
1) Cell folding: If you have longer scripts inside a cell it would be very convenient to fold the cell similar to syntax folding in vi
2) sympyprinting (-> really really nice feature): possibility to render matrices (numpy arras) as well (OK, up to 2 dimensions :) ). This way nice formatted matrix algebra would be possible as well.

Thanks again!

Another idea: highlighting of matching brackets. The qtconsole does this, and i find it often useful to have a better overview of what I have written.

And thanks for the wonderfull IPython! (only a bit pity that Spyder does not support it anymore)

Another idea: it would be nice to have a panel listing the variables in the current scope which one could click on to inspect, a à la RStudio or matlab

A very simple and small upgrade could be to add, under the number of the block, a little block of text that show how long the code has been running or, if it has finished, how long did it take to complete the step.
in two words, implicit timing (of the code).

I like the idea of the variable exploring, but maybe instead of a panel (that can be cumbersome), just a special magic that return a well formatted html would be more interesting (for example you could insert a "preview" of the object representation or something like that)

On a second thought, showing the line number next to the code (very small, and non intusive) would be useful if you have a function with ore than a dozen line and a syntax error pop up. The system gives you the line number, but it is worthless without any number line.

It would be useful also for the explanation of the code: "read line 6" sound a lot better than "look at that line in the middle that start with foo.foomethod"

Owner

@EnricoGiampieri We decided to keep the UI in notebook as simple as possible, but it should (soon) be easy to implement your own JS/html widget for the notebook.

The magic system will also be soon reimplemented,for all magic to be standalone object easily extensible. You can try to have %who returning a object with a _repr_ and a _repr_html_. I've tried with %ls to have nice list with icons but html/css subset supported in qtconsole is really small compared to recent browser.

As for the line number in notebook, it's already a feature use the C-m l(lower casse L) shortcut. See C-m h for the whole list of shortcut.

Owner
Owner

Do we really want more _repr_ than frontend ?
I two html repr will be confusing.
Object with custom _repr_ representation can just have a class flag to toggle between real and minimal html representation.

Owner

Well, we already have more _repr_ than frontends: pretty, html, latex, javascript, json, svg, png and jpeg. I agree that adding another type of HTML would be confusing, but on the other hand, I don't want the Qt console to stop people developing interesting HTML reprs that other frontends could use. Another approach might be for the Qt console to detect HTML features it doesn't support, and fall back to another repr; I don't know how hard it would be to implement that.

I'm not sold on the class toggle idea - it requires manual intervention from the user, because the kernel doesn't know about the frontend in use, and it'll be awkward if you have a notebook and a Qt console attached to the same kernel. The display protocol is designed for precisely this: letting different frontends display the same thing in different ways.

Of course, maybe the benefit of rich HTML reprs isn't worth the added complexity of handling them. The important question is: what cool stuff could we do with rich HTML reprs in the notebook that isn't possible with plain HTML?

Owner

hum... I don't think video works in QTconsole, neither does audio.

You can also get rid of a big layer of complexity with using HTML5. I've tried to make a Graphically improved %ls command, (à la termkit, which seem pretty cool, but I was never able to make it works..)

and it is a pain in the ass with qtconsole html.

First because you have to embed images, second because you have a really small subset of css, which prevent you from doing things easily.

At the beggining I was thinnking of smth like <li class='fileExtension'> filename </li> then just a css multicolumn layout, and a css before: for a icon that was depending of the filetype. And i'm now using nested table/tr/tds, transforming the list of file into a matrix, to transpose it just because I still want ls result to be arranged in columns... but it works (will make a PR when magics are refactored)

I guess we can also try to have the qtconsole pop up/slide a webkitview if it gets html5 contents.

So the pain to have one more repr now might be worth for later things we don't think of right now (or things other will do)...

Owner

The QtConsole barely supports HTML - it's basically good for HTML as RTF (a/b/img/table). What we want to (and do) support in the notebook is arbitrarily complex dynamic web content.

I don't think people are really writing HTML reprs for the QtConsole, so the main thing would be for the qtconsole to somehow guess if a object fits in the tiny subset of HTML that it supports, or not. Simple checks might be:

• frame/iframe tags
• scripts (script tags, and maybe onclick/etc. trigger entries)

I expect those together would cover ~all of the interactive objects that it doesn't support.

I would like to see something from people who are using HTML reprs in the QtConsole, because the answer might be that the QtConsole simply shouldn't claim to support HTML, even though it does support static HTML.

Owner

Honestly, the QtConsole should probably be a WebKit view, not a RichText widget.

Owner

Can we interact with a Webkit view as tidily as with a RichText widget, or would a lot of the logic need to go in javascript?

Owner

I have no idea - it may not actually be reasonable at all. But the cursor navigation and such is a bit of a mess in the RichTextWidget, partially because there's no DOM. Simple things like append X after Y are quite complicated as a result. That's why we still have issues where you can lock up the QtConsole by having a weird sequence of messages that put the cursor in the wrong place, or end up being allowed to edit areas that are not input.

Owner

Webkit as no notion of cursor, so we would have to re-implement all cursors mode for selection ... etc
But then, would the qtconsole just be 'another notebook' ?

Owner

Do you think a ipython notebook --shutdown-kernels [file.ipynb | kernel-id | notebook-id] could be a good idea to complete the ability to open .ipynb files from the command line ?

Owner
Owner
Owner
Owner

We could kill individual kernel by sending a delete to [notebook-server-url]/kernel/kernel-id. That what I'm dooing in #1676.
The frontend is just complaining that the kernel has died...

commented

I am writing an Emacs IPython notebook client because writing code in browser is pain for me.

For writing a new client, I had a chance to see notebook internal so I have a few ideas/requests, not only for Emacs client but also for improving HTML client.

1. Isn't it better to hold notebook data on server side so that JS client does not need (re)serialize notebook data to save it? I guess it has many benefits:

1. It simplifies JS code.
2. It makes easier to test as you can implement it in pure python.
3. It helps implementing ability to manipulate notebook from command line like in this PR (add file_to_run=file.ipynb capability to the notebook). For example, isn't it better to clear output cells in-place using command, so that you can write a shell script to backup and commit clean IPython notebooks automatically?
4. And of course, it helps me implementing Emacs client, and possibly other IPython user implementing another client!
2. Loosely relating to the previous idea, it will be nice to have synchronization support for notebook clients. For example, if you open a notebook in two browser tabs (or in different computers), it would be nice to see one notebook client update notebook automatically when you save the notebook (or even whey you execute a cell) on the other client.

It will be very nice if I can open same notebook in Emacs and browser side by side, write notebook in Emacs and see the result updated in browser.

I think synchronization support is important when you implement autosave because you can accidentally override saved data when opening two clients.

I see synchronization support is discussed above. What is the state of this?

3. How long do you plan to support draft 76 protocol? As websocket.el (Emacs websocket client) does not support RFC 6455 yet, it will be nice if you support it, at least until tornado support it.

Owner

Some points:

Isn't it better to hold notebook data on server side so that JS client does not need (re)serialize notebook data to save it?

The notebook struct will never live in-memory on the server, as this obliterates scalability for the planned multi-user notebook server.

It simplifies JS code.

Actually, it doesn't. Moving the nb struct to the server also does not simplify the javascript code, as it increases the number of server communications dramatically. Managing the json that is the file-format is a very simple part of the JS, so there is not much to simplify there. Almost all of the javascript is for handling dynamic interaction, which is not associated with managing the file format itself.

It makes easier to test as you can implement it in pure python.

In a manner of speaking, yes - though it doesn't help test the Javascript at all, which is where we desperately need tests. And as discussed above, it doesn't significantly reduce the amount of javascript code there is to test.

It helps implementing ability to manipulate notebook from command line like in this PR (add file_to_run=file.ipynb capability to the notebook). For example, isn't it better to clear output cells in-place using command, so that you can write a shell script to backup and commit clean IPython notebooks automatically?

True, though this is already quite easy. You can load the Notebook object in Python, and work with it and a KernelManager without much difficulty. There could certainly be a higher-level wrapper to this model, but it would be very light indeed.

It will be nice to have synchronization support for notebook clients.

We absolutely do have diff-based Save on the roadmap, where only changes are propagated from client to server. This will finally make decent live collaboration feasible, which is our single most-requested and highest-priority new feature.

What is the state of this?

The state of this is "planned", but nothing yet implemented.

How long do you plan to support draft 76 protocol

I imagine we will support draft76 as long as tornado does - we don't do any work to support it other than switch tornado's default from on to off in recent versions, so I don't see any reason to disable it. If tornado drops support, we likely won't do any work to restore it, so you would have to start requiring less-than-current tornado.

commented

The notebook struct will never live in-memory on the server, as this obliterates scalability for the planned multi-user notebook server.

I can imagine, but still unclear. Can you elaborate it a little bit more? You already have shared kernel, right? How can having notebook in-memory become a bottleneck? I have very limited experience on server side programming so maybe I missed some point.

It simplifies JS code.

Actually, it doesn't. Moving the nb struct to the server also does not simplify the javascript code, as it increases the number of server communications dramatically.

For code cell, it does not, right? Because you need send it to server anyway. For other types of cell, you are right. I missed that point.

It will be nice to have synchronization support for notebook clients.

We absolutely do have diff-based Save on the roadmap, where only changes are propagated from client to server.

Great! I was uneasy about sending all data from clients. Diff-based approach also solves the problem.

But again, what is the difference between the in-memory approach and this diff-based approach? Once you have diff-based synchronization, you can also save notebook data by transmitting only differences, right? Then, hypothetically, you can easily hook notebook saving to execution of code cell or rendering of other cell types. I guess this is almost equivalent to in-memory approach. The only difference is that data is in-memory or always stored in the file. Of course, you may not want to hook save to execution/rendering as it increases file access (although I don't think it is a bad idea if you are using it in single user environment). But I don't see much difference on implementation, except the point you mentioned about scalability. Especially on JS side, I imagine that the complexity will be equivalent.

(Well, that means it does not decrease client side complexity anyway...)

This will finally make decent live collaboration feasible, which is our single most-requested and highest-priority new feature.

What is the state of this?

The state of this is "planned", but nothing yet implemented.

How about making an issue on the github tracker then? If it is frequently asked feature, I imagine people want some place to get notification when there are some movements.

How long do you plan to support draft 76 protocol

I imagine we will support draft76 as long as tornado does

Good news for me. Thanks!

commented

I have another question about diff-based approach. Let's consider the following situation:

1. You open a notebook A on client C1.
2. You edit the notebook A, which makes diff D. (You don't save A yet.)
3. You open the notebook A on client C2.

How can you synchronize C2 with C1 if you don't have the diff D in server memory? Of course, you can ask C1 to send D it to server but it will be hassle to implement that.

Or do you mean synchronization occurs only at the saving time? That means difference of notebook contents between clients may grow than always-synchronize approach. You can increase frequency of autosave, but again, it just moves the notebook structure to server memory to server file system.

Owner

I can imagine, but still unclear. Can you elaborate it a little bit more? You already have shared kernel, right? How can having notebook in-memory become a bottleneck? I have very limited experience on server side programming so maybe I missed some point.

Current server state:

• set of connections to kernels, and mapping of notebook-ids to kernel connections.

That is all. The size of notebooks has no lasting effect on the server, and only affects the cost of save/load operations (network transit to server, and save to filesystem or database). Further, this is readily sharded across multiple server instances once numbers are large enough.

If the server has to track which notebooks are open/closed in memory, this is a great deal more state, logic, and load in the server. For instance, if you have notebooks with many large figures, it becomes easy to run the server out of memory just by opening them, if they are all kept in memory.

But again, what is the difference between the in-memory approach and this diff-based approach?

There are two things for what 'in-memory' means:

1. The server is the object that creates the notebook from the message protocol.
2. The server has access to the notebook, and is the source for retrieving its current state, and possible updates.

case 1. will likely not happen for scaling and complexity reasons detailed above, given what tiny benefit it would provide.
case 2. differs only as a server-side implementation detail, whether the server persists the full notebook in a database, the filesystem, or memory. The important difference is that all notebook operations are initiated by Clients, none on the Server. A change to the notebook will never happen until a client asks it to.

Once you have diff-based synchronization, you can also save notebook data by transmitting only differences, right?

Sorry I wasn't clear. We will implement diff-based save first, and once we had this language established, sync should be feasible.

How about making an issue on the github tracker then?

There is already an issue for the diff-based save: #1583. I suppose the collaboration could be tracked separately as well, but it obviously won't happen until #1583 is finished. We haven't quite figured out how best to decide when feature requests should leave this meta-issue, because there are so many that we want to avoid drowning in individual feature requests.

Owner

I have another question about diff-based approach.

I think we will have to make a lot more progress exploring implementations before we can have a fruitful discussion of what this kind of sync will look like.

commented

Thank you very much for the explanation.

1. The server is the object that creates the notebook from the message protocol.
2. The server has access to the notebook, and is the source for retrieving its current state, and possible updates.

So this case 2 is the diff-based you were talking about? This is what I have in mind in the first place also (although I mean to store notebook data literally in memory, not on file or DB). I didn't mean to send 'insert_cell_below' from client and got the new cell from server (this is the case 1, right?). Sorry that I was not clear.

We will implement diff-based save first, and once we had this language established, sync should be feasible.

So notebook server will save to the (temporally?) file before any sync is done, right?

We haven't quite figured out how best to decide when feature requests should leave this meta-issue, because there are so many that we want to avoid drowning in individual feature requests.

Well, I think top request serves the right to leave this meta-issue! And, if the state is "planned" as you said, it's not a request anymore, no? But I guess it's organizing issue so you should know it better than me.

Anyway, thanks for the pointer to the diff-based save issue! I will watch that issue.

commented

I think we will have to make a lot more progress exploring implementations before we can have a fruitful discussion of what this kind of sync will look like.

Actually, if case 2 is the diff-based approach you are talking about, my question is solved because the server is "the source for retrieving its current state".

Owner
referenced this issue
Open

### Make notebook saves more efficient #1583

Hi again,

Is it possible to provide meta IPython information from the IPython notebook server using JSON API? For example, send JSON containing IPython version, Kernel protocol version (if any), Notebook version, or something more when client access "/info".

The primary reason why I want this feature is that I am developing a notebook client, so I wnat know if the protocol is supported. But I guess it will be useful if you are going to support notebook in qtconsole (qtconsole as notebook client) and if this client connects to server via HTTP (maybe not, as you can directly connect to the kernel). Or, you can use that information to make "About" page (well, that's really tiny point I guess...)

I can write a PR if it is OK feature but there is no one willing to implement it.

Thanks.

referenced this issue
Closed

### Notebook does not exist and permalinks #1844

Owner

from an attendee of the UC Berkeley python bootcamp August 2012:
have the cell background change to indicate that the code inside it has changed after execution, if it hasn't been reexecuted

Two things:
1. The list of notebook to-do's in the first post in this issue now 404's just FYI
2. There was some discussion in January on the mailing list about a "presentation view" and or adding support for embedding cells/notebooks in html5. I know @ellisonbg was working on the JS backend earlier this year to help enable this sort of thing but what still needs to be done?

Owner
1. There was some discussion in January on the mailing list about a "presentation view" and or adding support for embedding cells/notebooks in html5. I know @ellisonbg was working on the JS backend earlier this year to help enable this sort of thing but what still needs to be done?

@ellisonbg is really busy until mid september.
you can have a look at
http://nbviewer.ipython.org/

it uses https://github.com/ipython/nbconvert
Which need work to be integrated into IPython so that you could directly export to html.

by presentation do you mean "static view" or "slideshow mode" ?

I was specifically referring to http://mail.scipy.org/pipermail/ipython-dev/2012-January/008562.html so I think that would fall under "slideshow mode" and while I am interested in being able to convert a notebook into a presentation format it's not exactly my immediate intended use case of this feature.

The specific features I'm interested in being:

• Code cells where the input can be hidden/locked so that html + AJAX could be semi-permanently rendered
• Ability to interact with the notebook kernel via ajax to update that html for example update a javascript plot or displayed system configuration.

My current solution is based on a mix of cherrypy+ajax with ipython in a iframe and both ipython and cherrypy being clients of a ipython cluster that has an engine running data acquisition but this setup I've found is a pain to setup and prone to failure.

Owner

I was specifically referring to http://mail.scipy.org/pipermail/ipython-dev/2012-January/008562.html so I think that would fall under "slideshow mode" and while I am interested in being able to convert a notebook into a presentation format it's not exactly my immediate intended use case of this feature.

Fernando did a presentaition on SciPy 2012 Texas where you were able to show cell step by step of a live notebook.
But this was really hackish, you can get an idea of what it looks like in #2127

Code cells where the input can be hidden/locked so that html + AJAX could be semi-permanently rendered

We figured out that one really need a clean way to edit the cell metadata to do so. This is work in progress.

Ability to interact with the notebook kernel via ajax to update that html for example update a javascript plot or displayed system configuration.

It is already possible to interact with the kernel through js. See #2313, dependig on what you want to do it might be more or less difficult, but if you wan't to try we'll be happy to get feedback.

It's true that we miss documentation and example on that.

I'd like to be able to rearrange multiple cells at at a time by dragging them. It'd be nice if you could even do this between notebooks. Sometimes I find that code for data analysis would make more sense in a different notebook, but it sucks to copy/paste it all.

Owner

Hi,
Managing multiple cell at once and drag and drop will sure be part of the notebook one day.
but, I'm not sure a cross-windows dragging is possible.

Owner
referenced this issue
Closed

### Implement autosave in notebook #1378

I scanned and searched for some mention of a hot key for editing the cells in the notebooks... I for one would love the ability to use a hot key combo to create a text cell or a code cell without having to mouse up. For creating tutorials in notebook, which is what I'm doing, a hot key option for cell types would be AWESOME!

Owner
Owner

@pleabargain you mean like Ctrl-m a and Ctrl-m b to create a new cell above or below where you are, and then use Ctrl-m m to switch it to markdown? Ctrl-m t to switch to raw, Ctrl-m y to switch back to code cell.

Ctrl-m h will show you the rest of the shortcuts.

Hi , I didn't go through all the above in detail so these requests may have been discussed.

1) I was wondering if there is any plan to implement a simple find and replace under the edit menu in the current notebook. I can see how short cut keys would conflict with the browser, but an option under a menu would still be useful.

2) What about having the ability for a collapsible folder structure under the IPython Dashboard. This would allow you to create a .ipynb under a folder in your notebook home on the file system.

Thanks

Hi everyone, I'd like to make a suggestion:

How difficult/realistic would an ipython notebook "Export to PDF" option be?
I like to do homework assignments in the notebook, but when I save the page as pdf (via google chrome's printing option), the page breaks often break up code snippets, go through plots etc.

Owner

Hi @rapidfyre007 ,

What you asked is nbconvert, and is on its way.
You can test if you wish.

(Firefox works better to split on the right placed when dooing "print")

I am hoping to begin working on a spreadsheet-like interface for matrix entry. One of the irritating things about Python, Matlab, and such is that quick data entry feels slower because a big chunk of key presses are syntax rather than data. The result is that I end up using Excel and when things escalate ending up with an OFFSET(OFFSET(OFFSET(-laden monstrosity.

Is this something that others would be interested in as well?

Definitely. In fact, it would be really cool if it was a widget that was directly embedded in a codemirror cell. So I could imagine something like:

in a code cell. Press a button or key, and that javascript widget flips back and forth between the list of lists syntax and the widget.

Then anytime I have a list of lists, I can highlight the list of lists and click your spreadsheet widget icon and I'll get the list of lists as a spreadsheet form, right there in the code cell.

As another example, Mathematica has an array input that is activated by doing ctrl-comma to add a column, and ctrl-enter to add a row. So if you want to enter a small array of 3x3, then you do: C-, C-, C-, C-enter C-enter C-enter and then you have a 3x3 grid of little empty square placeholders. Then the normal arrow controls are used to navigate and enter data. See also the documentation: http://reference.wolfram.com/mathematica/howto/InputAMatrix.html

That makes some sense. The only difficulty then would be in parsing the code to find the array. I was originally thinking of using a dedicated cell with keymaps to make CodeMirror behave more like a spreadsheet on the text, but your way is better.

Owner

Just bind

you don't need to find the array, you can just ask the user to select it, and replace the selection.

The second is the only one that have to be merged into IPython itself, the rest can be done fully through custom.js and async loading.

Owner

I'd like to be able to not have to start a notebook for each directory I have notebook files in. It would be better (IMHO) if there was a single server instance, with a file browser built-in to the notebook, rather than having to browse to the correct directory and starting up a notebook server there.

Owner

I'd like to be able to not have to start a notebook for each directory I have notebook files in. It would be better (IMHO) if there was a single server instance, with a file browser built-in to the notebook, rather than having to browse to the correct directory and starting up a notebook server there.

It is the plan in the end, it just have to be coded.

Owner

I'd like to be able to reference python variables that exist in a python cell in a markdown cell. I haven't found any similar requests on github but I found this request for it.

Owner

Frequently I calculate some results in Fortran and save them to text files. Then I want to plot it or analyze it in the notebook. So I have to maintain & archive both the notebook and the data files. (My data files actually happen to be really small, for example today I have two data files of 35kB each.)

Would it make sense to somehow embed the files with the notebook?

That way the notebook would be truly self-contained. Another usage would be when the notebook is hosted online (or on another computer) and you want to upload the data files through web browser so that you can access it.

Currently the only way is to copy & paste the contents of the file into a cell (as a string for example).

Owner

I would suggest you use the %load magic to put the file in the next cell, and then use the %file magic
to seamlessly write it on disk when the cell is executed.
It can then be easily shared.

The problem with "embeding data" is that the kernel is unaware of the fact that it speaks to a notebook or not. So how do you send the data to the kernel ? Moreover kernel and webserver can be on 2 different machines, so in many casses embeding the data does not make sens.

It will be as painfull to embed the data in the ipynb file each time you regenerate it than to archive both together.

Json is also really bad at embedding binary data (33% overhead of base64...). Tar is made to attach file together, and I don't think we should reinvent the wheel. Still notebook can have metadata and nothing prevent you from attaching data in those field, but I don't think it will be supported in the core.

I think there is also a discussion like that elsewhere, and the idea of ipynb 'folder' did emerge. but in the end, it will be the same when you will be able to browse disk : 1 project, 1 folder with data and ipynb file in the same folder. then you can share this folder.

It is viable as nbviewer for example allow you to browse multi-file gist and to link from your notebook to siblings files that shoudl show up magically.

Nice, I wasn't aware of %load and %file (resp. %%file, as %file didn't work for me). That works great. Except I am a little worried of accidentally modifying the cell with the file. Also, it occupies quite a lot of space, depending on the number of lines in the file.

But it does the job. Thanks!

Owner

Brian, good decision. So in this case, I think it might be a good idea to allow:

a) upload files over the browser

b) click a button and upload the notebook + other files into a gist.

But for my local usage, I will continue simply using git, as that what I already use.

Run selected text in an IPython notebook cell

I'd appreciate the ability to run a selected part of a cell quickly. Similar to the way pressing F9 in Matlab works. Often times I realize I want to add another statement to a cell but don't want to run the whole cell again but instead execute that line only.

Owner

@amir-f, Doable in your custom.js in 10 lines,
This is not the correct name for the event to listen for, but I don't remember the correct one.

Not tested, will not produce output anywhere. You should execute on the behlf of the selected cell if you want it to show the output, but you get the principle.

\$([IPython.events]).on('notebook_loaded.Notebook', function(){
'label'   : 'run selected text',
'icon'    : '--icon name to chose in font-awesome--',
'callback': function(){
var selection = IPython.notebook.get_selected_cell().code_mirror.getSelection();
IPython.notebook.kernel.execute(selection)
}
}]);
});

I'd love a simple keyboard short cut to insert a time stamp into my notes so I can see when I said what.

Also, I know this might be more a markdown thing, but I'd like some basic form of checklist, like in GitHub flavoured markdown. It would also be nice to be able to make simple tables without having to resort to putting them in a separate html cell, like with this markdown

@niallrobinson I've been timestamping my notebooks with !date, maybe that will work for you, too.

I would like to paste images into markdown cells, a la github comments, the digital equivalent of pasting a xerox into my (physical) notebook. It seems like jquery is ready to do this: http://strd6.com/2011/09/html5-javascript-pasting-image-data-in-chrome/

(Edit: A javascript code snippet to do this was posted to the IPython-Dev mailing list 2/7/2014, and you can see it work here)

Great thanks - those are two good suggestions.

referenced this issue
Open

### Include keyboard shortcuts in notebook menus, button tooltips, and link titles #4055

Hi!
I was wondering what happened with the multi-level sections idea for the notebook. It would be such a useful addition! When notebooks grow large, they start getting out of control for me. Is that feature in the near plans?
Thanks for the great work!

Owner

@germank We know that handling large notebooks gets pretty awkward, and we definitely plan to improve that experience. I don't know quite what or when we're going to do, though.

I second @germank - that's the feature at the top of my list. Nice to know its on the way at some point

A sidebar on the left with cells preview scrollable that will scroll the full notebook to the point... Something like in any pdf viewer (see preview on osx) but instead of pages can be used a svg-box with a customizable height... Something Like the overview map in most webmap tools. (see openlayers overview map)
... Hope it make sense, my 2cents

Input history search as is standard in any terminal REPL. I know you can use the browser functionality to search, but this will only capture commands that still have a visible cell, not the whole history of executed commands, and will not allow you to execute it again easily in your current cell.

Move cell to end.

All my notebooks have a 'graveyard' section at the bottom (mine actually has two tiers because I'm a hoarder and feel it's important to separate 'things I dont want but don't want to delete right now' from 'things I don't know if I might want later or not'). In any case some kind of shortcut for shunting cells to the end would be nice.

Small thing I know, but sometimes it can take more than half a minute to do this with copy + delete cell + end + paste + home + scroll back to starting point. Not hard to see how that can add up to half an hour or more in a day.

Personally this leads to something of a conflict between being tidy and being productive. My personality inevitably makes me lean towards the latter, so I often (always?!) end up with notebooks that are otherwise scrappier than they would be during development. And then I spend time going through tidying things up. And I've got stung once or twice removing something I needed.

Maybe this will resonate with many. Maybe not. Cheers anyhow!

referenced this issue in JuliaLang/julia
Open

### IJulia notebooks for documentation? #4579

It would be nice to have some sort of quick variable inspector. What I have in mind would be something like a tooltip/popup, (similar to the one which displays the function signature when tabbing inside a function) which activates when the mouse goes over the variable and some modifier key(for example Alt(Windows)/ ⌥(Option) on Mac) is being pressed. As soon as the mouse leaves the area over the var it goes away. Screenshot:

Owner

It would be dangerous as it might have side effect like inspecting next() would advance an iterator.
though you can select and shift-tab, it would pop-up a tooltip on selection.

Owner

I agree with @Carreau that it could be dangerous at times, but overall I really like this idea. It would not be difficult to implement on top of some of the changes in this PR: #4352

Owner

No, it should be done as refactor of Object-info-request, I think.

Owner
Owner

3) selection matches some regexp

This might be where it gets problematic. As basicaly you would like to inspect on almost any selection.
Whereas the input widget would actually have a behavior that depend on the regex.

But I hear you, I'm just wondering is this would not go a step too far to actually do a request to the kernel.

Now that we have multi-directory support in the master branch (awesome!!) is there a way to implement dashboard navigation (at the /tree level) of all the subdirectories with links (i.e. collapsible folders with point and click) instead of having to type in the tree subdirectories in the url bar?

Owner

Yes, working on it. Just wanted to get the backend functionality into master first, so it stopped blocking other work.

I know this have been asked before, but it could be very useful to be able to comment/unconment a line with a keyboard shorcut or button. In other words, add or remove a # in the beginning of the line.

Thanks.

Owner

@theviadsoft - this is provided by CodeMirror, via ctrl-/ or cmd-/

Well, it wasn't working for me. Tried in tree different browsers. Finally changed it in codecell.js to another key. So I will change my request to:

An easy way to define shorcuts or simply info in the on-line docs about how to do it. (It took me a while to find how :) )

I second @fperez @cmrivers and @Carreau:

multi-cell selection and actions. Right now, there's no way to copy/paste/delete multiple cells.


As of now, it is the key feature I am missing in IPython notebook (and why sometimes I miss Mathematica).

This was referenced
Closed

Closed

### Clear-all on save option #1280

The idea of a slideshow mode (i.e. interactive, not based on reveal.js) was mentioned several times in this thread - is this something that is planned?

Owner

It is implemented as an extension you can find in here damian avilla also have a prototype of this working with reveal.

The interactive prototype working with reveal.js is here: https://github.com/ipython-contrib/live_reveal
I will probably change some things in the next weeks, but you can use it and blame me right now...

Well, at the moment the single most annoying issue to me is, that I cannot use the IPython notebook as a frontend to Pweave. How great would it be to have the full power of Latex at your hands for layouting while you run the code chunks truely interactively. I know the workflow from R using Sweave, but no environment has the power of interactive literate programming with publication quality pdf output. So using the %%latex cellmagic comes pretty close, but it would be a dream comming true to have the same control over the output of code chunks as in Sweave (like manually embedding graphs, surpressing code, etc...)

### Navigate Cells with keyboard

I really would like to navigate from one cell to the next (witthout executing) it with one key press.
Ctrl-<down arrow> kind of works, but Ctrl-<up arrow> does not. Just discoved that Alt-<up arrow> works for navigating up (but not for navigating down).
Could we make it more consitant and document it in the keyboard shortcut section? The Page Up and Page Down keys would be good candidates IMHO.
Edit Ctrl-m n already exists for navigating down

Owner
Owner

For that matter, in IPython 2.0 you can go into command mode and navigate between cells with just up/down arrows (or j/k if you prefer).

A minor idea, but it would be nice to be able to set variables as True or False using checkboxes.
In my data analysis, I often want to selectively include and exclude snippets of code.

# What to exclude
exclude_subjects = True
exclude_incorrect = True
exclude_moderate_condition = True


Later on:

if exclude_subject:
do xxx


Checkboxes would be a snazzy way of toggling these options!

# Sorting cells?

I have been using the ipython notebook as an actual Markdown notebook, just something to take notes at meetings, etc. Not all meetings are independent, though. I was thinking about a way we could sort cells by date (the way I take them) but also a way to sort them based on some metadata that I can attach to the cell. Then I can organize the notebook relative to some metadata content for quick reference.

This also made me think of the way I code, usually having some kind of parent cell where I read in some data, and then daughter cells where data manipulation, plotting, or prototyping is done. I guess this falls into the idea of code blocks (A collection of related cells). I think that some version of the sorting method described above could be a kind of solution for unwieldy or long notebooks, or at least a way of coming back into a notebook and retasking back to where you left off.
If there is a better way, please let me know.
Thanks.

referenced this issue
Open

### Revision control Integration

My notebooks are inside a git repository for revision control. Recently, thanks to a post on stackoverflow I set up a git filter to strip the output from the notebooks before committing to the repo, enabling an efficient revision control.

To further improve the workflow, I suggest basic integration into the notebook interface itself. In it simplest version, after an initial setup, CTRL+S would trigger a commit command of the output-stripped notebook into a repository (for example: git add <file>; git commit), optionally allowing to enter a commit message (e.g. with CRTL+SHIFT+S)

### Tab suggestions to work while kernel is busy

this probably can be implemented by having separate thread for suggestions,
computations sometimes take too much (more than 10 minutes), it it hard to write code without any suggestions.

Thanks for IPython!

## Allowing single notebook to be split among multiple pages

It would be nice to be allowed to split a single notebook in different sub-pages.

Logic:
At the moment I am using a notebook as a "final front-end" for a python application for data analysis running on a server.

As more and more development is carried out, the notebook (as the "back-end" code) is growing being populated with pictures and code.

At the present time, the notebook got very large and not very handy to work with anymore.

Splitting it in different pages would be handy.

@acorbe would it be sufficient to have collapsable headers? (like in Mathematica)

@rossant , It would be an improvement, I guess.
Is this feature present already? (I didn't know, sorry)

Imagine having O(200) cells with codes and picts already "thematically grouped" by titles and so on (my present situation).

It would be cool to be able fold/unfold all the cells in a "single chapter" at a time, as well as to navigate through different "chapters" in a click.

what do you think?
thanks

It looks like it has been implemented as an extension (see #805).

If I start a notebook up and I want to pick up where I left off, I need to go through and find all the cells I need to rerun to get back to where I was. Would it be possible for the user to create macros to run certain cells in a certain order?

btw I'm using the code folding extension and its no exaggeration to say its completely changed the way I use notebooks. I'd love to see something equivalent supported properly in NBViewer etc.

Just one more thought - to do with code/section folding and @acorbe s suggestion of splitting one notebook over different pages...it might be worth considering some kind of system of name spaces. As I've used code folding, and my notebooks have been able to get much longer, I'm finding the occasional accidental conflict with objects from way up in my notebook. Maybe different pages could be different name spaces.

## 2 cents: Toggle Input Cells

1. Cell -> Current Input -> Toggle.
2. Cell -> All Input -> Toggle.

You already have this going for output cells. This would be very very useful for illustrations and explanation of many many concepts (teaching essentially).

Agreed that for education, this would be very useful. And for other uses too. However, due to restrictions, such behavior will probably not be able to be added to IPython.

But, we are working on suitable functionality that would encompass this behavior. Basically, we are thinking of In/Out Tabs for a particular cell.

If you would like further details, feel free to email me directly at doug.blank@gmail.com.

referenced this issue in ipython-contrib/IPython-notebook-extensions
Closed

### Can one copy/paste an entire section? #85

removed the type-enhancement label

# pandocs-citeproc support

I'd be really nice if we could use citations in markdown cells like those supported by pandocs-citeproc:

for instance, with this:

    ... in a process called *Muller's Ratchet* [@Muller1964; @Haigh1978].
.. as suggested by Drake [-@Drake1991].
My model is based on that by @Hadany2003 who showed...



we 'd get this:
... in a process called Muller's Ratchet (Muller 1964; Haigh 1978).
.. as suggested by Drake (1991).
My model is based on that by Hadany and Beker (2003) who showed...

(I picked up those examples on the blog of Yoav Ram)

Another nice alternative would be proper latex citation syntax, but i think those were already requested.

Owner

Citations are possible with syntax like this <span data-cite='key'></span>. See my cite2c extension for a way to insert and manage them automatically. For a nicer syntax, we're waiting for CommonMark to standardise a generic inline extension syntax for Markdown. We've talked to John Macfarlane, the author of pandoc, and he's heavily involved in CommonMark, so we're optimisitic about that.

whoa, that was fast. thanks! this syntax is a bit ugly, but your extension will save me a LOT of time.

Now I'll be looking foward to see the progress of CommonMark =D

Recover trashed cells after holding down the "d" key. I've lost many hours of work from accidentally deleting many cells because I've leaned on the "d" key too long, usually when I fall asleep at the keys. The feature could work like this: after leaning on the "d" for about one second, pause the deleting with a modal dialog, "Hit 'y' to continue deleting everything."

Owner

I wonder if we can distinguish between the user pressing and holding a key versus pressing it repeatedly. Deleting a cell should ideally require pressing d twice, not just holding it down until it automatically repeats. I would imagine that the answer is 'not in any reliable way across different browsers', though.

Multiple undelete is already tracked as an issue: #4924

We probably can by detecting keydown and keyup events. At least, I'm pretty sure key repeats don't trigger multiple down/up events.

Owner
Owner

For reference: repeats appear to result in consecutive keydown events without keyup events in between (at least on Chrome + OS X).

If our keyboard shortcuts used keypress instead of keydown, the vast majority of the compatibility and weirdness of browsers and keyboards would go away. There's one caveat, though: we still must use keydown for non-text shortcuts (mainly esc).

Instead of watching keystrokes, could you put a listener on the delete event itself that splashes a nag dialog when it sees repeated deletes?

I think it would be nice on big desktop screens to have a two pages layout of one notebook, what do you think?

Owner

Hello! I'm not sure if this is already available, but is there a way we can have a javascript hook when the notebook text editor gets loaded. Right now I think custom.js only let's you hook into when notebooks get loaded, but I could be wrong.

I'm trying to do this so I can add a codemirror keymap option to the edit dropdown.

It looks like we just need to add events.trigger('app_initialized.EditorApp'); to main.js under edit.
Question: should the event be 'app_initialized.EditorApp' or something else?

Is there already a Feature Request for Block comment/uncomment?

Block comment/uncomment is handled by the editor (CodeMirror). As that is language-dependent, that could be tricky. But control+/ does comment out the block one line at a time, and is very robust... even if the user's selection is a bit off. In any event, CodeMirror would be the place to make the request.

Yes, just discovered that.. unfortunately it seems only to work on US Keyboard layout..
Could it make sense to uncomment all if having multiple lines selected and hit # ? A bit like indentation works?

#### Tabbed notebooks

I was thinking that it would be really nice to have separate "pages" or "tabs" associated with a notebook. These would be essentially subnotebooks that are all connected to the same kernel. The main idea is that it would be easy to separate concerns within the document, e.g. one page for imports, initializations, data loading, another page for defining common functions, then a page for the main calculations. Or if there are multiple parts to the calculation that are logically separable, these could go to different tabs as well. I've been finding myself working with large notebooks with tons of output and it gets cluttered really fast. This kind of organization would fix that problem.

Owner

We actually had a plan to have worksheets in notebooks - it was even reflected in earlier versions of the file format. But we didn't do it, and we decided that we probably won't, although we're open to someone doing it as an extension.

We know that working with long notebooks is awkward, and we do have some plans to address this, like collapsible sections or tables of content.

Hello everyone! I have no idea of how it could be implemented, but it feels like a somewhat critical, at least I face this problem very often. If something occasionally outputs some huge chunk of text into it's output then chrome (and I guess the same thing applies to other browsers too) becomes super-unresponsive (consumes entire CPU and stuck) trying to render all that text in a cell output. The most unpleasant part is that if you close this unresponsive tab and try to reopen the notebook, it would very likely tell you that it is corrupted or too huge to be successfully opened :(

Probably, if you could add some internal super-simple profiling thing that could detect (e.g. too much time between two sequential timeout callback calls) those sucks, stop pushing output to notebook cell and suggest user to clear cell (or continue)?

I personally suffer from that effect a lot :( That would be great if you could solve it somehow.

I've suffered from this too. It would be lovely to stop this happening. Especially as the only way to recover is to hand edit the notebook!

Hi all!
After making what I consider a reasonable effort to find a duplicate, I've decided to chip in with a major request. I know that Jupyter is taking over some of this stuff, but I find it incredibly detrimental to my productivity that I can't refactor code in an IPython notebook. To do so I either have to edit the ipynb file as text, or to export the whole thing to python code, which defeats the purpose of IPython in the first place. I've even looked at some of the python IDEs (PyDev, PyCharm, Spyder) but I think that IPython is only used there as an interactive console, and the entire concept of the notebook is lost.
Firstly, I'd request a "rename" refactor. Later on, maybe some object-oriented stuff like generation of accessor & mutator methods. All of this stuff seems pretty straightforward for the most part, and I'd hate to think of the IPyhton project loosing steam just because productivity is handicapped because of it.
Many thanks to all the developers who make this project happen!

@InonS ipymd might be a partial solution: you can replace the ipynb format by a Markdown document, which makes refactoring easier in a good text editor

@rossant Thanks! I took a gander, and confirm that the notebookfile file format probably could and should be more portable, e.g. Markdown.
Still, anything that forces me to do my refactoring in an external text editor is a setback, as far as I'm concerned. A user must be able to do all the development in one environment, this includes both running interactively and refactoring.