https://github.com/iwstkhr/rehype-line-numbers
Plugin to add a `line-numbers` class to pre tags containing `language-*` classes
https://github.com/iwstkhr/rehype-line-numbers
Last synced: 3 months ago
JSON representation
Plugin to add a `line-numbers` class to pre tags containing `language-*` classes
- Host: GitHub
- URL: https://github.com/iwstkhr/rehype-line-numbers
- Owner: iwstkhr
- License: mit
- Created: 2024-02-25T11:50:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-03T14:50:17.000Z (7 months ago)
- Last Synced: 2024-11-03T15:29:18.844Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rehype-line-numbers
rehype plugin to add a `line-numbers` class to `pre` tags containing `language-*` classes## Installation
```sh
npm i git+https://github.com/iwstkhr/rehype-line-numbers.git
```## Options
| Name | Type | Description |
| ---- | ---- | ----------- |
| languages | string[] | Target languages |## Usage in Astro
Add `rehypeLineNumbers` to `astro.config.mjs` like the following.```js
export default defineConfig({
site: 'https:///',
integrations: [],
markdown: {
rehypePlugins: [
[rehypeLineNumbers, {
languages: ['python', 'ts'],
}],
],
},
});
```## License
MIT