Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: make tutorial code block directly copyable #6833

Merged
merged 2 commits into from
Mar 4, 2022

Conversation

samgutentag
Copy link
Contributor

Motivation

Sample code block could not be copy/pasted as the tutorial mentions with the lines that appear to be from a diff tool.

Have you read the Contributing Guidelines on pull requests?

Yes! this is so small, wasn't sure if it should be an issue or a PR

Test Plan

None

Related PRs

None that I could find

Sample code block could not be copy/pasted as the tutorial mentions with the lines that appear to be from a diff tool.
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 3, 2022
@netlify
Copy link

netlify bot commented Mar 3, 2022

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: 46a0009

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/62215df636b00c000725dec7

😎 Browse the preview: https://deploy-preview-6833--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Mar 3, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 62
🟢 Accessibility 100
🟢 Best practices 92
🟢 SEO 100
🟢 PWA 90

Lighthouse ran on https://deploy-preview-6833--docusaurus-2.netlify.app/

@Josh-Cena Josh-Cena changed the title docs: sample code block mistakenly includes diff output docs: make tutorial codeblock directly copiable Mar 4, 2022
@Josh-Cena Josh-Cena changed the title docs: make tutorial codeblock directly copiable docs: make tutorial code block directly copyable Mar 4, 2022
@Josh-Cena Josh-Cena added the pr: documentation This PR works on the website or other text documents in the repo. label Mar 4, 2022
Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

I'm okay to change this to make the tutorial less confusing, but please do note that:

with the lines that appear to be from a diff tool.

The diff code block is a common technique for documentation to show a "user change". It's not the verbatim output from any tool. For example, here it's telling you to delete the existing items, and add items: ['hello'],. You will see this used in other places as well.

@Josh-Cena Josh-Cena merged commit aa5c9f5 into facebook:main Mar 4, 2022
@samgutentag
Copy link
Contributor Author

oh! ill admit i don't think I have ever seen that syntax before but it makes a ton of sense.

Thanks for taking the time to explain!

@slorber
Copy link
Collaborator

slorber commented Mar 4, 2022

oh! ill admit i don't think I have ever seen that syntax before but it makes a ton of sense.

You can see this on every single PR 😅

image

@samgutentag
Copy link
Contributor Author

oh well yea I see it in diff tools all the time! I meant more that I had not seen it in a sample code block like that 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants