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

Introduce a setup cell #1075

Merged
merged 4 commits into from
Mar 28, 2022
Merged

Introduce a setup cell #1075

merged 4 commits into from
Mar 28, 2022

Conversation

jonatanklosko
Copy link
Member

The first towards improved dependency management. This introduces a special cell for code that initializes the notebook (in practice it's just a code cell, but it has a slightly different UI).

setup_cell.mp4

The cell is automatically shown in all notebooks, but it's persisted only if it has an actual content. In a way, we just introduce a convention on where to install dependencies and set global configuration.

As shown above, reevaluating the cell automatically restarts the runtime (as indicated by the run button), which makes adding a new dependency more intuitive (as opposed to the error + restart runtime button we currently have).

The setup source is always shown when creating/opening a notebook (so that the user can always review the code), and it gets collapsed once run (since it is a form of boilerplate, conceptually run only once).

@jonatanklosko
Copy link
Member Author

jonatanklosko commented Mar 28, 2022

Resolved

Since we show the source until evaluated, it looks a bit confusing when opening notebooks with no setup:

image

I'd be fine with always collapsing it when the source is empty. This would mean that newly created notebooks have it collapsed too (which I actually prefer), or we could make this cell in insert mode right away for notebooks. @josevalim let me know what you think :)

@josevalim
Copy link
Contributor

What if the text says: "Install dependencies and setup notebook"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants