# rehype-pretty/rehype-pretty-code

Beautiful code blocks for Markdown or MDX.

Repository: https://github.com/rehype-pretty/rehype-pretty-code
Canonical: https://ross.abutalabs.com/products/rehype-pretty-code
Homepage: https://rehype-pretty.pages.dev
Language: TypeScript
License: MIT
License Family: permissive
Topics: syntax-highlighting, mdx, shiki, vscode, markdown
Last push: 2026-07-25T23:12:31+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 94, release rhythm 71, longevity 100
- inputs: {"age_days": 1730, "days_push": 39, "days_rel": 39, "gap_med": 124, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1317, forks 72 (observed 2026-08-28T04:04:21.066641+00:00)

## What it is
A Rehype plugin powered by the Shiki syntax highlighter that renders beautiful, editor-grade code blocks in Markdown or MDX. It supports VS Code themes, line and word highlighting, inline code highlighting, and ANSI output, working at build time or in the browser.

## Use cases
- highlight code blocks in markdown docs
- add syntax highlighting to MDX blog posts
- use VS Code themes for code snippets in a static site
- highlight specific lines or words in code examples
- render ANSI terminal output in documentation
- avoid runtime syntax highlighting by highlighting at build time

## When to choose
- you build docs or blogs with Markdown/MDX in SvelteKit, Astro, Next.js, or similar
- you want VS Code-accurate highlighting with any VS Code theme
- you need line/word/inline code highlighting features

## When to avoid
- your content is not Markdown/MDX or not processed through the unified/Rehype pipeline
- you need highlighting in a non-JavaScript stack without Node.js
- you want a standalone highlighter library rather than a Rehype plugin

## Facets
- artifact type: plugin
- maturity: active
- function: markdown, templating, documentation
- domain: web-development, frontend, documentation, developer-tools
- platform: browser
- tags: rehype-plugin, shiki, mdx, unified-ecosystem, code-blocks, vscode-themes, syntax-highlighting, nodejs, web-server

## Member repositories
- rehype-pretty/rehype-pretty-code (main) score 87

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:21.066641+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:48:14.096506+00:00, confidence not recorded.
  - readme: https://github.com/rehype-pretty/rehype-pretty-code (fetched 2026-08-28T04:04:21.066641+00:00, sha b0f75f65991e)
  - homepage: https://rehype-pretty.pages.dev (fetched 2026-08-29T12:06:59.224358+00:00, sha d0eb85e145fb)
  - registry_npm: https://registry.npmjs.org/rehype-pretty-code (fetched 2026-08-29T12:06:59.234482+00:00, sha e05e3e18f657)
- Data as of 2026-08-30T08:39:29.467469+00:00.
