Description
Add a copy button to the code blocks.
Additional Information
Links: | |
---|---|
Maintainers: | dragonish |
Version: | 2.0.0 |
Minimum app version: | 3.3.5 |
Downloads: This version: | 389 |
Last updated: | 2025-04-24T13:38:04Z |
Copy Code Blocks
Joplin Plugin
Features
Add a copy button to the code blocks.
Preview
Installation
Automatic
- Open Joplin, go to Tools > Options > Plugins.
- Search for
Copy Code Blocks
. - Install this plugin.
- Finally, restart the application.
Manual
- Go to the Releases to download the plugin package
zip
file and unzip it. - Open Joplin, go to Tools > Options > Plugins.
- Click Manage your plugins > Install from file, select the previously unzipped
jpl
file. - Finally, restart the application.
Custom the button style
You can customize the style of the button by adding content in userstyle.css
. The plugin provides the following CSS custom variables:
--copy-code-blocks-color
: Button color.--copy-code-blocks-hover-color
: Button hover color.--copy-code-blocks-copied-color
: Button copied color.--copy-code-blocks-copied-hover-color
: Button copied hover color.
For example:
body {
--copy-code-blocks-color: #133975;
--copy-code-blocks-hover-color: #2765ca;
--copy-code-blocks-copied-color: #6aba7b;
--copy-code-blocks-copied-hover-color: #a6da4d;
}
Building
The plugin is built using Webpack, which creates the compiled code in /dist
. A JPL archive will also be created at the root, which can use to distribute the plugin.
To build the plugin, simply run npm run dist
.
License
MIT license