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

Test: notebook output editing api #117296

Closed
2 tasks done
rebornix opened this issue Feb 22, 2021 · 0 comments
Closed
2 tasks done

Test: notebook output editing api #117296

rebornix opened this issue Feb 22, 2021 · 0 comments

Comments

@rebornix
Copy link
Member

rebornix commented Feb 22, 2021

Refs: #115817

Complexity: 4

Authors: @jrieken, @rebornix

Create Issue


This iteration we revamped the notebook output interface and outputs edit API, with which you can now

  • Append outputs to a cell
  • Replace outputs in a cell
  • Append output items to a cell output
  • Replace output items in a cell output

NotebookCellOutput is an object which contains multiple NotebookCellOutputItem, which is the raw output data for a specific mime type.

For example, you can create output with a single mimetype or multiple mimetypes

// renders as a text output `1`
new vscode.NotebookCellOutput([
    new vscode.NotebookCellOutputItem('application/x.notebook.stream', 1),
])

// renders as two outputs
new vscode.NotebookCellOutput([
    new vscode.NotebookCellOutputItem('application/x.notebook.stream', 1),
    new vscode.NotebookCellOutputItem('application/x.notebook.error-traceback', {
        ename: 'error2 not defined',
        evalue: 'console.error2 not defined',
        traceback: [
            'console.error2'
        ]
    }),
])

You use write commands to modify the outputs of GitHub Issue Notebook or tweak https://github.com/rebornix/vscode-notebook-testbed to play around with all kinds of different mimtypes we support internally. Please test:

  • The new interface / API is intuitive to use in overall
  • Output replacement
  • Output appending
    • Try Clear Cell Output when the extension keeps appending outputs
  • Output item replacement and appending
@rebornix rebornix added this to the February 2021 milestone Feb 22, 2021
@meganrogge meganrogge removed their assignment Feb 23, 2021
@lszomoru lszomoru removed their assignment Feb 24, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants