Skip to content

Niki02TTS/markdownCopyButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown Copy Button Plugin

Functionality

This plugin adds a copy button to each code block in the markdown content. When the button is clicked, the content of the code block is copied to the clipboard.

Installation

Install markdown-it and markdown-it-copy-button via npm:

npm install markdown-it
npm install markdown-it-copy-button

Usage

import MarkdownIt from 'markdown-it';
import markdownCopyButton from 'markdown-copy-button';

const md = new MarkdownIt().use(markdownCopyButton, {
    // Options
});
const htmlContent = md.render('## markdown content');

Options

Option type Default Beschreibung
iconStyle String 'font-size: 20px; opacity: 0.4;' style of the copy icon
buttonStyle String 'position: absolute; top: 4.5px; right: 6px; cursor: pointer; outline: none;' style of the copy button
buttonClass String 'copyButton' class of the copy button
imageFolder String 'copy.svg' path to the icon for the copy button
imageWidth String '16px' width of the button element
imageHeight String '16px' height of the button element

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published