docs icon indicating copy to clipboard operation
docs copied to clipboard

Add the copy button to the code blocks

Open rajbos opened this issue 3 years ago • 3 comments

Why:

Add the copy button to the code blocks

What's being changed (if available, include any code snippets, screenshots, or gifs):

Add the copy button to the code blocks on this page

Check off the following:

  • [ ] I have reviewed my changes in staging (look for the "Automatically generated comment" and click the links in the "Preview" column to view your latest changes).
  • [ ] For content changes, I have completed the self-review checklist.

Writer impact (This section is for GitHub staff members only):

  • [ ] This pull request impacts the contribution experience
    • [ ] I have added the 'writer impact' label
    • [ ] I have added a description and/or a video demo of the changes below (e.g. a "before and after video")

rajbos avatar Aug 11 '22 07:08 rajbos

Automatically generated comment ℹ️

This comment is automatically generated and will be overwritten every time changes are committed to this branch.

The table contains an overview of files in the content directory that have been changed in this pull request. It's provided to make it easy to review your changes on the staging site. Please note that changes to the data directory will not show up in this table.


Content directory changes

You may find it useful to copy this table into the pull request summary. There you can edit it to share links to important articles or changes and to give a high-level overview of how the changes in your pull request support the overall goals of the pull request.

Source Preview Production What Changed
authentication/managing-commit-signature-verification/generating-a-new-gpg-key.md fpt
ghec
ghes@ 3.6 3.5 3.4 3.3 3.2
ghae
fpt
ghec
ghes@ 3.6 3.5 3.4 3.3 3.2
ghae

fpt: Free, Pro, Team ghec: GitHub Enterprise Cloud ghes: GitHub Enterprise Server ghae: GitHub AE

github-actions[bot] avatar Aug 11 '22 07:08 github-actions[bot]

Interesting to see that the changes in data/reusables/gpg/list-keys-with-note.md break the list items in the output, while the other reusable file change works as expected.

image

I can update the PR without this file, but rather have it fixed in a better way :-D.

rajbos avatar Aug 11 '22 07:08 rajbos

@rajbos Thanks for opening a PR and pointing out the broken output. Even though it's still a draft, I'm going to triage it for the team to get eyes on. Maybe there's a solution for the breakage. ⚡

cmwilson21 avatar Aug 11 '22 13:08 cmwilson21

👋 Hey again @rajbos! I spoke with the team and there may be one too many spaces leading up to the code block in the second reusable. Would you mind removing one of the spaces before the first ``` ?

cmwilson21 avatar Aug 16 '22 22:08 cmwilson21

Good catch. That space was already in the original file as well, as well as it already is in the other files as well. I did remove it but the redeploy does not display:

504.0 GatewayTimeout

Is there a way to force the redeploy so we can validate?

rajbos avatar Aug 17 '22 19:08 rajbos

I'm not sure what was causing the failure in the redeployment. I'm switching it from a draft to an opened pull request to see if that pushes through. I've marked it as "On hold" so it won't be on the review board until you are ready ✅

cmwilson21 avatar Aug 18 '22 20:08 cmwilson21

Hmm, that still didn't fix it. It's interesting because it looks like the note section from the previous reusable (list-keys-with-note) is leaking down into the broken one (copy-gpg-id-key). I still wonder if it has to do with spacing in the list-keys-with-note reusable. Maybe if we were to line them all up per the example in one of our contributing files, it will fix the leakage?

cmwilson21 avatar Aug 18 '22 21:08 cmwilson21

Testing that out. I think the are there (and might need to be) because they are used within list-items (either numbered or not)

rajbos avatar Aug 19 '22 19:08 rajbos

👋 @rajbos I think told you opposite of what was needed 🙈

I ran this by the team and the thought is that the code block start ``` on line 3 in the list-keys-with-note.md reusable needs to be tabbed in so that it is in line with the start of the list item above it (the word Use here). The break may be happening because the MD can’t tell that the codeblocks are part of the list items without that extra indentation.

cmwilson21 avatar Aug 24 '22 16:08 cmwilson21

ran this by the team and the thought is that the code block start ``` on line 3 in the list-keys-with-note.md reusable needs to be tabbed in so that it is in line with the start of the list item above it (the word Use here). The break may be happening because the MD can’t tell that the codeblocks are part of the list items without that extra indentation.

Seems reasonable, let's see if it will deploy this time 🙌 .

rajbos avatar Aug 24 '22 17:08 rajbos

Nope, no success here: image

Link: https://docs-19676-b4d73e.preview.ghdocs.com/en/[email protected]/authentication/managing-commit-signature-verification/generating-a-new-gpg-key

rajbos avatar Aug 24 '22 17:08 rajbos

I spoke with the team again and made a couple of changes regarding the spacing (again). I think that's got it this time! I appreciate your patience as we've worked through this one. 👍

Screen Shot 2022-08-26 at 10 04 36 AM

I'll get this merged down, soon! Thanks for the addition of the copy button! 💖

cmwilson21 avatar Aug 26 '22 15:08 cmwilson21

Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our help wanted issues :zap:

github-actions[bot] avatar Aug 26 '22 17:08 github-actions[bot]

Thanks for adding the copy buttons! And for working with us as we were figuring out the breakage. 💖

cmwilson21 avatar Aug 26 '22 17:08 cmwilson21