vitepress-plugin-steps 0.2.0 → 0.4.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.
@@ -1,9 +1,77 @@
1
1
  import { PluginSimple } from "markdown-it";
2
2
 
3
- //#region src/node/stepsPlugin.d.ts
4
- declare const stepsMarkdownPlugin: PluginSimple;
3
+ //#region src/node/plugin.d.ts
4
+ /**
5
+ * VitePress plugin for rendering ordered/unordered lists as numbered steps
6
+ * with badges and connecting lines.
7
+ *
8
+ * VitePress 插件,将有序/无序列表渲染为带徽标和连接线的编号步骤。
9
+ *
10
+ * The plugin registers the `::: steps` markdown container via
11
+ * `stepsMarkdownPlugin` and injects the required client-side stylesheet
12
+ * (`vitepress-plugin-steps/style.css`) through the `client.imports` hook.
13
+ *
14
+ * 该插件通过 `stepsMarkdownPlugin` 注册 `::: steps` markdown 容器,
15
+ * 并通过 `client.imports` 钩子注入所需的客户端样式表
16
+ * (`vitepress-plugin-steps/style.css`)。
17
+ *
18
+ * @example
19
+ * `.vitepress/config.ts`
20
+ * ```ts
21
+ * import { defineConfig } from 'vitepress-tuck'
22
+ * import steps from 'vitepress-plugin-steps'
23
+ * export default defineConfig({
24
+ * plugins: [steps()],
25
+ * })
26
+ * ```
27
+ */
28
+ declare const steps: (options?: unknown) => import("vitepress-tuck").VitepressPlugin;
5
29
  //#endregion
6
- //#region src/node/index.d.ts
7
- declare const _default: (option?: unknown) => import("vitepress-tuck").VitepressPlugin;
30
+ //#region src/node/markdown.d.ts
31
+ /**
32
+ * markdown-it plugin that registers the `::: steps` container for rendering
33
+ * ordered/unordered lists as numbered steps with badges and connecting lines.
34
+ *
35
+ * markdown-it 插件,注册 `::: steps` 容器,将有序/无序列表渲染为带徽标和连接线的编号步骤。
36
+ *
37
+ * The container wraps its inner list items with a `<div class="vp-steps">` element,
38
+ * leaving the list markup intact so the client-side styles can decorate each item
39
+ * as a step.
40
+ *
41
+ * 该容器使用 `<div class="vp-steps">` 元素包裹内部列表项,保留列表标记不变,
42
+ * 以便客户端样式将每个列表项装饰为步骤。
43
+ *
44
+ * @param md - The markdown-it instance to register the rule on / 要注册规则的 markdown-it 实例
45
+ *
46
+ * @example
47
+ * `.vitepress/config.ts`
48
+ * ```ts
49
+ * import { defineConfig } from 'vitepress'
50
+ * import { stepsMarkdownPlugin } from 'vitepress-plugin-steps'
51
+ * export default defineConfig({
52
+ * markdown: {
53
+ * config: (md) => {
54
+ * md.use(stepsMarkdownPlugin)
55
+ * },
56
+ * },
57
+ * })
58
+ * ```
59
+ *
60
+ * @example
61
+ * Markdown usage:
62
+ * ```md
63
+ * ::: steps
64
+ *
65
+ * - First step
66
+ *
67
+ * Description of the first step.
68
+ *
69
+ * - Second step
70
+ *
71
+ * Description of the second step.
72
+ * :::
73
+ * ```
74
+ */
75
+ declare const stepsMarkdownPlugin: PluginSimple;
8
76
  //#endregion
9
- export { _default as default, stepsMarkdownPlugin };
77
+ export { steps as default, steps, stepsMarkdownPlugin };
@@ -1,12 +1,80 @@
1
1
  import { definePlugin } from "vitepress-tuck";
2
2
  import { createContainerPlugin } from "vitepress-plugin-toolkit";
