From 57e421a43361b434dbab1547bd5d1949a46cfa56 Mon Sep 17 00:00:00 2001 From: Sung Yoon Whang Date: Mon, 8 May 2023 08:42:30 -0700 Subject: [PATCH] [docs] Add the ability to copy code (#1083) This adds the "copy" button for all code snippets in the docs example so that users can easily copy the example code to their clipboard. Fix #1080. Example after change: Screen Shot 2023-05-07 at 10 37 26 PM --- docs/.vuepress/config.js | 1 + docs/package.json | 3 ++- docs/yarn.lock | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index c6b2d942d..c7d942413 100755 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -126,5 +126,6 @@ module.exports = { '@vuepress/plugin-medium-zoom', 'fulltext-search', 'vuepress-plugin-mermaidjs', + 'vuepress-plugin-code-copy', ] } diff --git a/docs/package.json b/docs/package.json index 396efae2c..a34f1908a 100755 --- a/docs/package.json +++ b/docs/package.json @@ -22,6 +22,7 @@ }, "dependencies": { "cacheable-request": "10.2.7", - "got": "^10.3.0" + "got": "^10.3.0", + "vuepress-plugin-code-copy": "^1.0.6" } } diff --git a/docs/yarn.lock b/docs/yarn.lock index 4d1480dcf..8b14a854f 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -8990,6 +8990,11 @@ vuepress-html-webpack-plugin@^3.2.0: toposort "^1.0.0" util.promisify "1.0.0" +vuepress-plugin-code-copy@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/vuepress-plugin-code-copy/-/vuepress-plugin-code-copy-1.0.6.tgz#6431dab764b48b5b203e4936d98b1943651ce4ad" + integrity sha512-FiqwMtlb4rEsOI56O6sSkekcd3SlESxbkR2IaTIQxsMOMoalKfW5R9WlR1Pjm10v6jmU661Ex8MR11k9IzrNUg== + vuepress-plugin-container@^2.0.2: version "2.1.5" resolved "https://registry.yarnpkg.com/vuepress-plugin-container/-/vuepress-plugin-container-2.1.5.tgz#37fff05662fedbd63ffd3a5463b2592c7a7f3133"