From d9768d88e0dc87215c896247b7409526c02b2827 Mon Sep 17 00:00:00 2001 From: Leo <38490578+yuyinws@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:33:09 +0800 Subject: [PATCH] docs: add group icon plugin (#329) * docs: add group icon plugin * chore: fix lint error --- docs/.vitepress/config/index.ts | 9 +++++++ docs/.vitepress/theme/index.ts | 1 + package.json | 1 + pnpm-lock.yaml | 48 +++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) diff --git a/docs/.vitepress/config/index.ts b/docs/.vitepress/config/index.ts index 01105b4..d4cf6db 100644 --- a/docs/.vitepress/config/index.ts +++ b/docs/.vitepress/config/index.ts @@ -1,5 +1,6 @@ import { defineConfig } from 'vitepress' import { transformerTwoslash } from '@shikijs/vitepress-twoslash' +import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons' import { algolia } from './algolia' import { en } from './en' @@ -31,6 +32,14 @@ export default defineConfig({ dark: 'catppuccin-mocha', light: 'catppuccin-latte', }, + config(md) { + md.use(groupIconMdPlugin) + }, + }, + vite: { + plugins: [ + groupIconVitePlugin(), + ], }, themeConfig: { logo: { diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 6b9dbf4..bea02eb 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -5,6 +5,7 @@ import DefaultTheme from 'vitepress/theme' import TwoslashClient from '@shikijs/vitepress-twoslash/client' import '@shikijs/vitepress-twoslash/style.css' import './style.css' +import 'virtual:group-icons.css' export default { extends: DefaultTheme, diff --git a/package.json b/package.json index 025f0a7..8225887 100644 --- a/package.json +++ b/package.json @@ -108,6 +108,7 @@ "tsup": "^8.2.4", "typescript": "^5.5.4", "vitepress": "^1.3.4", + "vitepress-plugin-group-icons": "^1.1.0", "vitest": "^2.0.5", "vue": "^3.4.38", "vue-tsc": "^2.1.4" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b5d3c8..8c9ef97 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,6 +81,9 @@ importers: vitepress: specifier: ^1.3.4 version: 1.3.4(@algolia/client-search@4.24.0)(@types/node@22.5.2)(postcss@8.4.41)(search-insights@2.17.0)(terser@5.31.6)(typescript@5.5.4) + vitepress-plugin-group-icons: + specifier: ^1.1.0 + version: 1.1.0 vitest: specifier: ^2.0.5 version: 2.0.5(@types/node@22.5.2)(terser@5.31.6) @@ -1020,6 +1023,18 @@ packages: resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} engines: {node: '>=18.18'} + '@iconify-json/logos@1.2.0': + resolution: {integrity: sha512-VkU9QSqeZR2guWbecdqkcoZEAJfgJJTUm6QAsypuZQ7Cve6zy39wOXDjp2H31I8QyQy4O3Cz96+pNji6UQFg4w==} + + '@iconify-json/vscode-icons@1.2.0': + resolution: {integrity: sha512-DjsfialtmFQrJb4pi0P8Vm5+FVmXg8NExThMLwHOGjvMJi9Q89Qw36RpZxw2wEzPFkb19fMje+G0jeSeWol7ZA==} + + '@iconify/types@2.0.0': + resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} + + '@iconify/utils@2.1.32': + resolution: {integrity: sha512-LeifFZPPKu28O3AEDpYJNdEbvS4/ojAPyIW+pF/vUpJTYnbTiXUHkCh0bwgFRzKvdpb8H4Fbfd/742++MF4fPQ==} + '@ioredis/commands@1.2.0': resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} @@ -5032,6 +5047,9 @@ packages: terser: optional: true + vitepress-plugin-group-icons@1.1.0: + resolution: {integrity: sha512-hKf/imrMxa63kAXJlztsb8l6DZYBNZiVSZpJ15rNTeqAL1Hhbuf/DC87Q2r4b/mGKHUusEOI5ogt/jrJ8JoeUw==} + vitepress@1.3.4: resolution: {integrity: sha512-I1/F6OW1xl3kW4PaIMC6snxjWgf3qfziq2aqsDoFc/Gt41WbcRv++z8zjw8qGRIJ+I4bUW7ZcKFDHHN/jkH9DQ==} hasBin: true @@ -6017,6 +6035,28 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} + '@iconify-json/logos@1.2.0': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify-json/vscode-icons@1.2.0': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify/types@2.0.0': {} + + '@iconify/utils@2.1.32': + dependencies: + '@antfu/install-pkg': 0.4.1 + '@antfu/utils': 0.7.10 + '@iconify/types': 2.0.0 + debug: 4.3.6 + kolorist: 1.8.0 + local-pkg: 0.5.0 + mlly: 1.7.1 + transitivePeerDependencies: + - supports-color + '@ioredis/commands@1.2.0': {} '@isaacs/cliui@8.0.2': @@ -10841,6 +10881,14 @@ snapshots: fsevents: 2.3.3 terser: 5.31.6 + vitepress-plugin-group-icons@1.1.0: + dependencies: + '@iconify-json/logos': 1.2.0 + '@iconify-json/vscode-icons': 1.2.0 + '@iconify/utils': 2.1.32 + transitivePeerDependencies: + - supports-color + vitepress@1.3.4(@algolia/client-search@4.24.0)(@types/node@22.5.2)(postcss@8.4.41)(search-insights@2.17.0)(terser@5.31.6)(typescript@5.5.4): dependencies: '@docsearch/css': 3.6.1