open-index/open-npm huggingface dataset:
npm package: @j6k4m8/catl-parser
Description: Parser for CATL (Chord and Tab Language)
Latest version: 0.1.2

# @j6k4m8/catl-parser

![NPM Version](https://img.shields.io/npm/v/%40j6k4m8%2Fcatl-parser?style=for-the-badge) [![CATL Version](https://img.shields.io/badge/CATL-v0.1-blue?style=for-the-badge)](https://github.com/j6k4m8/catl)

> **Latest supported CATL version:** [v0.1](https://github.com/j6k4m8/catl)

A small TypeScript parser for [**CATL** (Chord and Tab Language)](https://github.com/j6k4m8/catl/): a compact text format for guitar chords and tab events.

This package provides:

-   a lexer + parser
-   an AST
-   diagnostics with spans (line/col)

## Install

```bash
npm i @j6k4m8/catl-parser
```

## Usage

```ts
import { parseCATL } from "@j6k4m8/catl-parser";

const src = `
# chords
"Gmin7":3x332x:"Nice chord!" | X554X5
|: X554X5 | X554X5 :|

# events
{eBGDAE}
0A:"When" 0D 5e:"you" 7B 3e+0D:"fall in love"
0@5 0@4 5@1 7@2 3@1+0@4
`;

const ast = parseCATL(src);

console.log(ast.diagnostics);
console.log(ast.lines);
```
npm package: @j6k4m8/catl-render
Description: Renderer for CATL (Chord and Tab Language): raw SVG for chords and event tab.
Latest version: 0.1.0

# @j6k4m8/catl-render

![NPM Version](https://img.shields.io/npm/v/%40j6k4m8%2Fcatl-render?style=for-the-badge) [![CATL Version](https://img.shields.io/badge/CATL-v0.1-blue?style=for-the-badge)](https://github.com/j6k4m8/catl)

Raw-SVG renderer for [CATL](https://github.com/j6k4m8/catl) (Chord and Tab Language). Uses [@j6k4m8/catl-parser](https://github.com/j6k4m8/catl-parser) for parsing and renders:

-   chord diagrams from chord voicings (`X554X5`, `"Gmin7":3x332x`)
-   event-mode “tab grid” from `{eBGDAE} ...` events
-   bars (`|`) and repeats (`|:` `:|`)

## Install

```bash
npm i @j6k4m8/catl-render
```

## Usage

```ts
import { renderCATL, renderCATLToSVGBlocks } from "@j6k4m8/catl-render";

const src = `
" Gmin7":3x332x:"Nice chord!"
{eBGDAE}
0A:"When" 0D 5e:"you" 7B 3e+0D:"fall in love"
`;

const { blocks, diagnostics } = renderCATLToSVGBlocks(src);
console.log(diagnostics);

// Or get a single HTML snippet:
const html = renderCATL(src);
```

## Defaults

-   Event renderer defaults to **fret numbers inside** circles.
-   Prefix annotations render **above**; suffix annotations render **below**.

Configure via `RenderOptions`.

## License

Apache-2.0