diff --git a/biome.json b/biome.json index c4eb66c3..f98946cc 100644 --- a/biome.json +++ b/biome.json @@ -7,7 +7,7 @@ }, "files": { "ignoreUnknown": false, - "ignore": ["dist/**", "node_modules/**", "*.d.ts"] + "ignore": ["dist/**", "node_modules/**", "*.d.ts", "playground/**/*.js"] }, "formatter": { "enabled": true, diff --git a/docs/playground.md b/docs/playground.md new file mode 100644 index 00000000..2fa3fed0 --- /dev/null +++ b/docs/playground.md @@ -0,0 +1,127 @@ +# Playground Pages — Design & Requirements + +Every feature in **tsb** ships with an interactive playground page hosted on +GitHub Pages. This document describes the required properties that every +playground page must satisfy. + +## Required Properties + +### 1. Executable Code Blocks + +Each code example on a playground page **must** be executable in the browser. +Users can edit the code, click **▶ Run** (or press **Ctrl+Enter**), and see +real output rendered below the editor. + +- Use ` +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+ +

Properties

-
+    

Inspect size, shape, uniqueness, and monotonicity of an index.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Label Look-up

-
+    

Find positions of labels, check membership, and test inclusion.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Set Operations

-
+    

Combine indexes with union, intersection, difference, and symmetric difference.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Sorting & Aggregation

-
+    

Sort labels and compute aggregates like min, max, and argsort.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Manipulation (immutable — always returns new Index)

-
+    

Append, insert, delete, drop, and rename — each returns a new Index.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

Missing Values

-
+    

Detect, drop, and fill null values in an index.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+

RangeIndex — Memory Efficient

-
+    

Stores only start/stop/step — values are computed on the fly.

+
+
+ TypeScript +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+ + +
+

🧪 Try It Yourself

+

Write your own tsb code below. All exports from tsb are available: + Index, RangeIndex, Series, Dtype, and more.

+
+
+ TypeScript — Scratch Pad +
+ + +
+
+ +
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
-