Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
docsify-copy-code
Advanced tools
Changelog
3.0.0
2023-08-18
Readme
A docsify plugin that adds a button to easily copy code blocks to your clipboard.
Add following script tag to your index.html
after docsify. Specifying the @[version]
in the URL ensures that the release of a major update (v3.x) will not break your production site:
<!-- Latest v2.x.x -->
<script src="https://unpkg.com/docsify-copy-code@2"></script>
If you prefer to load the latest version of the library, you may do so by omitting the @[version]
from the above URL.
<!-- Latest (not recommended for production) -->
<script src="https://unpkg.com/docsify-copy-code"></script>
Create a markdown code block with help of triple backticks at the beginning and end of your code. This block will have a copy button on the top right when hovering over it.
Button text can be customized as follows:
window.$docsify = {
// docsify-copy-code (defaults)
copyCode: {
buttonText: 'Copy to clipboard',
errorText: 'Error',
successText: 'Copied',
},
};
Button text can also be customized based on the current URL. Object key/value pairs are processed in the order provided.
window.$docsify = {
copyCode: {
buttonText: {
'/zh-cn/': '点击复制',
'/ru/': 'Скопировать в буфер обмена',
'/de-de/': 'Klicken Sie zum Kopieren',
'/es/': 'Haga clic para copiar',
'/': 'Copy to clipboard',
},
errorText: {
'/zh-cn/': '错误',
'/ru/': 'ошибка',
'/': 'Error',
},
successText: {
'/zh-cn/': '复制',
'/ru/': 'Скопировано',
'/de-de/': 'Kopiert',
'/es/': 'Copiado',
'/': 'Copied',
},
},
};
Note: Docsify's alias option makes it easy to manage local content using separate directories. See the /demo/
content in this repo for an example.
This project is licensed under the MIT License. See the LICENSE for details.
FAQs
A docsify plugin that copies a markdown code block to your clipboard
The npm package docsify-copy-code receives a total of 5,722 weekly downloads. As such, docsify-copy-code popularity was classified as popular.
We found that docsify-copy-code demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.