vuepress-code-copy
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Vuepress Code Copy

Code Copy Plugin For Vuepress2.X

NpmVersion npm

Example

vuepress-code-copy.png

Install

npm i vuepress-code-copy --save-dev
# or
yarn add vuepress-code-copy --save-dev

Use

.vuepress/config.ts

import CodeCopyPulgin from 'vuepress-code-copy'

export default defineUserConfig({
  //
  plugins:[
    CodeCopyPulgin(options: CopyPulginOptions),
  ]
})

PulginOptions

export interface CopyPulginOptions {
  /**
   * copy btn text
   *
   * 复制按钮字体
   * @default 'Copy'
   */
  copyText?: string
  /**
   * copied text
   *
   * 复制成功字体
   * @default 'Copied'
   */
  copiedText?: string
  /**
   * code selector
   *
   * code的选择器
   * @default 'div[class*="language-"]'
   */
  selector?: string
  /**
   * page delay (ms)
   *
   * 页面的延时 (ms)
   * @default 300
   */
  pageDelay?: number
  /**
   * copy text color
   *
   * 字体颜色
   * @default 'var(--code-ln-color)'
   */
  color?: string
}

Package Sidebar

Install

npm i vuepress-code-copy

Weekly Downloads

3

Version

1.1.0

License

MIT

Unpacked Size

10.1 kB

Total Files

16

Last publish

Collaborators

  • gkfonline