Skip to content

InPoint-Automation/CopyCodeButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy Code Button

Icon

Description

Copy Code Button is a Publii plugin that adds a copy-to-clipboard button to every code block in your posts and pages. The button appears on hover and shows a brief confirmation after copying. It uses the browser's navigator.clipboard API.

Features

  • Copy-to-clipboard button on every code block in posts and pages
  • Button appears on hover
  • Confirmation after a successful copy
  • Configurable confirmation text (default Copied!)
  • Configurable confirmation duration in milliseconds (default 2000)
  • Configurable scope: posts and pages, posts only, or pages only

Requirements

Publii 0.43.0 or newer.

Installation

  1. Download the release ZIP.
  2. Publii -> Tools -> Plugins -> Install plugin -> pick the ZIP.
  3. Enable the plugin for the site.

Usage

Open Plugins -> Copy Code Button -> settings icon. Set the confirmation text and duration, and choose whether the button applies to posts and pages, posts only, or pages only. Rebuild the site; hover any code block to reveal the copy button.

screenshot

Contributing

Feel free to fork this project or contribute a PR. Build instructions can be found in the developer readme DEV.md.

Licenses

Main code

This project is licensed under the GPLv3+. See LICENSE file for details.

Third-Party Components

None, the plugin is self-contained plain JavaScript with no dependencies.

Credits

This project was developed by InPoint Automation Sp. z o.o. https://inpointautomation.com/

Thanks to the Publii project for the CMS and plugin API.

Changelog

See CHANGELOG.md for the full version history.

About

A Publii plugin that adds a copy-to-clipboard button to every code block in your posts and pages

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors