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

🤖 Store execution outputs in Outputs #1903

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

agoose77
Copy link
Contributor

@agoose77 agoose77 commented Mar 7, 2025

This PR changes our internal representation of cell outputs so that they are children of the Outputs node.

It accompanies #1900.

Tasks

  • Handle upgrading xrefs with format <3 into v3.

Copy link

changeset-bot bot commented Mar 7, 2025

🦋 Changeset detected

Latest commit: a4d6245

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
mystmd Minor
myst-directives Patch
myst-transforms Patch
myst-spec-ext Patch
myst-execute Patch
myst-cli Minor
myst-common Patch
myst-config Patch
myst-frontmatter Patch
myst-parser Patch
myst-roles Patch
myst-to-html Patch
myst-migrate Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@agoose77 agoose77 force-pushed the agoose77/feat-future-ast-outputs branch 2 times, most recently from b9aafa1 to cec055e Compare March 7, 2025 11:04
@agoose77 agoose77 force-pushed the agoose77/feat-future-ast-outputs branch from cec055e to 6870f57 Compare March 7, 2025 11:05
Copy link
Member

@rowanc1 rowanc1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments as I am looking now.

@rowanc1
Copy link
Member

rowanc1 commented Mar 7, 2025

Thoughts on a testing plan for this:

  • thebe can attach to the right place, there are likely going to be changes in the theme due to this
  • contents are still minified and downloaded correctly (e.g. images are a network request, etc.)
  • docx, typst, latex, JATS still export matplotlib images and latex
  • mystmd docs work for the embed and interactive components
  • bokeh example, holoviews, plotly, sympy

@@ -136,8 +138,10 @@ describe('Test blockMetadataTransform', () => {
data: { key: 'value' },
},
[
u('output', { identifier: 'my_label-output-0' }, 'We know what we are'),
u('output', { identifier: 'my_label-output-1' }, 'but know not what we may be.'),
u('outputs', { identifier: 'my_label-output' }, [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to have this plural?

Suggested change
u('outputs', { identifier: 'my_label-output' }, [
u('outputs', { identifier: 'my_label-outputs' }, [

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha you anticipated my question regarding https://github.com/jupyter-book/mystmd/pull/1903/files#r1985269343

I used the same ID as before so that the outputoutputs change is reflected in the referencing of existing Markdown files. However, I'd prefer it to read outputs. Thoughts?

const outputsNode = select('outputs', block) as GenericNode | undefined;
if (outputsNode !== undefined && !outputsNode.identifier) {
// Label outputs node
outputsNode.identifier = `${block.identifier}-output`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that these ID changes may need to be taken into account in the upgrade/downgrade script for thebe to continue working.

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