0.1.1 • Published 2 years ago

replite v0.1.1

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
2 years ago

replite

An embeddable REPL, powered by JupyterLite.

replite-numpy

Usage

To embed the code console in your website:

<iframe src="https://replite.vercel.app/retro/consoles/index.html" width="100%" height="100%">
</iframe>

Configuration

The behavior and the look of the REPL can be configured via URL parameters.

Select a kernel by default

To avoid the kernel selection dialog and choose a given kernel by default:

<iframe src="https://replite.vercel.app/retro/consoles?kernel=python" width="100%" height="100%">
</iframe>

Enable the toolbar

The toolbar can be enabled (opt-in) to add a couple of useful buttons:

<iframe src="https://replite.vercel.app/retro/consoles?toolbar=1" width="100%" height="100%">
</iframe>

toolbar

Auto execute code on startup

Custom starter code can automatically be executed on startup:

<iframe src="https://replite.vercel.app/retro/consoles?kernel=python&code=import numpy as np" width="100%" height="100%">
</iframe>

https://user-images.githubusercontent.com/591645/152204519-7980e9f6-ef56-4263-bb79-4fcf3e4fd2be.mp4

Create your custom deployment

TBD

Development

# create a new environment
mamba create -n replite -c conda-forge jupyterlab=3 jupyter-packaging python nodejs -y
conda activate replite

# Install JupyterLite
python -m pip install jupyterlite

# Install package in development mode
python -m pip install -e .

# Link your development version of the extension
jupyter labextension develop . --overwrite

# Rebuild extension TypeScript source after making changes
jlpm run build