Skip to content

Commit

Permalink
chore: update transformers readme
Browse files Browse the repository at this point in the history
  • Loading branch information
o-az committed Nov 3, 2024
1 parent 562bd7f commit ed1a189
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 71 deletions.
8 changes: 6 additions & 2 deletions examples/next/src/app/index.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<div>
[`rehype-pretty-code`](https://github.com/atomiks/rehype-pretty-code) <span className="mix-blend-plus-lighter text-zinc-400/80">is a Rehype plugin powered by the</span>
[`rehype-pretty-code`](https://rehype-pretty.pages.dev) <span className="mix-blend-plus-lighter text-zinc-400/80">is a Rehype plugin powered by the</span>
[`shiki`](https://github.com/shikijs/shiki) <span className="mix-blend-plus-lighter text-zinc-400/80">syntax highlighter that provides beautiful code blocks for Markdown or MDX. It works on both the server at build-time (avoiding runtime syntax highlighting) and on the client for dynamic highlighting.</span>
</div>

NOTE: docs are at [rehype-pretty.pages.dev](https://rehype-pretty.pages.dev)

This is the old documentation site, now being used only as Next.js example.

## Editor-Grade Highlighting

<span className="mix-blend-plus-lighter text-zinc-400/80">
Expand Down Expand Up @@ -127,7 +131,7 @@ This package is ESM-only and currently supports `shiki{:.string}`

> To use the latest version in Next.js, ensure your config file is `ESM`:
> `next.config.mjs`. Here's a full example:
> [rehype-pretty-code/website/next.config.mjs](https://github.com/atomiks/rehype-pretty-code/blob/master/website/next.config.mjs)
> [rehype-pretty-code/examples/example-next/next.config.mjs](https://github.com/rehype-pretty/rehype-pretty-code/blob/master/examples/next/next.config.mjs)
## Usage

Expand Down
4 changes: 2 additions & 2 deletions examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
},
"dependencies": {
"@rehype-pretty/transformers": "workspace:*",
"@tailwindcss/vite": "4.0.0-alpha.20",
"@tailwindcss/vite": "4.0.0-alpha.31",
"rehype-pretty-code": "workspace:*",
"rehype-slug": "^6.0.0",
"rehype-stringify": "^10.0.1",
"remark-parse": "^11.0.0",
"tailwindcss": "4.0.0-alpha.20"
"tailwindcss": "4.0.0-alpha.31"
},
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.6",
Expand Down
8 changes: 4 additions & 4 deletions packages/transformers/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
> [!NOTE]
> Currently in **development**.
> **experimental**. Please report any issues you encounter.
# `@rehype-pretty/transformers`

Expand Down Expand Up @@ -37,9 +37,9 @@ You can use this as a [`shiki` transformer](https://shiki.style/guide/transforme

- `autoApply`: `boolean` (default: `true`) - Whether to apply line numbers automatically to every code block.

#### Examples
### Examples

##### direct
#### direct

```ts
import { unified } from 'unified'
Expand Down Expand Up @@ -67,7 +67,7 @@ You can use this as a [`shiki` transformer](https://shiki.style/guide/transforme
console.log(String(file))
```

##### In React / Next.js
#### In React / Next.js

In Next.js you st it up in `next.config.js` as you'd expect with `jsx: true`

Expand Down
2 changes: 1 addition & 1 deletion packages/transformers/jsr.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://jsr.io/schema/config-file.v1.json",
"name": "@rehype-pretty/transformers",
"version": "0.13.2",
"version": "0.13.4",
"exports": "./src/index.ts",
"publish": {
"include": [
Expand Down
136 changes: 74 additions & 62 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed1a189

Please sign in to comment.