Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

436 B
Raw Blame
/* Copyright 2026 Marimo. All rights reserved. */
import { compressToEncodedURIComponent } from "lz-string";

export function createShareableLink(opts: {
  code: string | null;
  baseUrl?: string;
}): string {
  const { code, baseUrl = "https://marimo.app" } = opts;
  const url = new URL(baseUrl);
  if (code) {
    const compressed = compressToEncodedURIComponent(code);
    url.hash = `#code/${compressed}`;
  }
  return url.href;
}