Skip to content

Add copy buttons to additional code fence languages#35215

Merged
jeff-morgan-dd merged 2 commits intomasterfrom
jeff.morgan/copy-button-code-lang
Mar 13, 2026
Merged

Add copy buttons to additional code fence languages#35215
jeff-morgan-dd merged 2 commits intomasterfrom
jeff.morgan/copy-button-code-lang

Conversation

@jeff-morgan-dd
Copy link
Copy Markdown
Contributor

@jeff-morgan-dd jeff-morgan-dd commented Mar 11, 2026

What does this PR do? What is the motivation?

Adds copy buttons for bash, hcl, python code fence languages.

Changes:

  • Updated copy-code.js to add copy buttons to for the above languages

Why:

  • Several recent PR submitters have asked about the button for code blocks for the above languages.
    • https://datadoghq.atlassian.net/wiki/x/joAEvw documents valid reasons to keep an allowlist (as opposed to just including Copy buttons for all code blocks). This approach allows us to retain the option to exclude the Copy button as needed.

Merge instructions

Merge readiness:

  • Ready for merge

Additional notes

Staging: https://docs-staging.datadoghq.com/jeff.morgan/copy-button-code-lang/
Example page with Python code block that now includes Copy button: https://docs-staging.datadoghq.com/jeff.morgan/copy-button-code-lang/llm_observability/trace_proxy_services/?tab=python#overview

🤖 Generated with Claude Code

Removes language filtering so copy buttons now appear on all code blocks
(bash, python, go, etc.) instead of just shell, json, yaml, and sql.

Users can still easily roll forward to a deny-list approach if needed
by adding a small exclude filter.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jeff-morgan-dd jeff-morgan-dd added the WORK IN PROGRESS No review needed, it's a wip ;) label Mar 11, 2026
@jeff-morgan-dd jeff-morgan-dd requested a review from a team as a code owner March 11, 2026 19:27
@jeff-morgan-dd jeff-morgan-dd added the WORK IN PROGRESS No review needed, it's a wip ;) label Mar 11, 2026
@github-actions github-actions Bot added the Architecture Everything related to the Doc backend label Mar 11, 2026
@jeff-morgan-dd jeff-morgan-dd changed the title Add copy buttons to all code fence languages Add copy buttons to additional code fence languages Mar 11, 2026
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jeff-morgan-dd jeff-morgan-dd force-pushed the jeff.morgan/copy-button-code-lang branch from d8afc10 to 11e2d93 Compare March 11, 2026 20:36
@jeff-morgan-dd jeff-morgan-dd removed the WORK IN PROGRESS No review needed, it's a wip ;) label Mar 12, 2026
Copy link
Copy Markdown
Contributor

@timsara331 timsara331 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jeff-morgan-dd jeff-morgan-dd merged commit 42cbde4 into master Mar 13, 2026
19 checks passed
@jeff-morgan-dd jeff-morgan-dd deleted the jeff.morgan/copy-button-code-lang branch March 13, 2026 15:00
genesor pushed a commit that referenced this pull request Apr 19, 2026
* Add bash, hcl, and python to copy button allowlist

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Architecture Everything related to the Doc backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants