Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

remarkablemark/typedoc-plugin-copy-code-to-clipboard

Repository files navigation

Note: TypeDoc natively supports this in v0.24.5

typedoc-plugin-copy-code-to-clipboard

NPM

NPM version build

TypeDoc plugin that adds a button to copy code to clipboard for code blocks. See demo. Inspired by prototype.

Installation

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.

Configuration

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

Development

Build the plugin:

npm run build # npm run build:watch

Generate the docs:

npm run docs

Open the docs:

open docs/index.html

Release

Release is automated with Release Please.

License

MIT