From c86bb6e9f0353dde3ec01eebe0162aa754aeea37 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Thu, 5 Mar 2026 15:42:56 -0700 Subject: [PATCH] Add embedding docs and LTspice engine to llms.txt --- frontend/public/llms.txt | 52 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/frontend/public/llms.txt b/frontend/public/llms.txt index 18cd6f6..9fef57d 100644 --- a/frontend/public/llms.txt +++ b/frontend/public/llms.txt @@ -1,6 +1,6 @@ # SpiceBook -> Notebook interface for SPICE circuit simulation. Create, edit, and run SPICE netlists in a cell-based notebook UI with waveform visualization and schematic generation. Powered by ngspice. +> Notebook interface for SPICE circuit simulation. Create, edit, and run SPICE netlists in a cell-based notebook UI with waveform visualization and schematic generation. Supports ngspice and LTspice engines. Base URL: `https://spicebook.warehack.ing` @@ -46,7 +46,7 @@ POST /api/notebooks } ``` -Both fields are optional. Defaults: title = `"Untitled Notebook"`, engine = `"ngspice"`. +Both fields are optional. Defaults: title = `"Untitled Notebook"`, engine = `"ngspice"`. Supported engines: `"ngspice"`, `"ltspice"`. **Response** `201` ```json @@ -419,7 +419,7 @@ For AC analysis (`is_complex: true`), `y_magnitude_db` and `y_phase_deg` contain ## SPICE Netlist Primer -SpiceBook uses **ngspice** as its simulation engine. Netlists are plain text describing a circuit and the analysis to perform. +SpiceBook supports **ngspice** and **LTspice** as simulation engines. Netlists are plain text describing a circuit and the analysis to perform. ### Basic structure @@ -555,3 +555,49 @@ GET /health ```json {"status": "ok", "version": "2026.02.13"} ``` + +--- + +## Embedding + +Any notebook can be embedded on a third-party page via iframe. No API key or authentication is required. + +### Embed URL + +``` +https://spicebook.warehack.ing/embed/{notebook_id}?theme=dark +``` + +| Parameter | Values | Default | Description | +|-----------|--------|---------|-------------| +| theme | `dark`, `light` | `dark` | Initial color theme | + +### iframe snippet + +```html + +``` + +The embed renders the notebook read-only with working simulation — viewers can run SPICE cells and see waveform results. + +### Theme control via postMessage + +The parent page can switch the embed's theme at runtime: + +```javascript +iframe.contentWindow.postMessage( + { type: 'spicebook-theme', theme: 'light' }, + '*' +); +``` + +Accepted values for `theme`: `"dark"`, `"light"`. Other messages are ignored. + +### Discovering the embed snippet + +In the notebook editor UI, the **Embed** button in the toolbar opens a popover with a ready-to-copy iframe snippet and a theme toggle.