diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index b3a8143..b0be210 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -1,10 +1,10 @@ import { defineUserConfig } from 'vuepress' -import type { Plugin } from '@vuepress/core' import { viteBundler } from '@vuepress/bundler-vite' import { getDirname, path } from '@vuepress/utils' import { registerComponentsPlugin } from '@vuepress/plugin-register-components' import { containerPlugin } from '@vuepress/plugin-container' import fullTextSearchPlugin from 'vuepress-plugin-full-text-search2' +import codeCopyPlugin from '@snippetors/vuepress-plugin-code-copy' import microAppTheme from './theme' import { navbar as navbarZh, sidebarZh } from './configs' @@ -32,7 +32,8 @@ export default defineUserConfig({ repo: 'https://github.com/micro-zoe/micro-app', /* edit doc */ - // docsBranch: 'doc', + docsRepo: 'https://github.com/CrystalAngelLee/micro-app-docs', + docsBranch: 'master', docsDir: 'docs', /* edit doc */ @@ -96,6 +97,12 @@ export default defineUserConfig({ defaultInfo: 'Note' } } + }), + /** @see: https://snippetors.github.io/plugins/vuepress-plugin-code-copy.html */ + codeCopyPlugin({ + align: 'top', + color: '#3eaf7c', + backgroundTransition: false }) ] }) diff --git a/docs/.vuepress/styles/index.scss b/docs/.vuepress/styles/index.scss new file mode 100644 index 0000000..82bbae8 --- /dev/null +++ b/docs/.vuepress/styles/index.scss @@ -0,0 +1,16 @@ +.custom-container.note { + border-color: #17a2b8; + background-color: var(--c-tip-bg); + color: var(--c-tip-text); + + .custom-container-title { + color: var(--c-tip-title); + } +} + +.custom-container.note { + padding: 0.1rem 1.5rem; + border-left-width: 0.5rem; + border-left-style: solid; + margin: 1rem 0; +} diff --git a/package.json b/package.json index 065d278..ce7e0dc 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ }, "devDependencies": { "@micro-zoe/micro-app": "^1.0.0-rc.3", + "@snippetors/vuepress-plugin-code-copy": "^1.2.3", "@vuepress/bundler-vite": "2.0.0-rc.2", "@vuepress/plugin-register-components": "^2.0.0-rc.3", "@vuepress/theme-default": "2.0.0-rc.2", diff --git a/yarn.lock b/yarn.lock index 9403482..eab7fd0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -294,6 +294,11 @@ resolved "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-1.0.0.tgz#9cd84cc15bc865a5ca35fcaae198eb899f7b5c90" integrity sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw== +"@snippetors/vuepress-plugin-code-copy@^1.2.3": + version "1.2.3" + resolved "https://registry.npmjs.org/@snippetors/vuepress-plugin-code-copy/-/vuepress-plugin-code-copy-1.2.3.tgz#4cc5f7ef7530ff6654786f6baa2e15ca4ffb8b14" + integrity sha512-PiUbhlYseY4UqsE/ike/Up27GkrbHvR7OJqV5nlmHEW141uWcrVaBZsBS870ckqNF+vd2fk8g4TyoiHvxaUzSg== + "@types/debug@^4.1.12": version "4.1.12" resolved "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917"