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

Adds import statement to code usage example #59327

Merged
merged 2 commits into from
Feb 27, 2024
Merged

Conversation

bacoords
Copy link
Contributor

What?

This is a minor documentation change to add the import statement to the code example. This seems to be a consistent pattern. Examples from other packages:

Why?

Added for consistency and because import statements in the example code can be helpful for newer developers.

Copy link

github-actions bot commented Feb 23, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: bacoords <bacoords@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Nice catch 👍

@t-hamano t-hamano added the [Type] Developer Documentation Documentation for developers label Feb 24, 2024
@t-hamano
Copy link
Contributor

This documentation is auto-generated from JSDoc. Therefore, you need to update the following locations:

* @example
* ```js
* const result = decodeEntities( '&aacute;' );
* console.log( result ); // result will be "á"
* ```
*

Then run docs:build to regenerate the documentation. It's also a good idea to use single quotes instead of double quotes.

@bacoords
Copy link
Contributor Author

Makes sense about the auto-generation. Thanks @t-hamano for explaining how to commit here- I've pushed an update.

@t-hamano t-hamano self-requested a review February 27, 2024 01:36
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM! I'm a little concerned that the GitHub action related to backporting PHP is failing, but this PR does not make any changes to PHP files, and this GitHub action is optional. Therefore, I will merge this PR 👍

@t-hamano t-hamano merged commit 2b2a2be into WordPress:trunk Feb 27, 2024
56 of 57 checks passed
@github-actions github-actions bot added this to the Gutenberg 17.9 milestone Feb 27, 2024
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
2 participants