mcpField
H
highlights

highlights

github.com/pierrecomputerDevelopment6.4k18 installsUpdated 1d ago
Repository

About highlights

@pierre/highlights is a syntax-highlighting skill for developers building code rendering or editing features. It offers WebAssembly-backed lexers and separate APIs for HTML, tokens, streaming, and editable documents.

Key features

  1. 01WebAssembly-based syntax lexers
  2. 02HTML and token rendering
  3. 03StreamTokenizer for append-only input
  4. 04LiveTokenizer for editable documents

Use cases

  1. 01Render highlighted code as HTML
  2. 02Feed tokens to a custom renderer
  3. 03Highlight streamed text or bytes
  4. 04Update highlighting after document edits

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pierrecomputer/pierre --skill highlights

After installing, type/highlightsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
live.md
rendering.md
streaming.md
themes.md

Details

From the project README

@pierre/highlights

Use @pierre/highlights for standalone syntax highlighting with built-in WebAssembly lexers. Choose HTML for a complete code block, tokens for a custom renderer, StreamTokenizer for append-only input, or LiveTokenizer for an editable document.

Install

pnpm add @pierre/highlights

Import from @pierre/highlights. Conditional exports initialize WebAssembly automatically for Node.js, browsers, and Cloudflare Workers. Highlighting is synchronous after import; ordinary usage needs no init() or language registration.

Select a reference

TaskReference
Generate HTML or tokens, validate a language, or manage a Wasm moduleRendering
Load or customize themes, switch CSS variables, or render multiple schemesThemes
Tokenize streamed strings or bytesStreaming
Apply edits, prioritize a viewport, or read packed token recordsIncremental editing

For file, diff, or editor components, read the diffs skill.

Comments

Markdown supported