Loading...
Loading...
Create, edit, and build Observable Notebooks using Notebook Kit. Use when working with .html notebook files, generating static sites from notebooks, querying databases from notebooks, or using data loaders (Node.js/Python/R) in notebooks. Covers notebook file format, cell types, CLI commands, database connectors, and JavaScript API.
npx skill4agent add kindy/skills observable-notebook-kit.html<!doctype html>
<notebook theme="air">
<title>My Notebook</title>
<script type="text/markdown">
# Hello
</script>
<script type="module" pinned>
1 + 2
</script>
</notebook><notebook>themeaircoffeecottondeep-spaceglacierinkmidnightnear-midnightocean-floorparchmentslatestarksun-fadedreadonly<script>typepinnedhiddenoutputdatabaseformatidtype| Type | Language |
|---|---|
| JavaScript |
| TypeScript |
| Markdown |
| HTML |
| SQL |
| TeX/LaTeX |
| DOT (Graphviz) |
| Node.js data loader |
| Python data loader |
| R data loader |
<script></script><\/script>npm add @observablehq/notebook-kitnotebooks preview --root docs
notebooks preview --root docs --template docs/custom.tmplnotebooks build --root docs -- docs/*.html.observable/distnotebooks download https://observablehq.com/@d3/bar-chart > bar-chart.htmlnotebooks query --database duckdb 'SELECT 1 + 2'1 + 2const foo = 1 + 2;
display(foo);display(value)view(input)FileAttachment("path")invalidationvisibilitywidthnowInputsPlotd3htlhtmlsvgtexmdimport lib from "npm:package-name";
import {fn} from "jsr:@scope/package";const x = view(Inputs.range([0, 100]));x ** 2 // re-runs when x changes${...}The answer is ${x * 2}.databaseduckdb<script type="application/sql" database="duckdb" output="results">
SELECT * FROM 'data.parquet'
</script>@duckdb/node-apipostgressnowflake-sdk@google-cloud/bigquery@databricks/sqlnpm add @duckdb/node-api.observable/cacheconst db = DatabaseClient("duckdb");
const data = await db.sql`SELECT * FROM t WHERE x = ${value}`;.observable/cachetextjsoncsvtsvxmlarrowparquetblobbufferpngjpeggifwebpsvghtml<script type="application/vnd.node.javascript" format="json" output="data">
process.stdout.write(JSON.stringify({hello: "world"}));
</script><script type="text/x-python" format="text" output="result">
print("hello", end="")
</script>.venv<script type="text/x-r" format="json" output="data">
cat(jsonlite::toJSON(list(x = 1:3)))
</script><!doctype html>
<html>
<head>
<style>@import url("observable:styles/index.css");</style>
</head>
<body>
<main></main> <!-- notebook renders here -->
</body>
</html>--template path.tmplpackage.json{
"dependencies": {
"@observablehq/notebook-kit": "^"
},
"scripts": {
"docs:preview": "notebooks preview --root docs",
"docs:build": "notebooks build --root docs -- docs/*.html"
}
}.observable/databases.json.observable/cache/.observable/dist/.gitignore.observable