Commit 749cb00f7c

749cb00f7c58f406c18ac9ed9853cf910f06bf37

parent: 7759b99843

Unregistered key

taskylizard <75871323+taskylizard@users.noreply.github.com> · 2025-08-19 13:59 UTC

feat: attrs plugin

Layout: unified · split

docs/.vitepress/configs/markdown/index.ts +2
@@ -10,6 +10,7 @@ import { imgSize } from '@mdit/plugin-img-size'
10import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' 10import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
11import { emojiRender } from './emoji' 11import { emojiRender } from './emoji'
12import { getTooltip } from '../../utils/tooltips' 12import { getTooltip } from '../../utils/tooltips'
13import { attrs } from '@mdit/plugin-attrs'
13 14
14export function configureMarkdown(md: MarkdownRenderer) { 15export function configureMarkdown(md: MarkdownRenderer) {
15 md.use(emojiRender) 16 md.use(emojiRender)
@@ -26,6 +27,7 @@ export function configureMarkdown(md: MarkdownRenderer) {
26 multibody: true, 27 multibody: true,
27 aotolabel: true 28 aotolabel: true
28 }) 29 })
30 md.use(attrs)
29 renderTooltip(md) 31 renderTooltip(md)
30 renderInlineTooltip(md) 32 renderInlineTooltip(md)
31} 33}
package.json +2
@@ -20,6 +20,7 @@
20 "dependencies": { 20 "dependencies": {
21 "@fmhy/components": "^0.0.3", 21 "@fmhy/components": "^0.0.3",
22 "@mdit/plugin-align": "^0.13.1", 22 "@mdit/plugin-align": "^0.13.1",
23 "@mdit/plugin-attrs": "^0.23.1",
23 "@mdit/plugin-figure": "^0.13.1", 24 "@mdit/plugin-figure": "^0.13.1",
24 "@mdit/plugin-img-lazyload": "^0.13.1", 25 "@mdit/plugin-img-lazyload": "^0.13.1",
25 "@mdit/plugin-img-size": "^0.13.1", 26 "@mdit/plugin-img-size": "^0.13.1",
@@ -37,6 +38,7 @@
37 "medium-zoom": "^1.1.0", 38 "medium-zoom": "^1.1.0",
38 "nitro-cors": "^0.7.1", 39 "nitro-cors": "^0.7.1",
39 "nitropack": "^2.10.4", 40 "nitropack": "^2.10.4",
41 "pathe": "^2.0.3",
40 "tinyexec": "^0.3.1", 42 "tinyexec": "^0.3.1",
41 "ufo": "^1.5.4", 43 "ufo": "^1.5.4",
42 "unocss": "0.59.0-beta.1", 44 "unocss": "0.59.0-beta.1",
pnpm-lock.yaml +45 −3
@@ -14,6 +14,9 @@ importers:
14 '@mdit/plugin-align': 14 '@mdit/plugin-align':
15 specifier: ^0.13.1 15 specifier: ^0.13.1
16 version: 0.13.1(markdown-it@14.1.0) 16 version: 0.13.1(markdown-it@14.1.0)
17 '@mdit/plugin-attrs':
18 specifier: ^0.23.1
19 version: 0.23.1(markdown-it@14.1.0)
17 '@mdit/plugin-figure': 20 '@mdit/plugin-figure':
18 specifier: ^0.13.1 21 specifier: ^0.13.1
19 version: 0.13.1(markdown-it@14.1.0) 22 version: 0.13.1(markdown-it@14.1.0)
@@ -65,6 +68,9 @@ importers:
65 nitropack: 68 nitropack:
66 specifier: ^2.10.4 69 specifier: ^2.10.4
67 version: 2.10.4(typescript@5.6.3)(webpack-sources@3.2.3) 70 version: 2.10.4(typescript@5.6.3)(webpack-sources@3.2.3)
71 pathe:
72 specifier: ^2.0.3
73 version: 2.0.3
68 tinyexec: 74 tinyexec:
69 specifier: ^0.3.1 75 specifier: ^0.3.1
70 version: 0.3.1 76 version: 0.3.1
@@ -1245,6 +1251,15 @@ packages:
1245 resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} 1251 resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==}
1246 hasBin: true 1252 hasBin: true
1247 1253
1254 '@mdit/helper@0.22.1':
1255 resolution: {integrity: sha512-lDpajcdAk84aYCNAM/Mi3djw38DJq7ocLw5VOSMu/u2YKX3/OD37a6Qb59in8Uyp4SiAbQoSHa8px6hgHEpB5g==}
1256 engines: {node: '>= 18'}
1257 peerDependencies:
1258 markdown-it: ^14.1.0
1259 peerDependenciesMeta:
1260 markdown-it:
1261 optional: true
1262
1248 '@mdit/plugin-align@0.13.1': 1263 '@mdit/plugin-align@0.13.1':
1249 resolution: {integrity: sha512-g8je53oEpYNHEudhtB5ViSiAaiMcca+hvoGbInhLl979tWuvEosOs0oWH2X3GM4f6goTGx8gLwzA10Z5C4FxIQ==} 1264 resolution: {integrity: sha512-g8je53oEpYNHEudhtB5ViSiAaiMcca+hvoGbInhLl979tWuvEosOs0oWH2X3GM4f6goTGx8gLwzA10Z5C4FxIQ==}
1250 engines: {node: '>= 18'} 1265 engines: {node: '>= 18'}
@@ -1254,6 +1269,15 @@ packages:
1254 markdown-it: 1269 markdown-it:
1255 optional: true 1270 optional: true
1256 1271
1272 '@mdit/plugin-attrs@0.23.1':
1273 resolution: {integrity: sha512-KY05v0DIBMItOxoniyDxxtyYIiT+0JTQ2Ke0mzyCyvPplqCv4Avus7/uAZ3+IGcaI2oOTlYEHdU288VBFgXjAw==}
1274 engines: {node: '>= 18'}
1275 peerDependencies:
1276 markdown-it: ^14.1.0
1277 peerDependenciesMeta:
1278 markdown-it:
1279 optional: true
1280
1257 '@mdit/plugin-container@0.13.1': 1281 '@mdit/plugin-container@0.13.1':
1258 resolution: {integrity: sha512-mFfm7YViyLHo8uORVa9oLi9+acZZoSVdPf3WPqzC/yLZAJbF27rfJgWZ9Kylt+tyaAYng8L4DiSeVcSNUIHF1A==} 1282 resolution: {integrity: sha512-mFfm7YViyLHo8uORVa9oLi9+acZZoSVdPf3WPqzC/yLZAJbF27rfJgWZ9Kylt+tyaAYng8L4DiSeVcSNUIHF1A==}
1259 engines: {node: '>= 18'} 1283 engines: {node: '>= 18'}
@@ -3408,6 +3432,9 @@ packages:
3408 pathe@1.1.2: 3432 pathe@1.1.2:
3409 resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} 3433 resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==}
3410 3434
3435 pathe@2.0.3:
3436 resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}
3437
3411 perfect-debounce@1.0.0: 3438 perfect-debounce@1.0.0:
3412 resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} 3439 resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==}
3413 3440
@@ -5149,6 +5176,12 @@ snapshots:
5149 - encoding 5176 - encoding
5150 - supports-color 5177 - supports-color
5151 5178
5179 '@mdit/helper@0.22.1(markdown-it@14.1.0)':
5180 dependencies:
5181 '@types/markdown-it': 14.1.2
5182 optionalDependencies:
5183 markdown-it: 14.1.0
5184
5152 '@mdit/plugin-align@0.13.1(markdown-it@14.1.0)': 5185 '@mdit/plugin-align@0.13.1(markdown-it@14.1.0)':
5153 dependencies: 5186 dependencies:
5154 '@mdit/plugin-container': 0.13.1(markdown-it@14.1.0) 5187 '@mdit/plugin-container': 0.13.1(markdown-it@14.1.0)
@@ -5156,6 +5189,13 @@ snapshots:
5156 optionalDependencies: 5189 optionalDependencies:
5157 markdown-it: 14.1.0 5190 markdown-it: 14.1.0
5158 5191
5192 '@mdit/plugin-attrs@0.23.1(markdown-it@14.1.0)':
5193 dependencies:
5194 '@mdit/helper': 0.22.1(markdown-it@14.1.0)
5195 '@types/markdown-it': 14.1.2
5196 optionalDependencies:
5197 markdown-it: 14.1.0
5198
5159 '@mdit/plugin-container@0.13.1(markdown-it@14.1.0)': 5199 '@mdit/plugin-container@0.13.1(markdown-it@14.1.0)':
5160 dependencies: 5200 dependencies:
5161 '@types/markdown-it': 14.1.2 5201 '@types/markdown-it': 14.1.2
@@ -6241,7 +6281,7 @@ snapshots:
6241 giget: 1.2.3 6281 giget: 1.2.3
6242 jiti: 2.4.0 6282 jiti: 2.4.0
6243 mlly: 1.7.2 6283 mlly: 1.7.2
6244 ohash: 1.1.4 6284 ohash: 1.1.6
6245 pathe: 1.1.2 6285 pathe: 1.1.2
6246 perfect-debounce: 1.0.0 6286 perfect-debounce: 1.0.0
6247 pkg-types: 1.2.1 6287 pkg-types: 1.2.1
@@ -6753,7 +6793,7 @@ snapshots:
6753 defu: 6.1.4 6793 defu: 6.1.4
6754 node-fetch-native: 1.6.4 6794 node-fetch-native: 1.6.4
6755 nypm: 0.3.8 6795 nypm: 0.3.8
6756 ohash: 1.1.4 6796 ohash: 1.1.6
6757 pathe: 1.1.2 6797 pathe: 1.1.2
6758 tar: 6.2.1 6798 tar: 6.2.1
6759 6799
@@ -6832,7 +6872,7 @@ snapshots:
6832 defu: 6.1.4 6872 defu: 6.1.4
6833 destr: 2.0.3 6873 destr: 2.0.3
6834 iron-webcrypto: 1.2.1 6874 iron-webcrypto: 1.2.1
6835 ohash: 1.1.4 6875 ohash: 1.1.6
6836 radix3: 1.1.2 6876 radix3: 1.1.2
6837 ufo: 1.5.4 6877 ufo: 1.5.4
6838 uncrypto: 0.1.3 6878 uncrypto: 0.1.3
@@ -7603,6 +7643,8 @@ snapshots:
7603 7643
7604 pathe@1.1.2: {} 7644 pathe@1.1.2: {}
7605 7645
7646 pathe@2.0.3: {}
7647
7606 perfect-debounce@1.0.0: {} 7648 perfect-debounce@1.0.0: {}
7607 7649
7608 picocolors@1.1.1: {} 7650 picocolors@1.1.1: {}