Code Monkey home page Code Monkey logo

vuepress-code-copy's Introduction

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
}

vuepress-code-copy's People

Contributors

gkf442573575 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.