Note: TypeDoc natively supports this in v0.24.5
TypeDoc plugin that adds a button to copy code to clipboard for code blocks. See demo. Inspired by prototype.
NPM:
npm install typedoc-plugin-copy-code-to-clipboard --save-dev
Yarn:
yarn add typedoc-plugin-copy-code-to-clipboard --dev
TypeDoc automatically detected installed plugins. This plugin requires TypeDoc version ^0.23
.
Add the plugin to typedoc.json
:
{
"entryPoints": ["src"],
"plugin": ["typedoc-plugin-copy-code-to-clipboard"]
}
Or specify the plugin when running the CLI command:
npx typedoc src --plugin typedoc-plugin-copy-code-to-clipboard
Build the plugin:
npm run build # npm run build:watch
Generate the docs:
npm run docs
Open the docs:
open docs/index.html
Release is automated with Release Please.