Spaces:
Running
Running
Update component/notebook_view.py
Browse files
component/notebook_view.py
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
# Notebook view component
|
2 |
# File: components/notebook_view.py
|
3 |
import streamlit as st
|
4 |
|
5 |
|
6 |
def render_notebook(cells):
|
7 |
"""
|
8 |
-
Render
|
9 |
-
Args:
|
10 |
-
cells (List[str]): Each string is a code cell to display.
|
11 |
"""
|
12 |
st.header("π Reproducible Notebook")
|
13 |
if not cells:
|
14 |
-
st.info("No notebook cells available
|
15 |
return
|
16 |
for idx, cell in enumerate(cells, 1):
|
17 |
st.subheader(f"Cell {idx}")
|
18 |
-
st.code(cell, language='python')
|
|
|
|
|
|
|
|
|
|
1 |
# File: components/notebook_view.py
|
2 |
import streamlit as st
|
3 |
|
4 |
|
5 |
def render_notebook(cells):
|
6 |
"""
|
7 |
+
Render reproducible code cells with run buttons.
|
|
|
|
|
8 |
"""
|
9 |
st.header("π Reproducible Notebook")
|
10 |
if not cells:
|
11 |
+
st.info("No notebook cells available.")
|
12 |
return
|
13 |
for idx, cell in enumerate(cells, 1):
|
14 |
st.subheader(f"Cell {idx}")
|
15 |
+
st.code(cell, language='python')
|
16 |
+
if st.button(f"Run Cell {idx}", key=f"run_{idx}"):
|
17 |
+
# Placeholder: In practice this would execute via MCP
|
18 |
+
st.success(f"Executed cell {idx}")
|