Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhangyu1818/rehype-default-code-lang
Add a default programming language to your code tags.
https://github.com/zhangyu1818/rehype-default-code-lang
rehype rehype-plugin shiki
Last synced: 23 days ago
JSON representation
Add a default programming language to your code tags.
- Host: GitHub
- URL: https://github.com/zhangyu1818/rehype-default-code-lang
- Owner: zhangyu1818
- Created: 2024-05-06T15:03:34.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-06T15:31:20.000Z (8 months ago)
- Last Synced: 2024-08-08T22:15:05.816Z (5 months ago)
- Topics: rehype, rehype-plugin, shiki
- Language: TypeScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rehype-default-code-lang
Add a default programming language to your code tags.
> [!TIP]
> This plugin is ideal for migrating to Shiki, as `@shikijs/rehype` does not style code blocks without an explicit language. This plugin addresses that issue.## Features
- Automatically adds a default language class to `
` tags that lack a language specification.
- Facilitates the integration of syntax highlighting libraries like Shiki, especially when existing content lacks language annotations.## Installation
```bash
pnpm install rehype-default-code-lang
```## Usage
```javascript
import { rehypeDefaultCodeLang } from 'rehype-default-code-lang'
```