mgbam commited on
Commit
75e32f7
Β·
verified Β·
1 Parent(s): 7ed05a1

Update component/notebook_view.py

Browse files
Files changed (1) hide show
  1. component/notebook_view.py +6 -6
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 a sequence of code cells as a live notebook view.
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 for this paper.")
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}")