diff --git a/docs/reference/code-blocks.md b/docs/reference/code-blocks.md index 275ad00d0..6dbf5b2ad 100644 --- a/docs/reference/code-blocks.md +++ b/docs/reference/code-blocks.md @@ -81,6 +81,37 @@ theme: ``` ```` +??? tip "Overriding the clipboard text" + + If you want to define a slightly different text to be copied to the + clipboard, you can use the `data-copy` attribute on the code block. Note + that this attribute does not support multiple lines, which is not a + limitation of Material for MkDocs, but of the Markdown parser. Example: + + ```` markdown title="Code block" + ``` { .sh data-copy="curl https://www.example.com" } + $ curl https://www.example.com + # + # + # ... + ``` + ```` + +