From 974ca0a838bd9a572450f0785850c20c0f7a5145 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Mon, 13 Jan 2025 11:41:18 -0500 Subject: [PATCH] docs: add tooltip js to pages that have codeblocks with actions --- docs/_plugins/markdown-it.ts | 10 +++++++++- docs/get-started/developers/tokens.md | 1 + docs/get-started/developers/usage.md | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/_plugins/markdown-it.ts b/docs/_plugins/markdown-it.ts index b2cfd1ed56..c9b6ea53f1 100644 --- a/docs/_plugins/markdown-it.ts +++ b/docs/_plugins/markdown-it.ts @@ -69,7 +69,15 @@ function rhdsCodeBlock(md: MarkdownIt) { dedent actions="${actions.join(' ')}" highlighting="prerendered" - ${slf.renderAttrs(redactedToken)}>${rendered}`.trim(); + ${slf.renderAttrs(redactedToken)}> + Copy to Clipboard + + ${!hasMoreThan1Line ? '' : html` + Toggle word wrap + + `} + ${rendered} + `.trim(); } else { return rendered; } diff --git a/docs/get-started/developers/tokens.md b/docs/get-started/developers/tokens.md index 4a734ca76a..7b83b452ee 100644 --- a/docs/get-started/developers/tokens.md +++ b/docs/get-started/developers/tokens.md @@ -13,6 +13,7 @@ subnav: ## How to install tokens diff --git a/docs/get-started/developers/usage.md b/docs/get-started/developers/usage.md index 7bd062d98d..3bea961b6c 100644 --- a/docs/get-started/developers/usage.md +++ b/docs/get-started/developers/usage.md @@ -13,6 +13,7 @@ subnav: ## Usage