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

Jupyter Notebook: add access to cell metadata #1182

Closed
chrisjsewell opened this issue Nov 19, 2019 · 22 comments
Closed

Jupyter Notebook: add access to cell metadata #1182

chrisjsewell opened this issue Nov 19, 2019 · 22 comments
Assignees
Labels
feature-request Request for new features or functionality

Comments

@chrisjsewell
Copy link

Feature: Notebook Editor, Interactive Window, Python Editor cells

As an extension to #1121, to access the full notebook functionality, cell metadata should be accessible to view and modify in some manner.

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

@rchiodo
Copy link
Contributor

rchiodo commented Nov 19, 2019

Thanks for the suggestion.

How do you access it now outside of VS code?

@chrisjsewell
Copy link
Author

In Jupyter lab, the cell and document level metadata is available in the side-bar, which also contains controls for tags, and is interactive (i.e. you can type into the metadata boxes). This would be the ideal solution, but I'm not sure if this could be achieved in the VS Code view containers? If not, perhaps a partial solution would be a button to toggle between a metadata viewer and the current variables' viewer.

image

image

@DonJayamanne
Copy link
Contributor

Thanks for the suggestion. We'll review this and get back to you.

@greazer greazer changed the title Jupyter Notebook: add access to cell metadata DS: Jupyter Notebook: add access to cell metadata Nov 21, 2019
@sverchkov
Copy link

This is essential for rendering notebooks into slides.

A simple solution for cell metadata would be to add the option to view and edit the raw json of the cell in addition to the current markdown/code options.

@IanMatthewHuff IanMatthewHuff transferred this issue from microsoft/vscode-python Nov 13, 2020
@greazer greazer changed the title DS: Jupyter Notebook: add access to cell metadata Jupyter Notebook: add access to cell metadata Nov 14, 2020
@greazer greazer removed the Epic label Nov 14, 2020
@nathancarter
Copy link

Well...it would be epic...

@DonJayamanne
Copy link
Contributor

In the mean time you can use the following extension https://marketplace.visualstudio.com/items?itemName=donjayamanne.jupyterpowertools
FYI - This only works in the VS Code insiders version (ability to edit tags, slider, )
Editint raw cells, metadtaa & notebook metadta is coming (in that extesnion)

@chrisjsewell
Copy link
Author

Awesome thanks!

@greazer greazer added the bug Issue identified by VS Code Team member as probable bug label Jul 8, 2021
@psychemedia
Copy link

Cell tags (which are found in the distinguished cell.metadata.tags metadata element are also used to support rendering of notebooks via Jupyter Book eg to hide particular content elements.

How to add such tag metadata to notebooks is described here.

@Mjvolk3
Copy link

Mjvolk3 commented Oct 7, 2021

Hi there, is this feature coming anytime soon? To edit metadata the easiest way of now is using jupyter's editor. The json can be edited in vscode, but I find it much slower.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 7, 2021

Sorry not planned any time soon. For now you can use Don's extension mentioned above: https://marketplace.visualstudio.com/items?itemName=donjayamanne.jupyterpowertools

It only works on insiders though.

You can check the issues that are planned for the near future by using the milestone. Here's what's coming up for October:
https://github.com/microsoft/vscode-jupyter/milestone/17

@marcelo-lara
Copy link

+1
btw: the Don's extension does not work =(
image

@tbenthompson
Copy link

Just a comment hoping that this gets prioritized at some point. At the moment, this blocks using VSCode for several common applications of notebooks (papermill, jupyter-book, and more). Thanks!

@jesusmariajurado
Copy link

+1
This would be very very usefull

@rafagsiqueira
Copy link

This might be obvious, but for those looking for a workaround on vscode: right click on the notebook -> Open With -> Built in text editor. Then edit the metadata tag directly in the Notebook JSON.

@amirbtb
Copy link

amirbtb commented Mar 8, 2022

This could be useful to parameterize notebooks for papermill which is becoming a standard.

@luukalt
Copy link

luukalt commented Mar 10, 2022

+1
This would be very nice!

@cheginit
Copy link

Ability to add cell tags is necessary for nbsphinx-gallery that sphinx uses for generating documentation websites. Adding tags to notebooks by opening it as a json file can be difficult and at time not even possible since notebooks tend to be large files. So adding tags would be very helpful for this purpose.

@DonJayamanne DonJayamanne added power-tool-candidate and removed bug Issue identified by VS Code Team member as probable bug labels May 3, 2022
@DonJayamanne DonJayamanne self-assigned this May 3, 2022
@greazer greazer added feature-request Request for new features or functionality and removed enhancement labels May 4, 2022
@vitchyr
Copy link

vitchyr commented Jun 27, 2022

+1 this would be great!

@mertgoksel
Copy link

This would help tremendously. +1

@rebornix
Copy link
Member

Hi all, thank you for the feedbacks and your interest in cell tag and metadata editing support in VS Code. We have just published two extensions

which will allow you to update cell tags and slide show inside the notebook editor

Screen.Recording.2022-09-21.at.11.26.25.AM.mov

Please give them a try and feedbacks welcome ;)

If you are also interested in how it's implemented or you want to build an extension for a cell metadata that we don't support yet, you can find their source code in https://github.com/Microsoft/vscode-jupyter-slideshow and https://github.com/Microsoft/vscode-jupyter-cell-tags and tweak them to fit your need. We are interested in how you are using cell tags and metadata and figuring out how we can improve the experience to make you more productive. Thanks!

@psychemedia
Copy link

Re: possible applications of tags, I use them to provide custom styling for cells in JupyterLab etc.. https://github.com/innovationOUtside/jupyterlab_empinken_extension

Another use might be to customise cell rendering behaviour, a bit like IPython cell block magics. eg parse contents of a markdown cell tagged mermaid-js as:

```{mermaid}
ORIGINAL CELL CONTENT
```

@phense
Copy link

phense commented Mar 2, 2023

Well, it's not “perfect”, but the Cell Tag Extension does provide access to the Cell-Metadata from within VS Code.
Selecting “Edit Cell Tags (JSON)” opens the notebook in JSON format, and allows you to freely edit it (see '"metadata": {' ) on the right.

image

Well, better than having to switch to jupyterlab just to edit some tags and cell metadata.

Thanks, Microsoft!

Still, it would be nice to have a dedicated edit-window just for the notebook- and cell-metadata.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests