Skip to content

Jen.gilbert/api copy button#37245

Open
jhgilbert wants to merge 6 commits into
masterfrom
jen.gilbert/api-copy-button
Open

Jen.gilbert/api copy button#37245
jhgilbert wants to merge 6 commits into
masterfrom
jen.gilbert/api-copy-button

Conversation

@jhgilbert
Copy link
Copy Markdown
Contributor

@jhgilbert jhgilbert commented Jun 3, 2026

What does this PR do? What is the motivation?

Adds a copy button to the generated API docs.

Note that you'll see a CORS error in the network console if you try to use the copy button, and the text copied to the clipboard will be the failover scrape from the HTML, not the actual .md text available at docs.datadoghq.com. This is expected behavior in staging, because staging doesn't have a plaintext build yet. But you can see that the correct URL is being called, and see that it does exist in prod.

Merge instructions

Merge readiness:

  • Ready for merge

For Datadog employees:

Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). Without this format, your pull request will not pass CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.

If your branch doesn't follow this format, rename it or create a new branch and PR.

[6/5/2025] Merge queue has been disabled on the documentation repo. If you have write access to the repo, the PR has been reviewed by a Documentation team member, and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #documentation channel in Slack.

AI assistance

Additional notes

@jhgilbert jhgilbert requested a review from a team as a code owner June 3, 2026 22:10
@jhgilbert jhgilbert added the WORK IN PROGRESS No review needed, it's a wip ;) label Jun 3, 2026
@github-actions github-actions Bot added the Architecture Everything related to the Doc backend label Jun 3, 2026
@datadog-datadog-prod-us1

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@brett0000FF brett0000FF left a comment

Choose a reason for hiding this comment

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

Thanks for adding this! I think that this should go at the h1 level, right-aligned to the content. When it appears directly under the title, it breaks up the page content and feels more like part of the article body than a page-level utility. Also +1 to shortening the label to Copy page.

Category page:

Image

Endpoint page:

Image

(The endpoint page is a little trickier because the version already occupies that top-right area, but I think placing Copy page near the version is still preferable to placing it under the H1.)

Out of scope for this PR, but longer term it might be nice to align this with our non-API reference pages, where page utilities live in the right rail:

Image

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 WORK IN PROGRESS No review needed, it's a wip ;)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants