Table of Contents

Copycode Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" yes
  • 2022-07-31 "Igor" yes
  • 2020-07-29 "Hogfather" yes

plugin Copy code block to clipboard with just a click

Last updated on
2023-11-08
Provides
Action
Repository
Source

Installation

:!: External requirements: This plugin requires jQuery (bundled with latests versions of DokuWiki).

Install the plugin using the Extension Manager Plugin or from the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Usage

Adds a javascript click event on all code blocks that copy the content of the block to clipboard. Just click on a code block: done! You can also select a part of a code inside a code block, and the selection gets immediately copied to clipboard. With right click you can copy the code block without carriage returns.

Development

This plugin uses the global Navigator.clipboard property. It can only be used on a secured environment and in a compatible navigator : https://developer.mozilla.org/en-US/docs/Web/API/Clipboard

Change Log

Thanks to @tvataire (https://github.com/tvataire) for the pull requests

ToDo/Wish List

Only translated into English, French, German and Dutch. Some translations are generated with Deepl and should be corrected. More languages should be added too, don't hesitate to help !