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

Use codetabs to label ESNext code as such #13781

Merged
merged 1 commit into from
Feb 10, 2019
Merged

Use codetabs to label ESNext code as such #13781

merged 1 commit into from
Feb 10, 2019

Conversation

mkaz
Copy link
Member

@mkaz mkaz commented Feb 8, 2019

Description

This PR tests using the {% codetabs %} markup to label an ESNext block of code as such, even without the alternative ES5 tab included.

There can be confusion on what type of code is being displayed/copied/pasted, so being able to label ESNext code as such will help people working in an ES5 only environment that there might be a potential for problems if they copy/paste the code as shown.

Types of changes

Documentation.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Let's see how it looks in the handbook :)

@gziolo gziolo merged commit 0a33b84 into master Feb 10, 2019
@gziolo gziolo deleted the try/docs/codetabs branch February 10, 2019 15:01
@youknowriad youknowriad added this to the Documentation & Handbook milestone Feb 11, 2019
@gziolo
Copy link
Member

gziolo commented Feb 11, 2019

I was thinking a bit more about { %codetabs% } markup and I figured out that while it works great with Gutenberg handbook, it doesn't look great on GitHub and npm.

https://www.npmjs.com/package/@wordpress/plugins

screen shot 2019-02-11 at 13 59 25

https://github.com/WordPress/gutenberg/blob/master/packages/plugins/README.md

screen shot 2019-02-11 at 13 59 54

Given that it is possible to use HTML tags and therefore comments, maybe we could come up with a syntax that would display properly everywhere? It might be challenging but it's worth exploring in my opinion. I know that @griffbrad was interesting in improving how we handle code snippets in our docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants