Closed donnimsipa closed 3 weeks ago
It’s not meant to be used externally and is tied to the DOM we generate for code fences. So, in a blank theme the copy code button should still work without any additional steps. What is your use case?
It is not a hook exactly. It just adds an event listener and is not customizable. Why would want to use it manually?
I want to create something similar to useCopyCode directly within 'Custom Containers', but it seems that it's not feasible based on your explanation. Thank you for responding, and I will create a 'code' within 'Custom Containers' so that the 'copy code' appears instead of directly creating a copy button in 'Custom Containers'
Describe the bug
The Vitepress documentation lacks proper guidance on the usage of useCopyCode hook, which is essential for implementing copy-to-clipboard functionality in code blocks.
Reproduction
Expected behavior
The Vitepress documentation should provide comprehensive guidance, including usage examples and explanations, for the useCopyCode hook, enabling users to easily implement copy-to-clipboard functionality in their projects.
System Info
Additional context
No response
Validations