-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Set code languages for various files (part 1) #28145
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @queengooborg, confusing as it sounds, "plain" is actually a marker for "it should have a language but the language it should be isn't supported so we use a placeholder". In Yari, "plain" is "planned for deprecation":
I'm on mobile, but I bet you can find past discussions on the content repo about this decision.
I'm -1 on deprecating "plain" as a language to apply to code blocks. As I have been going through these files, I've found numerous instances where a language wasn't selected for syntax highlighting, even though it should be. There's probably a bunch marked as "plain" that shouldn't be as well, but by requiring a language to be specified, we can perform a simple search to find such instances in our documents and fix them. Additionally, enforcing some language to be set forces the author to think about what language the code block should be set to, so that we can catch issues early on. (Take note on how many code blocks I have specified a language other than "plain" for in this PR.) Edit: our writing guidelines also say that "plain" should be used as a fallback: https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN#example_code_blocks |
Co-authored-by: Brian Thomas Smith <[email protected]>
Consider myself convinced, then—would be helpful if you could later update that Yari comment to make the wording different.
I think this discussion is also been done multiple times, but is marking command line prompt and output as bash really the best option? In some instances you may get some syntax highlighting but in some none. |
Good catch, @rubiesonthesky -- per our guidelines, we shouldn't be including the output of commands in Shell code blocks anyways. I'll submit a follow-up PR to fix this! |
This pull request has merge conflicts that must be resolved before it can be merged. |
Still looking to get review on this PR so we can land it soon! |
files/en-us/learn/javascript/building_blocks/looping_code/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn/javascript/building_blocks/conditionals/index.md
Outdated
Show resolved
Hide resolved
...en-us/learn/tools_and_testing/client-side_javascript_frameworks/vue_first_component/index.md
Show resolved
Hide resolved
…x.md Co-authored-by: Joshua Chen <[email protected]>
Co-authored-by: Joshua Chen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
files/en-us/learn/javascript/building_blocks/looping_code/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn/javascript/building_blocks/looping_code/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn/javascript/building_blocks/looping_code/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn/javascript/building_blocks/looping_code/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn/javascript/building_blocks/looping_code/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Joshua Chen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Let's get it in!
This PR sets the code language for various codeblocks that don't have one set, which will help us enforce setting a language on all codeblocks. This is the first part.