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

"norun" cell metadata #20

Open
stevengj opened this issue Oct 12, 2015 · 4 comments
Open

"norun" cell metadata #20

stevengj opened this issue Oct 12, 2015 · 4 comments

Comments

@stevengj
Copy link

It occurred to me that it would be useful to have a norun code-cell metadata flag, that used to:

  • Prevent the cell from being executed in the notebook interface when Run All is chosen — you have to run the cell explicitly with shift-enter etc.
  • Prevent the cell from being executed when it the notebook is included in another notebook via the %run magic in IPython.
  • Prevent the cell from being executed when the notebook is included in other contexts, e.g. in my NBInclude package for including IJulia notebooks in Julia programs.

I have been thinking about literate programming styles based on the notebook format, which is why I made NBInclude so that notebooks can be first-class collections of Julia code (as an alternative/supplement to .jl files). If I'm developing code in a notebook, I might want runnable code examples and tests mixed with the "production" code, but I wouldn't want those snippets to be executed along with the rest of the file when I include the file elsewhere.

The UI in the notebook could be a checkable "Skip Cell in Run All" menu item in the Cell menu, and perhaps the norun cells could be displayed slightly differently, e.g. with a darker-gray background.

@minrk
Copy link
Member

minrk commented Oct 12, 2015

I think this is a reasonable candidate for a tag. We've been talking about using a list of tags for some simple metadata markers, and this seems like a good one. cc @ellisonbg

@stevengj
Copy link
Author

Yes, tags are potentially very useful. e.g. I'd also like to use a test tag for marking unit tests, and a doc tag to label markdown cells as docstrings for Julia functions and methods.

@stevengj
Copy link
Author

(There's also the question of whether the cell metadata tags should be sent to the kernel as part of the execute_request message. I don't have any immediate use for this, but I can imagine it could be useful.)

@rgbkrk
Copy link
Member

rgbkrk commented Jan 6, 2020

I think this is a reasonable candidate for a tag. We've been talking about using a list of tags for some simple metadata markers, and this seems like a good one. cc @ellisonbg

I've closed my PR that attempted to standardize tags and description: #134

If anyone wants to have at it, feel free.

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

No branches or pull requests

3 participants