{"id":16369682,"url":"https://github.com/dcsunset/markdown-it-code-copy","last_synced_at":"2025-04-10T02:25:27.570Z","repository":{"id":45043058,"uuid":"262998161","full_name":"DCsunset/markdown-it-code-copy","owner":"DCsunset","description":"A markdown-it plugin to add a copy icon in code blocks to copy the code.","archived":false,"fork":false,"pushed_at":"2025-03-06T02:11:03.000Z","size":51,"stargazers_count":16,"open_issues_count":1,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T21:07:13.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DCsunset.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-11T09:31:43.000Z","updated_at":"2025-03-06T02:11:06.000Z","dependencies_parsed_at":"2024-06-18T20:08:45.237Z","dependency_job_id":"92e5f273-fa41-41bc-84c6-6e28e1069db2","html_url":"https://github.com/DCsunset/markdown-it-code-copy","commit_stats":{"total_commits":16,"total_committers":4,"mean_commits":4.0,"dds":0.5625,"last_synced_commit":"c1b325622192783c5a58ec361292063b14c84f70"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Fmarkdown-it-code-copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Fmarkdown-it-code-copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Fmarkdown-it-code-copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Fmarkdown-it-code-copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCsunset","download_url":"https://codeload.github.com/DCsunset/markdown-it-code-copy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143621,"owners_count":21054809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T02:56:01.748Z","updated_at":"2025-04-10T02:25:27.542Z","avatar_url":"https://github.com/DCsunset.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markdown-it-code-copy\n\n[![npm](https://img.shields.io/npm/v/markdown-it-code-copy.svg)](https://www.npmjs.com/package/markdown-it-code-copy)\n[![GitHub](https://img.shields.io/github/license/DCsunset/markdown-it-code-copy)](https://github.com/DCsunset/markdown-it-code-copy/blob/master/LICENSE)\n\nA markdown-it plugin to add a copy icon in code blocks to copy the code.\n\n## Screenshots\n\n![Screenshot](screenshot.png)\n\n\n## Installation\n\n```\nnpm i markdown-it-code-copy\n```\n\n\n## Usage\n\nMake sure the corresponding icon font is installed\n(default is [material-design-icons](https://dev.materialdesignicons.com/getting-started/webfont)).\n\n```js\nconst md = require('markdown-it')()\n\t.use(require('markdown-it-code-copy'), {\n\t\t// Options\n\t});\n```\n\n### Options\n\n| Name        | Default                                                                       | Description                               |\n|-------------|-------------------------------------------------------------------------------|-------------------------------------------|\n| iconStyle   | 'font-size: 21px; opacity: 0.4;'                                              | The style of copy icon                    |\n| iconClass   | 'mdi mdi-content-copy'                                                        | The class of copy icon                    |\n| buttonStyle | 'position: absolute; top: 7.5px; right: 6px; cursor: pointer; outline: none;' | The style of the button wrapper           |\n| buttonClass | ''                                                                            | The class of the button wrapper           |\n| element     | ''                                                                            | Custom HTML element as button body        |\n| onSuccess   | undefined                                                                     | Function to call when copied successfully |\n| onError     | undefined                                                                     | Function to call when error occurred      |\n\n**Tips**:\nIf you want to use a different icon font,\nchange the icon class and make sure the corresponding icon font is installed.\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcsunset%2Fmarkdown-it-code-copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcsunset%2Fmarkdown-it-code-copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcsunset%2Fmarkdown-it-code-copy/lists"}