-
Notifications
You must be signed in to change notification settings - Fork 64
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
Control code cell visibility and behavior with tags and metadata #1108
Comments
This was partially implemented here: But I believe is undocumented on our side. I think at this stage, only the https://github.com/executablebooks/mystmd/blob/main/packages/myst-common/src/types.ts#L34 There was an initial PR on this in the theme over here:
We got the first part merged, but not the theme as there were changes to thebe that we needed to consider. |
Ah nice - I've added a PR to document some of this here: Agreed that there's still functionality that needs to be added, so we can use this to flesh out the behavior. I've added your links to the top comment so that it's easier to track the progress |
Sorry to bother you, but it seems Edit: adding to this. I see your documentation on notebook cell visibility. I see no indication that this works. Or maybe I'm using it wrong. Could you please advise? |
I am running into a similar issue ( |
@drewlio this should have been fixed in 1.3.3. Would you be able to check that for me? :) |
@agahkarakuzu could you possibly provide a reproducer? |
@agoose77 I'll soon test this, sorry for the late reply! |
@agoose77 versions are the following:
1. Hide input issue still persists.For example, the first code block of this notebook from this myst article has the 2. Interactive figure outputs are generated, but not embeddedThis 3D interactive plot was generated during 3. Default article-theme dark?I used to build articles with light-theme, but now by default it is dark, how can I set this back to light? |
Currently, all code cells that are parsed by MyST will include their input and outputs together.
Outputs can be inserted into the page via the
{embed}
directive, which allows you to remove the input, output, or include both.However it's not possible to modify the behavior of the code cell itself, which makes it clunky if you want the code cell to exist on the same page where you want to embed its output.
It would be helpful if there were a way to control the visibility of the cell input and cell output from within a code cell.
How MyST-NB handles this
MyST NB accomplishes this by using Cell Metadata tags, with tags like the following:
remove-cell
remove-input
remove-output
hide-input
(hides behind a toggle)hide-output
skip-execution
raises-exception
(to prevent errors from stopping the build process)References
There was an initial PR on this in the theme over here:
The text was updated successfully, but these errors were encountered: