@limn-hl/markdown-it 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @limn-hl/markdown-it
|
|
2
|
+
|
|
3
|
+
`markdown-it` plugin for [`limn-hl`](https://github.com/ekesti/limn). Hooks `md.options.highlight` without double `<pre>` wrapping.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install limn-hl @limn-hl/markdown-it
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import markdownItLimn from "@limn-hl/markdown-it";
|
|
15
|
+
import { detectIn } from "limn-hl/detect";
|
|
16
|
+
import { all } from "limn-hl/lang";
|
|
17
|
+
import { tokyoNight } from "limn-hl/theme";
|
|
18
|
+
import MarkdownIt from "markdown-it";
|
|
19
|
+
|
|
20
|
+
const md = new MarkdownIt().use(markdownItLimn, {
|
|
21
|
+
registry: all(),
|
|
22
|
+
theme: tokyoNight,
|
|
23
|
+
detect: detectIn,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const html = md.render(markdown);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Pass a custom `new Registry([...])` instead of `all()` and omit `detect` to tree-shake unused languages and the detector. See [`docs/integrations.md`](https://github.com/ekesti/limn/blob/main/docs/integrations.md) for all options.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limn-hl/markdown-it",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "markdown-it plugin for synchronous syntax highlighting with limn",
|
|
5
5
|
"keywords": ["limn", "limn-hl", "markdown-it", "markdown-it-limn", "syntax-highlighting", "vitepress"],
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"limn-hl": "^0.
|
|
29
|
+
"limn-hl": "^0.7.0",
|
|
30
30
|
"markdown-it": ">=12.0.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|