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

mo.stop should not render markdown cells in App Mode #3586

Open
mimansajaiswal opened this issue Jan 27, 2025 · 1 comment
Open

mo.stop should not render markdown cells in App Mode #3586

mimansajaiswal opened this issue Jan 27, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@mimansajaiswal
Copy link

Description

I am trying to create an app that takes in a file, performs some statistical analysis on it, and produces output. I want to stop the execution if no file has been selected using file browser, and so I'm using mo.stop for it, which does stop notebook execution, but still renders the markdown cells.

As a result, the app looks weird with just a warning message of future markdown cells. The other option is to use a python cell that runs mo.md instead of having a markdown cell. This prevents rendering in app mode but also prevents rendering in edit mode, making it difficult to navigate different code sections to identify errors or check the code without selecting a file. I think the behavior for markdown rendering after mo.stop should be different in edit versus app mode.

Suggested solution

Change behavior of mo.stop in App Mode vs Edit Mode.

Alternative

No response

Additional context

No response

@mscolnick
Copy link
Contributor

I can see the desire for this, but it makes, especially since there isn't an explicit dependency between pure markdown cells, but their is an implicit dependency as the reader (they are headings to the content below).

I don't think we have anything in the near-term planned that will help this. the best thing you can do is to put the dependencies in the markdown block (which does lose syntax highlighting for you, unfortunately).

# Cell 1
selection_dropdown = mo.ui.dropdown(["a", "b"])

# Cell 2
mo.stop(not selection_dropdown.value)
selection = selection_dropdown.value
selection

# Cell 3
selection # this forces a dependency and will also be stopped
mo.md("Next steps:")

# Cell 4
selection
mo.md("more markdown")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants