open-index/open-npm huggingface dataset:
npm package: @markdownkit/oxlint-mdx
Description: Oxlint-first MD/MDX linter with diagnostic and autofix remapping
Latest version: 2.1.1

# oxlint-mdx

Oxlint-first linting for Markdown and MDX documents.

Current implementation includes:

- fenced code block extraction
- MDX expression / ESM extraction
- diagnostic remapping back to source `.md` / `.mdx`
- fix remapping and write-back to source files
- optional remark bridge diagnostics

## Install from npm

### CLI usage (remote)

- `pnpm dlx @markdownkit/oxlint-mdx "docs/**/*.mdx"`
- `pnpm dlx @markdownkit/oxlint-mdx --fix "docs/**/*.mdx"`

### Project dependency

- `pnpm add -D @markdownkit/oxlint-mdx`

Then run:

- `oxlint-mdx "docs/**/*.mdx"`

## Programmatic usage

The package exports core APIs for embedding in custom workflows:

- `extractVirtualUnits`
- `runOxlintOnUnits`
- `runRemarkBridge`
- remapping helpers from `mapping/*`

Example import:

- `import { extractVirtualUnits, runOxlintOnUnits } from '@markdownkit/oxlint-mdx'`

## Passing Oxlint options through

Forward extra Oxlint options directly:

- `oxlint-mdx docs/**/*.mdx -- --deny no-var --react-plugin`

You can also pass unknown flags directly (without `--`) and they will be forwarded.
For direct flags with values, use `--flag=value` form (for example: `--deny=no-var`).

## Usage

Run in development:

- `pnpm dev -- "docs/**/*.mdx"`

Build and run:

- `pnpm build`
- `node dist/cli.js "docs/**/*.mdx"`

Fix mode:

- `node dist/cli.js --fix "docs/**/*.mdx"`

## Publishing

Publish checks and build run automatically via `prepublishOnly`.

Typical release flow:

1. Bump version in `package.json`
2. `pnpm run test`
3. `pnpm publish --access public`

## Upstream parity assets

Parity scripts/tests use upstream `eslint-mdx` fixture snapshots.

Lookup order:

1. `ESLINT_MDX_REPO_ROOT`
2. sibling checkout at `../eslint-mdx`
3. installed `eslint-mdx` package root (only if it includes test assets)

If assets are unavailable, parity scripts emit a `skipped` JSON payload and upstream parity tests are skipped.
npm package: @markdy/astro
Description: Astro island component for MarkdyScript animations.
Author: Hoang Yell
Latest version: 0.3.0

# @markdy/astro

