Skip to content

Commit

Permalink
Switch a bunch of documentation titles to title case (#13714)
Browse files Browse the repository at this point in the history
* Switch a bunch of documentation titles to title case

* Fix one lingering instance

* Update `manifest.json` with new titles

* Fix merge conflict discrepancy

* npm should always be lowercase

Co-Authored-By: danielbachhuber <daniel@bachhuber.co>

* Correct spelling for JavaScript

Co-Authored-By: danielbachhuber <daniel@bachhuber.co>

* Update `manifest.json` again
  • Loading branch information
danielbachhuber authored and youknowriad committed Mar 6, 2019
1 parent afc910c commit 31a8581
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The new script package is registered with WordPress as `wp-i18n` and should be d

Depending on your developer workflow, you might want to use WP-CLI's `wp i18n make-pot` command or a build tool for Babel called `@wordpress/babel-plugin-makepot` to create the necessary translation file. The latter approach integrates with Babel to extract the I18N methods.

### Common methods in wp.i18n (may look similar)
### Common Methods in wp.i18n (May Look Similar)

- `setLocaleData( data: Object, domain: string )`: Creates a new I18N instance providing translation data for a domain.
- `__( 'Hello World', 'my-text-domain' )`: Translate a certain string.
Expand Down
4 changes: 2 additions & 2 deletions docs/designers-developers/developers/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

WordPress exposes a list of JavaScript packages and tools for WordPress development.

## Using the packages via WordPress global
## Using the Packages via WordPress Global

JavaScript packages are available as a registered script in WordPress and can be accessed using the `wp` global variable.

Expand All @@ -22,7 +22,7 @@ const { PlainText } = wp.editor;

```

## Using the packages via npm
## Using the Packages via npm

All the packages are also available on [npm](https://www.npmjs.com/org/wordpress) if you want to bundle them in your code.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Register a new format
# Register a New Format

The first thing you're going to do in this tutorial is to register the new format that the plugin intends to apply. WordPress has the [`registerFormatType`](/packages/rich-text/README.md#registerFormatType) function to do so.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Add a button to the toolbar
# Add a Button to the Toolbar

Now that the format is avaible, the next step is to surface it to the UI. You can make use of the [`RichTextToolbarButton`](/packages/editor/src/components/rich-text/README.md#RichTextToolbarButton) component to extend the format toolbar.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Apply the format when the button is clicked
# Apply the Format When the Button Is Clicked

So far, your custom button doesn't modify the text selected, it only renders a message in the console. Let's change that.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In WordPress lingo, a _format_ is a [HTML tag with text-level semantics](https:/

If you are unfamiliar with how to work with WordPress plugins and JavaScript, you may want to check the [JavaScript Tutorial](/docs/designers-developers/developers/tutorials/javascript/readme.md) first.

## Table of contents
## Table of Contents

1. [Register a new format](/docs/designers-developers/developers/tutorials/format-api/1-register-format.md)
2. [Add a button to the toolbar](/docs/designers-developers/developers/tutorials/format-api/2-toolbar-button.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Scope your code
# Scope Your Code

Historically, JavaScript files loaded in a web page share the same scope. This means that a global variable declared in one file will be seen by the code in other files.

Expand Down Expand Up @@ -26,7 +26,7 @@ When loaded on the same page, `first.js` and `second.js` will output the plugin

This behavior can be problematic, and is the reason we need to scope the code. By scoping the code—ensuring each file is isolated from each other—we can prevent values unexpectedly changing.

## Scoping code within a function
## Scoping Code Within a Function

In JavaScript, you can scope your code by writing it within a function. Functions have "local scope", or a scope that is specific only to that function. Aditionally, in JavaScript you can write anonymous functions, functions without a name, which will also prevent your function name from being overridden in the global scope.

Expand Down Expand Up @@ -58,7 +58,7 @@ function() {

With this trick, the different files won't override each other's variables. Unfortunately, they also won't work as expected, because these functions are being called by no one. We've only _defined_ the functions; we haven't _executed_ them yet.

## Automatically execute anonymous functions
## Automatically Execute Anonymous Functions

It turns out there are a few ways to execute anonymous functions in JavaScript, but the most popular is this:

Expand Down Expand Up @@ -106,7 +106,7 @@ On the other hand, `third.js` doesn't declare a `pluginName` variable, but needs
} )( window.pluginName )
```

## Future changes
## Future Changes

At the beginning we mentioned that:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you are not seeing your changes, check that your JavaScript file is being enq

If you do not see the file being loaded, doublecheck the enqueue function is correct. You can also check your server logs to see if there is an error messages.

## Confirm all dependencies are loaded
## Confirm All Dependencies Are Loaded

The console log will show an error if a dependency your JavaScript code uses has not been declared and loaded in the browser. In the example, if `myguten.js` script is enqueued without declaring the `wp-blocks` dependency, the console log will show:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# JavaScript versions and build step
# JavaScript Versions and Build Step

The Gutenberg Handbook shows JavaScript examples in two syntaxes: ES5 and ESNext. These are version names for the JavaScript language standard definitions. You may also see elsewhere the names ES6, or ECMAScript 2015 mentioned. See the [ECMAScript](https://en.wikipedia.org/wiki/ECMAScript) Wikipedia article for all the details.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Creating a sidebar for your plugin
# Creating a Sidebar for Your Plugin

This tutorial starts with you having an existing plugin setup and ready to add PHP and JavaScript code. Please, refer to [Getting started with JavaScript](/docs/designers-developers/developers/tutorials/javascript/) tutorial for an introduction to WordPress plugins and how to use JavaScript to extend the block editor.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Get a sidebar up and running
# Get a Sidebar up and Running

The first step in the journey is to tell the editor that there is a new plugin that will have its own sidebar. You can do so by using the [registerPlugin](/packages/plugins/REAMDE.md), [PluginSidebar](/packages/edit-post/README.md#pluginsidebar), and [createElement](/packages/element/README.md) utilities provided by WordPress, to be found in the `@wordpress/plugins`, `@wordpress/edit-post`, and `@wordpress/element` [packages](/docs/designers-developers/developers/packages.md), respectively.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Register the meta field
# Register the Meta Field

To work with fields in the `post_meta` table, WordPress has a function called [register_meta](https://developer.wordpress.org/reference/functions/register_meta/). You're going to use it to register a new field called `sidebar_plugin_meta_block_field`, which will be a single string. Note that this field needs to be available through the [REST API](https://developer.wordpress.org/rest-api/) because that's how the block editor access data.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Initialize the input control
# Initialize the Input Control

Now that the field is available in the editor store, it can be surfaced to the UI. The first step will be to extract the input control to a separate function so you can expand its functionality while the code stays clear.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Update the meta field when the input's content changes
# Update the Meta Field When the Input's Content Changes

The last step in the journey is to update the meta field when the input content changes. To do that, you'll use another utility from the `@wordpress/data` package, [withDispatch](/packages/data/README.md#withdispatch-mapdispatchtoprops-function-function).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Finishing touches
# Finishing Touches

Your JavaScript code now works as expected, here are a few ways to simplify and make it easier to change in the future.

Expand Down
22 changes: 11 additions & 11 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@
"parent": "javascript"
},
{
"title": "JavaScript versions and build step",
"title": "JavaScript Versions and Build Step",
"slug": "versions-and-building",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/javascript/versions-and-building.md",
"parent": "javascript"
},
{
"title": "Scope your code",
"title": "Scope Your Code",
"slug": "scope-your-code",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/javascript/scope-your-code.md",
"parent": "javascript"
Expand Down Expand Up @@ -288,13 +288,13 @@
"parent": "tutorials"
},
{
"title": "Creating a sidebar for your plugin",
"title": "Creating a Sidebar for Your Plugin",
"slug": "plugin-sidebar-0",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/sidebar-tutorial/plugin-sidebar-0.md",
"parent": "tutorials"
},
{
"title": "Get a sidebar up and running",
"title": "Get a Sidebar up and Running",
"slug": "plugin-sidebar-1-up-and-running",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/sidebar-tutorial/plugin-sidebar-1-up-and-running.md",
"parent": "plugin-sidebar-0"
Expand All @@ -306,25 +306,25 @@
"parent": "plugin-sidebar-0"
},
{
"title": "Register the meta field",
"title": "Register the Meta Field",
"slug": "plugin-sidebar-3-register-meta",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/sidebar-tutorial/plugin-sidebar-3-register-meta.md",
"parent": "plugin-sidebar-0"
},
{
"title": "Initialize the input control",
"title": "Initialize the Input Control",
"slug": "plugin-sidebar-4-initialize-input",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/sidebar-tutorial/plugin-sidebar-4-initialize-input.md",
"parent": "plugin-sidebar-0"
},
{
"title": "Update the meta field when the input's content changes",
"title": "Update the Meta Field When the Input's Content Changes",
"slug": "plugin-sidebar-5-update-meta",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/sidebar-tutorial/plugin-sidebar-5-update-meta.md",
"parent": "plugin-sidebar-0"
},
{
"title": "Finishing touches",
"title": "Finishing Touches",
"slug": "plugin-sidebar-6-finishing-touches",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/sidebar-tutorial/plugin-sidebar-6-finishing-touches.md",
"parent": "plugin-sidebar-0"
Expand All @@ -336,19 +336,19 @@
"parent": "tutorials"
},
{
"title": "Register a new format",
"title": "Register a New Format",
"slug": "1-register-format",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/format-api/1-register-format.md",
"parent": "format-api"
},
{
"title": "Add a button to the toolbar",
"title": "Add a Button to the Toolbar",
"slug": "2-toolbar-button",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/format-api/2-toolbar-button.md",
"parent": "format-api"
},
{
"title": "Apply the format when the button is clicked",
"title": "Apply the Format When the Button Is Clicked",
"slug": "3-apply-format",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/format-api/3-apply-format.md",
"parent": "format-api"
Expand Down

0 comments on commit 31a8581

Please sign in to comment.