mcpField
D
diffs

diffs

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

About diffs

@pierre/diffs is a library for rendering syntax-highlighted files and diffs, with APIs for React and vanilla JavaScript applications. Optional editor, server-rendering, and worker entries support additional rendering workflows.

Key features

  1. 01Syntax-highlighted file rendering
  2. 02Diff rendering
  3. 03React and vanilla JavaScript APIs
  4. 04Optional editor support
  5. 05Server-side rendering and workers

Use cases

  1. 01Display source files in an application
  2. 02Build code review diff views
  3. 03Edit files in React or vanilla surfaces
  4. 04Preload markup on the server

Install

Copy the command and run it in a terminal.

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

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

Bundled files

References and scripts installed along with SKILL.md.

references/
api-core.md
api-editor.md
api-highlighting.md
api-react.md
api-rendering.md
api-ssr.md
api-types.md
api-worker.md
recipe-annotations.md
recipe-code-view.md
recipe-custom-highlighting.md
recipe-edit-react.md
recipe-edit-vanilla.md
recipe-react.md
recipe-ssr.md
recipe-vanilla.md
recipe-workers.md

Details

From the project README

@pierre/diffs

Use @pierre/diffs to render syntax-highlighted files and diffs. Use its optional editor, SSR, and worker entries for those capabilities.

For standalone HTML or token generation with @pierre/highlights, read the highlights skill.

Install

pnpm add @pierre/diffs

Install react and react-dom when the app uses the React entry.

Select an API reference

SurfaceReference
Root components, parsing, and file extension APIsCore API
Languages, themes, highlighter state, and streamsHighlighting API
Renderers, managers, DOM helpers, comparisons, and constantsLow-level rendering API
Shared data, option, render, selection, and editor typesShared types
@pierre/diffs/reactReact API
@pierre/diffs/editEditor API
@pierre/diffs/ssrSSR API
@pierre/diffs/worker and worker scriptsWorker API

Select a recipe

TaskRecipe
Render a file or diff in ReactRender with React
Render a file or diff without ReactRender with vanilla JavaScript
Build a virtualized review surfaceUse CodeView
Edit a React surface or CodeViewEdit with React
Edit a vanilla surface or CodeViewEdit with vanilla JavaScript
Preload markup on the serverUse SSR
Highlight through a worker poolUse workers
Add line annotations and selectionAdd annotations and selection
Register a custom language or themeRegister custom highlighting

Comments

Markdown supported