Mantis Notebooks is a Visual Studio Code extension that integrates with Mantis notebook sessions, allowing users to interact with notebooks directly within VS Code. It supports Python, Markdown, and UI/TSX cells, providing a seamless experience for data analysis and development.
Features
Load notebooks from active Mantis sessions.
Execute Python and UI/TSX cells.
Insert new UI/TSX cells into notebooks.
Restart the kernel and interrupt cell execution.
Synchronize notebook changes with the Mantis backend.
Installation
Clone this repository:
git clone <repository-url>
cd MantisVSCExtension/mantis-notebooks
Install dependencies using Yarn:
yarn install
Compile the extension:
yarn run compile
Open the project in Visual Studio Code and press F5 to launch the extension in a new Extension Development Host window.
Usage
Loading a Notebook from a Session
Use the Mantis UI to generate a session link.
Open the link in your browser, which will trigger the mantisai.loadFromSession command in VS Code.
The notebook will be loaded into VS Code, and the kernel will be connected.
Adding a UI/TSX Cell
Open a Mantis notebook in VS Code.
Use the command palette (Ctrl+Shift+P or Cmd+Shift+P on macOS) and run Mantis: Add UI/TSX Cell.
A new UI/TSX cell will be inserted into the notebook.
Restarting the Kernel
Use the command palette and run Mantis: Restart Kernel.
The kernel will restart, and the notebook UI will be temporarily locked.
Interrupting Cell Execution
Use the command palette and run Mantis: Interrupt Cell.
The currently executing cell will be interrupted.
Configuration
Set the backend URL for the Mantis API in your VS Code settings: