Skip to content

Commit fca829f

Browse files
author
Mario Borna Mjertan
committed
Improve writing style in Basics articles
1 parent cf4ee85 commit fca829f

File tree

9 files changed

+50
-47
lines changed

9 files changed

+50
-47
lines changed

website/docs/basics/browser-sync.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: browser-sync
3-
title: Browser Sync
3+
title: Browsersync
44
---
55

66
[![docs-source](https://img.shields.io/badge/source-eightshift--frontend--libs-yellow?style=for-the-badge&logo=javascript&labelColor=2a2a2a)](https://github.com/infinum/eightshift-frontend-libs)
@@ -10,7 +10,7 @@ title: Browser Sync
1010

1111
Besides that, you can test your site on various devices on the same network.
1212

13-
If comes with the boilerplate by default. When you run:
13+
It's part of the Eightshift Development Kit by default. When you run:
1414

1515
```bash
1616
npm start
@@ -34,7 +34,7 @@ Using the IP address, you can open it on any device (mobile phone or tablet) tha
3434

3535
## Using SSL for local development
3636

37-
By default BrowserSync does not work with https urls but if you use HTTPS in your local environment you can simply provide additional key to the Webpack config to make it work.
37+
By default, BrowserSync does not work with HTTPS URLs. If you use HTTPS in your local environment you can simply provide an additional key in the Webpack config to make it work.
3838

3939
```js
4040
module.exports = (env, argv) => {

website/docs/basics/dynamic-import.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,33 @@ title: Dynamic Import
55

66
[![docs-source](https://img.shields.io/badge/source-eightshift--frontend--libs-yellow?style=for-the-badge&logo=javascript&labelColor=2a2a2a)](https://github.com/infinum/eightshift-frontend-libs)
77

8-
When writing all our JavaScript code we like to make it as fast and optimized as possible and there is no better way of doing that other than utilizing one powerful tool from Webpack called [dynamic imports](https://webpack.js.org/guides/code-splitting/#dynamic-imports).
8+
As JavaScript code runs on the visitor's device, it's crucial that it's as fast and optimized as possible. A powerful tool from Webpack called [dynamic imports](https://webpack.js.org/guides/code-splitting/#dynamic-imports) helps with that.
99

10-
This method provides us the ability to write all our JavaScript code but load them in the DOM only when it is used, basically, this is what all JavaScript libraries use out of the box.
10+
Dynamic imports provide us the ability to load our JavaScript code only when it's used.
1111

12-
By writing all our JavaScript code like this we can:
13-
* optimize loading time.
14-
* reduce the size of finished bundled JavaScript code.
15-
* have websites that are fast and this can positively impact your Seo rating.
12+
By writing all JavaScript code using dynamic imports, we can reap significant benefits:
13+
* optimize loading time
14+
* reduce the size of finished bundled JavaScript code
15+
* have websites that are fast, which can positively impact your SEO rating
1616

1717
## How does it work?
1818

19-
In a nutshell, you load all your code using JavaScript promises and Webpack splits all these promises into separate file chinks. Once the condition to resolve the promise is set (generally we check if the selector is present in the DOM), Webpack automatically injects your chunk in the DOM and loads it up. This is why you will see in your public folder a bunch of smaller files called (`0.js`, `1.js`, `2.js`, etc).
19+
In a nutshell, you load all your code using JavaScript promises. Webpack splits all these promises into separate file chunks. Once the condition to resolve the promise is set (generally, if a selector is present in the DOM), Webpack automatically injects your chunk in the DOM and loads it up. This is why you will see a bunch of smaller files (`0.js`, `1.js`, `2.js`, etc) in your public folder instead of a single large file.
2020

2121
You don't need to think about this. Webpack just does it for you.
2222

2323
## Example
2424

25-
For example, let's make a carousel. We like to write all our JavaScript code in classes so we will provide an example for that but you can use this with functions as well.
25+
For example, let's make a carousel. An Eightshift convention is to write JavaScript code using classes, so we'll provide an example for that. However, you can use this approach with functions as well.
2626

27-
**We have to files:**
27+
**We have two files:**
2828
* **index.js** - the main entry point for your JavaScript feature.
2929
* **className.js** - class with your JavaScript features that you can reuse.
3030

3131

3232
### index.js
3333

34-
This is a version where you have multiple instances of this feature on one page. If you are creating a feature for your block/component you will use the following example.
34+
This is a version where you have multiple instances of a feature on one page. If you are creating a feature for your block/component, you'll use something along these lines.
3535

3636
```js
3737
import domReady from '@wordpress/dom-ready';
@@ -44,7 +44,7 @@ domReady(() => {
4444
const selector = `.${blockJsClass}`;
4545
const elements = document.querySelectorAll(selector);
4646

47-
// This is the important part because if this condition is true this promise will resolve and your chink will be loaded in the DOM.
47+
// This is the important part - if this condition is true, this promise will resolve and your chunk will be loaded in the DOM.
4848
if (!elements.length) {
4949
return;
5050
}
@@ -66,7 +66,7 @@ domReady(() => {
6666
});
6767
```
6868

69-
If you are sure you will have only one instance of this feature on one-page use the following code in your `index.js` file.
69+
If you are sure you will have only one instance of this feature on one-page, you can use the following code in your `index.js` file.
7070

7171
```js
7272
import domReady from '@wordpress/dom-ready';

website/docs/basics/fonts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ title: Fonts
88
Fonts can be added to your project in multiple ways, depending on your project's needs. In general, if you can use fonts from an external source like Google Fonts, use that approach because the fonts are loaded smartly. On the other hand, if you have fonts that are added to your project, below are the steps to follow to make them available in the project.
99

1010
* Put your font files in this folder: `assets/fonts`.
11-
* Import each file in the `assets/fonts/index.js` so that the Webpack knows how to process these files in its build process.
11+
* Import each file in the `assets/fonts/index.js` so that Webpack knows how to process these files in its build process.
1212
* In your project, load the font family using font-face [method](/eightshift-docs/sass). We recommend that you create a new file `assets/styles/parts/utils/_defaults.scss` and put everything in that file.

website/docs/basics/library.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
---
22
id: library
3-
title: Library
3+
title: SCSS Library
44
---
55

66
[![docs-source](https://img.shields.io/badge/source-eightshift--frontend--libs-yellow?style=for-the-badge&logo=javascript&labelColor=2a2a2a)](https://github.com/infinum/eightshift-frontend-libs)
77

8+
Eightshift Frontend Libs contains a collection of useful SCSS mixins, functions and helpers you can use in projects.
89

9-
For years, we have collected a list of useful SASS mixins, functions, and other stuff you can use in a project. At one point, we felt stupid for copy/pasting code across multiple projects, so we created Eightshift Frontend Libs. This library allows you to use whatever we offer without all that unnecessary clutter.
10+
For years, we have collected a list of them. At one point, we felt it was stupid to copy-paste code across multiple projects, so we created Eightshift Frontend Libs. This allows you to use whatever we offer without all that unnecessary clutter.
1011

1112
Check out our documentation and import what you need from Eightshift Frontend Libs.
1213

1314
**Visit [SassDocs](/eightshift-docs/sass) for more details.**
1415

1516
## How to use it
1617

17-
Sass mixing, functions, and helpers are located in Eightshift Frontend Libs. Therefore, if you are using our Webpack build, you are all set. You can use it by importing it into your project like this:
18+
SCSS mixins, functions, and helpers are located in Eightshift Frontend Libs. Therefore, if you are using our Webpack build, you are all set. You can use it by importing it into your project like this:
1819

1920
```scss
2021
@import '@eightshift/frontend-libs/styles/index.scss';
2122
```
2223

23-
But if you used our `wp boilerplate setup_theme` command, you are all set. Eightshift Frontend Libs are injected in the `_shared.scss` file in your project.
24+
However, if you used our `wp boilerplate setup_theme` command, you are all set. Eightshift Frontend Libs are injected in the `_shared.scss` file in your project.

website/docs/basics/manifest.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
---
22
id: manifest
3-
title: Manifest
3+
title: Assets Manifest
44
---
55

66
[![docs-source](https://img.shields.io/badge/source-eightshift--libs-blue?style=for-the-badge&logo=php&labelColor=2a2a2a)](https://github.com/infinum/eightshift-libs)
77

8-
In the build process, Webpack creates all the static files from your assets folder and also `manifest.json` inside the public folder. The manifest file contains a key/value list that we use to call the location of the assets dynamically.
8+
> This `manifest.json` file is generated by Webpack, and is different from the rest of Eightshift manifests described elsewhere in the documentation.
99
10-
This class provides `manifest.json` file location and helpers to return the full path for a specific asset.
10+
In the build process, Webpack creates all the static files from your assets folder and a `manifest.json` file inside the public folder. The manifest file contains a list of key/value pairs that we use to set the location of the assets dynamically.
11+
12+
This class provides the location of the `manifest.json` file and helpers to return the full path for a specific asset.
1113

1214
## How to use it
1315

1416
First, install the manifest class using this command:
1517

1618
`wp boilerplate create_manifest`
1719

18-
You will see a custom filter you can use to fetch the item from the public folder in your class. This is the custom filter:
20+
You will see a custom filter you can use to fetch an item from the public folder in your class. This is the custom filter:
1921

2022
```php
2123
/**
@@ -36,7 +38,7 @@ public function register(): void
3638
}
3739
```
3840

39-
To use this filter, add the following code and provide the correct name of your asset:
41+
To use this filter to fetch asset URLs, add the following code and provide the correct name of your asset:
4042

4143
```php
4244
use CoolProject\Manifest\Manifest;
@@ -52,12 +54,12 @@ If there is no `manifest.json` file or you provided the wrong asset name, there
5254
5355
## Why not just fetch the asset the old-fashioned way?
5456

55-
By the old-fashioned way, we mean running something like this:
57+
By the old-fashioned way, we mean doing something like this:
5658

5759
```php
5860
$logo = get_template_directory_uri() . 'public/logo.svg';
5961
```
6062

61-
You can definitely do this. But with our filter, if you want to change the public folder location or public folder name for some reason, you can change it in one place and you're done.
63+
You can definitely do this. However, using the manifest approach, if you want to change the public folder location or public folder name for some reason, you can change it in one place and you're done.
6264

63-
If you are using the old-fashioned way, you would need to search and replace the whole project and implement the change. There is always a chance you would miss something, break the project, etc.
65+
If you are using the old-fashioned way, you would need to search and replace the whole project and implement the change. There is always a chance you will miss something and somehow break the project.

website/docs/basics/rest-field.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
id: rest-field
3-
title: Rest Field
3+
title: REST Field
44
---
55

66
[![docs-source](https://img.shields.io/badge/source-eightshift--libs-blue?style=for-the-badge&logo=php&labelColor=2a2a2a)](https://github.com/infinum/eightshift-libs)
77

8-
This class is used to update the existing Rest API Field or provide a new field to the existing Rest API.
8+
This class is used to update an existing REST API Field or provide a new field to the existing REST API.
99

10-
To create a new class for extending the Rest API field, run this command:
10+
To create a new class for extending an REST API field, run this command:
1111

1212
`wp boilerplate create_rest_field`
1313

website/docs/basics/rest-route.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
id: rest-route
3-
title: Rest Route
3+
title: REST Route
44
---
55

66
[![docs-source](https://img.shields.io/badge/source-eightshift--libs-blue?style=for-the-badge&logo=php&labelColor=2a2a2a)](https://github.com/infinum/eightshift-libs)
77

8-
This class is used to create a new Rest API route.
8+
This class is used to create a new REST API route.
99

10-
To create a new class for the Rest API route, run this command:
10+
To create a new class for the REST API route, run this command:
1111

1212
`wp boilerplate create_rest_route`
1313

website/docs/basics/rest.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
---
22
id: rest
3-
title: Rest Intro
3+
title: REST Intro
44
---
55

66
[![docs-source](https://img.shields.io/badge/source-eightshift--libs-blue?style=for-the-badge&logo=php&labelColor=2a2a2a)](https://github.com/infinum/eightshift-libs)
77

88

9-
Depending on the type of projects you are working on, you might need to create a new REST API route or add a new API field to the existing route.
9+
Depending on the type of projects you are working on, you might need to create a new REST API route or add a new API field to an existing route.
1010

1111
We have prepared four interfaces and two abstract classes for you.
1212

13-
In general, you will use only what you need from the provided options.
13+
In general, you will only use what you need from the provided options.
1414

1515
### CallableFieldInterface.php
1616

17-
The interface used in Rest API Field for providing callback method.
17+
The interface used in REST API Fields for providing a callback method.
1818

1919
### CallableRouteInterface.php
2020

21-
The interface used in Rest API Route for providing callback method.
21+
The interface used in REST API Routes for providing a callback method.
2222

2323
### RouteSecurityInterface.php
2424

25-
The interface used in Rest API Route for providing authentication methods.
25+
The interface used in REST API Routes for providing authentication methods.
2626

2727
### RouteInterface.php
2828

29-
The interface used in Rest API Route for providing general options for your route like variables for `READABLE`, `CREATABLE`, etc...
29+
The interface used in REST API Routes for providing general options for your route, such as variables for `READABLE`, `CREATABLE`, etc...
3030

3131
### AbstractField.php
3232

33-
Abstract class used in Rest API Field for updating existing fields or providing a new field to the existing Rest API.
33+
Abstract class used in REST API Field for updating existing fields or providing a new field to the existing REST API.
3434

3535
Please check the implementation details in [this example](rest-field).
3636

3737
### AbstractRoute.php
3838

39-
Abstract class used in Rest API Route for adding a new Rest API route.
39+
Abstract class used in REST API Route for adding a new REST API route.
4040

4141
Please check the implementation details in [this example](rest-route).

website/docs/basics/webpack.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ title: Webpack
55

66
[![docs-source](https://img.shields.io/badge/source-eightshift--frontend--libs-yellow?style=for-the-badge&logo=javascript&labelColor=2a2a2a)](https://github.com/infinum/eightshift-frontend-libs)
77

8-
At its core, Webpack is a static module bundler for modern JavaScript applications. When Webpack processes your application, it internally builds a dependency graph that maps every module your project needs and generates one or more bundles. Learn more about Webpack [here](https://webpack.js.org/concepts/).
8+
At its core, Webpack is a static module bundler for modern JavaScript applications. When Webpack processes your application, it builds an internal dependency graph that maps every module your project needs and generates one or more bundles. [Learn more about Webpack](https://webpack.js.org/concepts/).
99

1010
To put it simply, Webpack takes your development files and creates a production-ready version of them based on the config.
1111

12-
Eightshift Boilerplate comes with everything set for you to use out of the box. In the root of your project, you will find a file called `webpack.config.js`. If you open it, you will see that the configuration is pulled from the Eightshift Frontend Libs library.
12+
Eightshift Development Kit comes with everything set up out of the box. In the root of your project, you will find a file called `webpack.config.js`. If you open it, you will see that the configuration is pulled from the Eightshift Frontend Libs library.
1313

1414
You can remove this config and write everything from scratch (keep in mind that this is a lot of work), or you can use our config and extend/remove whatever you need.
1515

1616
## Override built-in functionality
1717

1818
To remove built-in functionality, add a new array to the config called `overrides`.
19-
If you provide any of the `overrides keys`, it will remove that config from the feature from the build.
19+
If you provide any of the `overrides` keys, it will remove that config from the feature from the build.
2020

2121
You can't change our config; you can only remove it and make your own.
2222

@@ -59,7 +59,7 @@ const projectConfig = {
5959
}
6060
```
6161

62-
## Add a new custom functionality
62+
## Add new custom functionality
6363

6464
Let's say you want to add a custom `html-webpack-plugin` to the build. You can simply use all the native [webpack features](https://webpack.js.org/guides/), like in this example:
6565

0 commit comments

Comments
 (0)