3
- //#region src/node/stepsPlugin.ts
3
+ //#region src/node/markdown.ts
4
+ /**
5
+ * markdown-it plugin that registers the `::: steps` container for rendering
6
+ * ordered/unordered lists as numbered steps with badges and connecting lines.
7
+ *
8
+ * markdown-it 插件,注册 `::: steps` 容器,将有序/无序列表渲染为带徽标和连接线的编号步骤。
9
+ *
10
+ * The container wraps its inner list items with a `<div class="vp-steps">` element,
11
+ * leaving the list markup intact so the client-side styles can decorate each item
12
+ * as a step.
13
+ *
14
+ * 该容器使用 `<div class="vp-steps">` 元素包裹内部列表项,保留列表标记不变,
15
+ * 以便客户端样式将每个列表项装饰为步骤。
16
+ *
17
+ * @param md - The markdown-it instance to register the rule on / 要注册规则的 markdown-it 实例
18
+ *
19
+ * @example
20
+ * `.vitepress/config.ts`
21
+ * ```ts
22
+ * import { defineConfig } from 'vitepress'
23
+ * import { stepsMarkdownPlugin } from 'vitepress-plugin-steps'
24
+ * export default defineConfig({
25
+ * markdown: {
26
+ * config: (md) => {
27
+ * md.use(stepsMarkdownPlugin)
28
+ * },
29
+ * },
30
+ * })
31
+ * ```
32
+ *
33
+ * @example
34
+ * Markdown usage:
35
+ * ```md
36
+ * ::: steps
37
+ *
38
+ * - First step
39
+ *
40
+ * Description of the first step.
41
+ *
42
+ * - Second step
43
+ *
44
+ * Description of the second step.
45
+ * :::
46
+ * ```
47
+ */
4
48
  const stepsMarkdownPlugin = (md) => {
5
49
  createContainerPlugin(md, "steps", { before: () => "<div class=\"vp-steps\">" });
6
50
  };
7
51
  //#endregion
8
- //#region src/node/index.ts
9
- var node_default = definePlugin(() => ({
52
+ //#region src/node/plugin.ts
53
+ /**
54
+ * VitePress plugin for rendering ordered/unordered lists as numbered steps
55
+ * with badges and connecting lines.
56
+ *
57
+ * VitePress 插件,将有序/无序列表渲染为带徽标和连接线的编号步骤。
58
+ *
59
+ * The plugin registers the `::: steps` markdown container via
60
+ * `stepsMarkdownPlugin` and injects the required client-side stylesheet
61
+ * (`vitepress-plugin-steps/style.css`) through the `client.imports` hook.
62
+ *
63
+ * 该插件通过 `stepsMarkdownPlugin` 注册 `::: steps` markdown 容器,
64
+ * 并通过 `client.imports` 钩子注入所需的客户端样式表
65
+ * (`vitepress-plugin-steps/style.css`)。
66
+ *
67
+ * @example
68
+ * `.vitepress/config.ts`
69
+ * ```ts
70
+ * import { defineConfig } from 'vitepress-tuck'
71
+ * import steps from 'vitepress-plugin-steps'
72
+ * export default defineConfig({
73
+ * plugins: [steps()],
74
+ * })
75
+ * ```
76
+ */
77
+ const steps = definePlugin(() => ({
10
78
  name: "vitepress-plugin-steps",
11
79
  client: { imports: [`import 'vitepress-plugin-steps/style.css'`] },
12
80
  markdown: { config: (md) => {
@@ -14,4 +82,7 @@ var node_default = definePlugin(() => ({
14
82
  } }
15
83
  }));
16
84
  //#endregion
17
- export { node_default as default, stepsMarkdownPlugin };
85
+ //#region src/node/index.ts
86
+ var node_default = steps;
87
+ //#endregion
88
+ export { node_default as default, steps, stepsMarkdownPlugin };
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "vitepress-plugin-steps",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.4.0",
5
5
  "description": "Render ordered/unordered lists as numbered steps with badges and connecting lines.",
6
6
  "author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
7
7
  "license": "MIT",
8
+ "homepage": "https://tuck.pengzhanbo.cn/plugins/steps",
8
9
  "repository": {
9
10
  "type": "git",
10
11
  "url": "git+https://github.com/pengzhanbo/vitepress-tuck.git",
11
12
  "directory": "packages/plugin-steps"
12
13
  },
14
+ "bugs": {
15
+ "url": "https://github.com/pengzhanbo/vitepress-tuck/issues"
16
+ },
13
17
  "keywords": [
14
18
  "vitepress",
15
19
  "vitepress-plugin",
@@ -32,8 +36,8 @@
32
36
  "vue": "^3.5.0"
33
37
  },
34
38
  "dependencies": {
35
- "vitepress-plugin-toolkit": "0.2.0",
36
- "vitepress-tuck": "0.2.0"
39
+ "vitepress-plugin-toolkit": "0.4.0",
40
+ "vitepress-tuck": "0.4.0"
37
41
  },
38
42
  "publishConfig": {
39
43
  "access": "public",