[Astro](https://astro.build/) island component for [MarkdyScript](../../docs/SYNTAX.md) animated scenes.

## Features

- **SSR placeholder** — correctly-sized `<div>` prevents layout shift before hydration
- **Viewport-triggered hydration** — `IntersectionObserver` with 100px root margin
- **View Transition compatible** — re-observes elements on `astro:page-load`
- **Zero config** — pass your MarkdyScript code as a prop

## Installation

```sh
pnpm add @markdy/astro
```

## Usage

```astro
---
import { Markdy } from "@markdy/astro";

const code = `
  scene width=800 height=400 bg=#fff5f9
  actor hero = figure(#c68642, m, 😎) at (400, 200)
  @0.0: hero.enter(from=left, dur=0.8)
  @1.5: hero.say("Hello!", dur=1.2)
`;
---

<Markdy code={code} width={800} height={400} bg="#fff5f9" autoplay />
```

### In MDX

```mdx
import { Markdy } from "@markdy/astro";

export const code = `
  scene width=600 height=300 bg=white
  actor label = text("Hello") at (200, 130) size 40 opacity 0
  @0.3: label.fade_in(dur=0.6)
`;

<Markdy code={code} width={600} height={300} autoplay />
```

## Props

| Prop | Type | Default | Description |
|---|---|---|---|
| `code` | `string` | *(required)* | MarkdyScript source code |
| `width` | `number` | `800` | Placeholder width in pixels |
| `height` | `number` | `400` | Placeholder height in pixels |
| `bg` | `string` | `"white"` | Placeholder background colour |
| `assets` | `Record<string, string>` | `{}` | Asset URL overrides |
| `autoplay` | `boolean` | `true` | Start playing on hydration |
| `class` | `string` | — | CSS class for the outer wrapper |

> **Tip:** Match `width`, `height`, and `bg` props to your `scene` declaration values to avoid a visual flash on hydration.

## How It Works

1. **Server:** renders a sized placeholder `<div>` with a `▶ markdy` label
2. **Client:** an `IntersectionObserver` watches all `.markdy-root` elements
3. **On viewport entry:** the observer fires, clears the placeholder, and calls `createPlayer()` from `@markdy/renderer-dom`
4. **View Transitions:** listens for `astro:page-load` to re-observe newly added elements

## Documentation

- **[Tutorial](../../docs/TUTORIAL.md)** — step-by-step guide from zero to animated scenes
- **[Syntax Reference](../../docs/SYNTAX.md)** — complete DSL language spec

## License

[MIT](../../LICENSE)
npm package: @markdy/core
Description: MarkdyScript parser and AST types — zero runtime dependencies.
Author: Hoang Yell
Latest version: 0.3.0

# @markdy/core

The parser and AST types for [MarkdyScript](../../docs/SYNTAX.md) — a DSL for describing 2D animated scenes.

## Features

- **Zero runtime dependencies** — pure TypeScript, no DOM or platform APIs
- **Single-pass parser** — line-by-line state machine with strict `ParseError` diagnostics
- **Rich type system** — `var`, `def`, `seq` expanded at parse time for composable scene authoring
- **Isomorphic** — runs in Node.js, Deno, Bun, edge runtimes, and the browser

## Installation

```sh
pnpm add @markdy/core
```

## Usage

```typescript
import { parse, ParseError } from "@markdy/core";
import type { SceneAST } from "@markdy/core";

const source = `
  scene width=600 height=300 bg=white
  actor label = text("Hello") at (50, 130) size 40 opacity 0
  @0.3: label.fade_in(dur=0.6)
`;

try {
  const ast: SceneAST = parse(source);

  console.log(ast.meta);     // { width: 600, height: 300, fps: 30, bg: "white", duration: 0.9 }
  console.log(ast.actors);   // { label: { type: "text", args: ["Hello"], x: 50, y: 130, ... } }
  console.log(ast.events);   // [{ time: 0.3, actor: "label", action: "fade_in", ... }]
} catch (e) {
  if (e instanceof ParseError) {
    console.error(`Line ${e.line}: ${e.message}`);
  }
}
```

## Exports

| Export | Type | Description |
|---|---|---|
| `parse` | `(source: string) => SceneAST` | Parse MarkdyScript source into an AST |
| `ParseError` | class | Error with `.line` number for diagnostics |
| `SceneAST` | type | Complete scene representation |
| `SceneMeta` | type | Scene configuration (width, height, bg, etc.) |
| `AssetDef` | type | Asset declaration (image or icon) |
| `ActorDef` | type | Actor declaration (type, position, modifiers) |
| `TimelineEvent` | type | Timeline event (time, actor, action, params) |
| `TemplateDef` | type | User-defined actor template |
| `SequenceDef` | type | User-defined animation sequence |

## Documentation

- **[Syntax Reference](../../docs/SYNTAX.md)** — complete DSL language spec
- **[Tutorial](../../docs/TUTORIAL.md)** — step-by-step guide
- **[Agent Guide](../../docs/AGENT.md)** — structured reference for AI/LLM code generation
- **[Architecture](../../docs/ARCHITECTURE.md)** — parser internals and design decisions

## License

[MIT](../../LICENSE)
npm package: @markdy/renderer-dom
Description: Web Animations API renderer for MarkdyScript scenes.
Author: Hoang Yell
Latest version: 0.3.0

# @markdy/renderer-dom

Web Animations API renderer for [MarkdyScript](../../docs/SYNTAX.md) scenes. Translates a parsed AST into DOM elements and drives the animation timeline.

## Features

- **Browser-native** — Web Animations API + CSS transforms, no Canvas or GSAP
- **Emoji stick figures** — `figure` actor type with articulatable limbs (punch, kick, rotate_part)
- **Seek-safe** — manual `currentTime` control enables reliable `seek()` in any direction
- **Face expressions** — instant emoji face swaps that work correctly on seek-back
- **Speech bubbles** — auto-positioned bubbles with fade-in/fade-out
- **Single dependency** — only `@markdy/core`

## Installation

```sh
pnpm add @markdy/core @markdy/renderer-dom
```

## Usage

```typescript
import { createPlayer } from "@markdy/renderer-dom";

const player = createPlayer({
  container: document.getElementById("scene")!,
  code: `
    scene width=600 height=300 bg=white
    actor hero = figure(#c68642, m, 😎) at (200, 150)
    @0.0: hero.enter(from=left, dur=0.8)
    @1.5: hero.say("Hello!", dur=1.2)
    @1.5: hero.face("😄")
  `,
  autoplay: true,
});

// Playback control
player.pause();
player.seek(1.5);   // jump to 1.5 seconds
player.play();
player.destroy();    // clean up DOM + cancel animations
```

## API

### `createPlayer(options: PlayerOptions): Player`

| Option | Type | Default | Description |
|---|---|---|---|
| `container` | `HTMLElement` | *(required)* | DOM element to mount the scene into |
| `code` | `string` | *(required)* | MarkdyScript source code |
| `assets` | `Record<string, string>` | `{}` | Asset URL overrides (key = asset name) |
| `autoplay` | `boolean` | `false` | Start playing immediately |

### `Player`

| Method | Description |
|---|---|
| `play()` | Start or resume playback |
| `pause()` | Pause at current position |
| `seek(seconds)` | Jump to a specific time |
| `destroy()` | Remove DOM elements and cancel all animations |

## Module Structure

```
src/
  types.ts        — ActorState, FaceSwap, easing utilities
  figure.ts       — Stick-figure DOM factory (emoji body parts)
  actors.ts       — Actor element factory (sprite, text, figure, box)
  animations.ts   — Timeline → WAAPI Animation builder
  player.ts       — Public API, rAF loop, face-swap engine
  index.ts        — Barrel exports
```

## Documentation

- **[Syntax Reference](../../docs/SYNTAX.md)** — complete DSL language spec
- **[Architecture](../../docs/ARCHITECTURE.md)** — renderer internals and playback design

## License

[MIT](../../LICENSE)
npm package: @markedjs/testutils
Description: Test utilities for marked and marked extensions
Latest version: 18.0.0-1

# @markedjs/testutils

Test utilities for marked and marked extensions.

## Versioning

This is versioned as the version of marked that it includes tests for with the prerelease version being an integer that gets incremented when we release a new fix or feature without updating the marked version.

We recommend to pin to a single version instead of using a range since any update may contain breaking changes.

**Example**

```json
// package.json
"dependencies": {
  "@markedjs/testutils": "9.1.0-0"
}
```

## API

### `getAllMarkedSpecTests()`

Get all marked [Tests](#tests)

### `getTests(dirs)`

Get [Tests](#tests) from a directory or file.
`dirs` can be a string or an array of strings.
The return type is the same as the input a Tests object or an array of Tests objects.

### `htmlIsEqual(actual, expected)`

Check if html will display the same.

### `firstDiff(actual, expected, padding)`

Get the first difference between actual and expected HTML. Returns an object with the characters around the index of the first difference in the expected and actual strings.

### `outputCompletionTable(title, tests)`

Display a table in stdout that lists the sections and what percentage of the tests are not marked shouldFail.

### `runTests({tests, defaultMarkedOptions, parse, addExtension, isEqual, diff})`

Run spec tests

### `runAllMarkedSpecTests({addExtension, outputCompletionTables})`

Run all marked specs with an added extension and optionally output completion table.

## Arguments

### tests

```ts
interface Tests {
  total: number;
  pass: number;
  specs: Spec[];
}

interface Spec {
  section?: string;
  markdown: string;
  html: string;
  example?: number;
  options?: MarkedOptions;
  only?: boolean;
  skip?: boolean;
  shouldFail?: boolean;
}
```

### defaultMarkedOptions

```ts
type defaultMarkedOptions = MarkedOptions;
```

### parse

```ts
function parse(
  markdown: string,
  options: MarkedOptions,
  addExtension: addExtension,
): string;
```

### addExtension

```ts
function addExtension(marked: Marked): void;
```

### isEqual

```ts
function isEqual(actual: string, expected: string): boolean;
```

### diff

```ts
function diff(
  actual: string,
  expected: string,
  padding: number,
): { expected: string; actual: string };
```