# @nandithebull/myst-oxa

MyST Markdown <-> OXA document parse/render pipeline.

## Install

```bash
npm install @nandithebull/myst-oxa
```

## API

```ts
import { parse, render, toOxa, fromOxa } from "@nandithebull/myst-oxa";
```

### `parse(mystText: string): MdastTree`

Parse MyST markdown to an mdast tree.

### `render(title: string, mystText: string): string`

Render MyST markdown to HTML. Includes dropdown admonition handling and executable code cell wrapping (for Jupyter integration).

### `toOxa(title: string, mystText: string): Promise<OxaRecord>`

Convert MyST markdown to an OXA document record (async). Validates the output against the OXA lexicon schema via `@panproto/core`.

### `fromOxa(record: OxaRecord): string`

Convert an OXA document record back to MyST markdown.

## Types

All document types are exported:

```ts
import type { OxaDocument, OxaBlock, OxaInline, MystDocument, MystBlock, MystInline } from "@nandithebull/myst-oxa";
```

## Lower-level API

The lens API and schema objects are also exported for advanced use:

```ts
import { panproto, lens, mystDocumentSchema, oxaDocumentSchema } from "@nandithebull/myst-oxa";
```

## License

MIT
