Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/noclaps/highlight

A syntax highlighting library that uses Tree-sitter
https://github.com/noclaps/highlight

rust syntax-highlighting tree-sitter typescript

Last synced: about 11 hours ago
JSON representation

A syntax highlighting library that uses Tree-sitter

Awesome Lists containing this project

README

        

# Highlight

A syntax highlighting library that uses [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) for incredibly quick parsing and highlighting.

## Usage

Install the package as a dependency to your project:

```sh
bun add @noclaps/highlight
```

and then import it into your code:

```ts
import { highlight, type Theme } from "@noclaps/highlight";

const theme: Theme = {
... // Your theme here
}

const myCode = `
console.log("Hello World");
`

const htmlOutput = highlight(code, "ts", theme);
//

...
HTML output
```