pierrecomputer/pierre

diffs

Use when an app uses @pierre/diffs to render or edit code files, diffs, patches, merge conflicts, or CodeView review surfaces, including React, vanilla JavaScript, SSR, workers, annotations, selection, and custom Shiki languages or themes.

ソースを見る
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

@pierre/diffs

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

Install

bash
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 Shiki language or themeRegister custom highlighting