Skip to content

Commit 13d6c66

Browse files
SeaJayEmalanpoulain
authored andcommitted
Fixed typos and broken links (#752)
1 parent 25bd64f commit 13d6c66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+324
-327
lines changed

admin/getting-started.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Installation
44

5-
Install the skeleton and the library:
5+
You'll need to install the skeleton and the library.
66

77
Start by installing [the Yarn package manager](https://yarnpkg.com/) ([NPM](https://www.npmjs.com/) is also supported) and
88
the [Create React App](https://facebook.github.io/create-react-app/) tool.
@@ -21,7 +21,7 @@ Finally, install the `@api-platform/admin` library:
2121

2222
## Creating the Admin
2323

24-
Edit the `src/App.js` file like the following:
24+
Edit the `src/App.js` file the following way:
2525

2626
```javascript
2727
import React from 'react';
@@ -62,11 +62,11 @@ Note: if you don't want to hardcode the API URL, you can [use an environment var
6262

6363
## Customizing the Admin
6464

65-
The API Platform's admin parses the Hydra documentation exposed by the API and transforms it to an object data structure. This data structure can be customized to add, remove or customize resources and properties. To do so, we can leverage the `AdminBuilder` component provided by the library. It's a lower level component than the `HydraAdmin` one we used in the previous example. It allows to access to the object storing the structure of admin's screens.
65+
The API Platform's admin parses the Hydra documentation exposed by the API and transforms it to an object data structure. This data structure can be tailored to add, remove or customize resources and properties. To do so, we can leverage the `AdminBuilder` component provided by the library. It's a lower level component than the `HydraAdmin` one we used in the previous example. It allows to access the object storing the structure of admin's screens.
6666

6767
### Using Custom Components
6868

69-
In the following example, we change components used for the `description` property of the `books` resource to ones accepting HTML (respectively `RichTextField` that renders HTML markup and `RichTextInput`, a WYSWYG editor).
69+
In the following example, we change components used for the `description` property of the `books` resource to ones accepting HTML (respectively `RichTextField` that renders HTML markup and `RichTextInput`, a WYSIWYG editor).
7070
(To use the `RichTextInput`, the `ra-input-rich-text` package is must be installed: `yarn add ra-input-rich-text`).
7171

7272
```javascript
@@ -104,7 +104,7 @@ export default (props) => <HydraAdmin apiDocumentationParser={myApiDocumentation
104104
```
105105

106106
The `field` property of the `Field` class allows to set the component used to render a property in list and show screens.
107-
The `input` property allows to set the component to use to render the input used in create and edit screens.
107+
The `input` property allows to set the component used to render the input used in create and edit screens.
108108

109109
Any [field](https://marmelab.com/react-admin/Fields.html) or [input](https://marmelab.com/react-admin/Inputs.html) provided by the React Admin library can be used.
110110

@@ -113,7 +113,7 @@ To go further, take a look to the "[Including react-admin on another React app](
113113
### Managing Files and Images
114114

115115
In the following example, we will:
116-
* find every [ImageObject](http://schema.org/ImageObject) resources. For each [contentUrl](http://schema.org/contentUrl) fields, we will use [ImageField](https://marmelab.com/react-admin/Fields.html#imagefield) as `field` and [ImageInput](https://marmelab.com/react-admin/Inputs.html#imageinput) as `input`.
116+
* find every [ImageObject](http://schema.org/ImageObject) resource. For each [contentUrl](http://schema.org/contentUrl) field, we will use [ImageField](https://marmelab.com/react-admin/Fields.html#imagefield) as `field` and [ImageInput](https://marmelab.com/react-admin/Inputs.html#imageinput) as `input`.
117117
* [ImageInput](https://marmelab.com/react-admin/Inputs.html#imageinput) will return a [File](https://developer.mozilla.org/en/docs/Web/API/File) instance. In this example, we will send a multi-part form data to a special action (`https://demo.api-platform.com/images/upload`). The action will return the ID of the uploaded image. We will "replace" the [File](https://developer.mozilla.org/en/docs/Web/API/File) instance by the ID in `normalizeData`.
118118
* As `contentUrl` fields will return a string, we have to convert Hydra data to React Admin data. This action will be done by `denormalizeData`.
119119

@@ -227,9 +227,9 @@ export default class extends Component {
227227

228228
### Using the Hydra Data Provider Directly with react-admin
229229

230-
By default, the `HydraAdmin` component shipped with API Platform Admin will generate a convenient admin interface for every resources and every properties exposed by the API. But sometimes, you may prefer having full control over the generated admin.
230+
By default, the `HydraAdmin` component shipped with API Platform Admin will generate a convenient admin interface for every resource and every property exposed by the API. But sometimes, you may prefer having full control over the generated admin.
231231

232-
To do so, an alternative approach is [to configure every react-admin components manually](https://marmelab.com/react-admin/Tutorial.html) instead of letting the library generating it, but to still leverage the built-in Hydra [data provider](https://marmelab.com/react-admin/DataProviders.html):
232+
To do so, an alternative approach is [to configure every react-admin component manually](https://marmelab.com/react-admin/Tutorial.html) instead of letting the library generate them, but to still leverage the built-in Hydra [data provider](https://marmelab.com/react-admin/DataProviders.html):
233233

234234
```javascript
235235
// admin/src/App.js

admin/handling-relations-to-collections.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Handling Relations to Collections
22

3-
Considering an API exposing `Person` and `Book` resources linked with a `many-to-many`
4-
relation between them (through the `authors` property).
3+
Let's consider an API exposing `Person` and `Book` resources linked by a `many-to-many`
4+
relation (through the `authors` property).
55

6-
This API using the following PHP code:
6+
This API uses the following PHP code:
77

88
```php
99
<?php
@@ -73,7 +73,7 @@ The admin handles this `to-many` relation automatically!
7373

7474
## Customizing a Property
7575

76-
Let's customize the components used for the `authors` property, to display them by their 'name' instead 'id' (the default behavior).
76+
Let's customize the components used for the `authors` property, to display them by their 'name' instead of their 'id' (the default behavior).
7777

7878
```javascript
7979
import React, { Component } from 'react';
@@ -123,15 +123,15 @@ export default class extends Component {
123123

124124
## Customizing an Icon
125125

126-
Now that our `authors` property is displaying the name instead of an 'id', let's change the icon shown in the list menu.
126+
Now that our `authors` property is displaying the name instead of the 'id', let's change the icon shown in the list menu.
127127

128-
Just add an import statement from `@material-ui` for adding the icon, in this case, a user icon:
128+
Just add an import statement from `@material-ui` for adding the icon - in this case, a user icon:
129129

130130
`import UserIcon from '@material-ui/icons/People';`
131131

132-
and add it to the `authors.icon` property
132+
and add it to the `authors.icon` property.
133133

134-
The code for just customizing the icon will be:
134+
The code for customizing only the icon will be:
135135

136136
```javascript
137137
import React, { Component } from 'react';

admin/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ You can also customize all screens by using React Admin components and even raw
1717

1818
## Features
1919

20-
* Automatically generate an admin interface for all the resources of the API thanks to hypermedia features of Hydra
21-
* Generate list, create, show, edit screens as well as a delete button
22-
* Generate suitable inputs and fields according to the API doc (e.g. number HTML input for numbers, checkbox for booleans, selectbox for relationships...)
23-
* Generate suitable inputs and fields according to Schema.org types if available (e.g. email field for http://schema.org/email)
24-
* Handle relationships
25-
* Pagination support
26-
* Automatically validate if a field is mandatory client-side according to the API description
27-
* Send proper HTTP requests to the API and decode them using Hydra and JSON-LD formats
28-
* Nicely display server-side errors (e.g. advanced validation)
20+
* Automatically generates an admin interface for all the resources of the API thanks to hypermedia features of Hydra
21+
* Generates 'list', 'create', 'show', and 'edit' screens, as well as a delete button
22+
* Generates suitable inputs and fields according to the API doc (e.g. number HTML input for numbers, checkbox for booleans, selectbox for relationships...)
23+
* Generates suitable inputs and fields according to Schema.org types if available (e.g. email field for http://schema.org/email)
24+
* Handles relationships
25+
* Supports pagination
26+
* Automatically validates whether a field is mandatory client-side according to the API description
27+
* Sends proper HTTP requests to the API and decodes them using Hydra and JSON-LD formats
28+
* Nicely displays server-side errors (e.g. advanced validation)
2929
* **100% customizable**

client-generator/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ Client Generator works especially well with APIs built with the [API Platform](h
1616

1717
## Features
1818

19-
* Generate high-quality ES6:
19+
* Generates high-quality ES6:
2020
* list view (with pagination)
2121
* detail view
2222
* creation form
23-
* editation form
23+
* update form
2424
* delete button
2525
* Supports to-one and to-many relations
2626
* Uses the appropriate input type (`number`, `date`...)
2727
* Client-side validation
28-
* Subscribe to data updates pushed by servers supporting [the Mercure protocol](https://mercure.rocks)
29-
* Display server-side validation errors under the related input (if using API Platform Core)
28+
* Subscribes to data updates pushed by servers supporting [the Mercure protocol](https://mercure.rocks)
29+
* Displays server-side validation errors under the related input (if using API Platform Core)
3030
* Integration with [Bootstrap](https://getbootstrap.com/) and [FontAwesome](https://fontawesome.com/) (Progressive Web Apps)
3131
* Integration with [React Native Elements](https://react-native-training.github.io/react-native-elements/)
3232
* Accessible to people with disabilities ([ARIA](https://www.w3.org/WAI/intro/aria) support in webapps)

client-generator/react.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ It contains the React Client Generator, all dependencies it needs, a Progressive
1818
a development Docker container to serve the webapp, and all the API Platform components you may need, including an API server
1919
supporting Hydra.
2020

21-
If you use the API Platform, jump to the next section!
21+
If you use API Platform, jump to the next section!
2222
Alternatively, you can generate a skeleton and install the generator using [npx](https://www.npmjs.com/package/npx).
2323
To use this generator you need [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/) (or [NPM](https://www.npmjs.com/)) installed.
2424

client-generator/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ api_jsonld_context ANY ANY ANY /contexts/{s
1313
specified the documentation URL instead of the entrypoint. For example if you are using API Platform and your
1414
documentation URL is at [https://demo.api-platform.com/docs](https://demo.api-platform.com/docs) the entry point is
1515
likely at [https://demo.api-platform.com](https://demo.api-platform.com). You can see an example of the expected
16-
response from an entrypoint in your browser by clicking visiting
16+
response from an entrypoint in your browser by visiting
1717
[https://demo.api-platform.com/index.jsonld](https://demo.api-platform.com/index.jsonld).
1818

1919
* If you receive `TypeError: Cannot read property '@type' of undefined` or `TypeError: Cannot read property '0'

client-generator/vuejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ In the app directory, generate the files for the resource you want:
3131
# Replace the URL by the entrypoint of your Hydra-enabled API
3232
# Omit the resource flag to generate files for all resource types exposed by the API
3333

34-
The code is ready to be executed! Register the generated routes and store modules in the `main.js` file, here is an example:
34+
The code is ready to be executed! Register the generated routes and store modules in the `main.js` file. Here is an example:
3535

3636
```javascript
3737
import Vue from 'vue'

core/angularjs-integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AngularJS Integration
22

3-
Warning: For new project, you should consider using [the API Platform's Progressive Web App generator](../client-generator/index.md)
3+
Warning: for a new project, you should consider using [the API Platform's Progressive Web App generator](../client-generator/index.md)
44
(that supports React and Vue.js) instead of this Angular v1 integration.
55

66
## Restangular
@@ -97,4 +97,4 @@ admin.addEntity(article);
9797
nga.configure(admin);
9898
```
9999

100-
You can look at what we have done as another example [api-platform/admin](https://github.com/api-platform/admin).
100+
You can look at what we have done on [api-platform/admin](https://github.com/api-platform/admin).

core/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configuration
22

3-
Here's the complete configuration of the Symfony bundle with including default values:
3+
Here's the complete configuration of the Symfony bundle including default values:
44

55
```yaml
66
# api/config/packages/api_platform.yaml

core/content-negotiation.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ By default, only the [JSON-LD](https://json-ld.org) format is enabled. However A
77

88
The framework natively supports JSON-LD, GraphQL, JSONAPI, HAL, raw JSON, XML, YAML and CSV (YAML and CSV support is only available if you use Symfony 3.2+).
99

10-
Both XML and JSON formats are experimental and there are no assurance that we will not break them.
10+
Both XML and JSON formats are experimental and there is no assurance that we will not break them.
1111

1212
API Platform Core will automatically detect the best resolving format depending on:
1313

@@ -28,7 +28,7 @@ Format | Format name |
2828
[CSV](https://tools.ietf.org/html/rfc4180) | `csv` | `text/csv` | no
2929
[HTML](https://whatwg.org/) (API docs) | `html` | `text/html` | no
3030

31-
If the client requested format is not specified (if it's not supported, it will throw an HTTP bad request error), the response format will be the first format defined in the `formats` configuration key (see below).
31+
If the client's requested format is not specified (if it's not supported, it will throw an HTTP bad request error), the response format will be the first format defined in the `formats` configuration key (see below).
3232
An example using the built-in XML support is available in [Behat specs](https://github.com/api-platform/core/blob/master/features/main/content_negotiation.feature).
3333

3434
The API Platform content negotiation system is extendable. Support for other formats can be added by [creating and registering appropriate encoders and, sometimes, normalizers](https://symfony.com/doc/current/serializer.html#adding-normalizers-and-encoders). Adding support for other
@@ -83,8 +83,8 @@ class Book
8383
}
8484
```
8585

86-
In the example above, `xml` or `jsonld` will be allowed and there is no need to specify the mime types as they are already defined in the configuration.
87-
Additionally the `csv` format is added with the mime type `text/csv`.
86+
In the example above, `xml` or `jsonld` will be allowed and there is no need to specify the MIME types as they are already defined in the configuration.
87+
Additionally the `csv` format is added with the MIME type `text/csv`.
8888

8989
It is also important to notice that the usage of this attribute will override the formats defined in the configuration, therefore
9090
this configuration might disable the `json` or the `html` on this resource for example.
@@ -151,17 +151,17 @@ resources:
151151

152152
## Registering a Custom Serializer
153153

154-
If you are adding support for a format not supported by default by API Platform nor by the Symfony Serializer Component,
155-
you need to create custom encoder, decoder and eventually a normalizer and a denormalizer. Refer to the
154+
If you are adding support for a format supported by default neither by API Platform nor by the Symfony Serializer Component,
155+
you need to create a custom encoder, decoder and eventually a normalizer and a denormalizer. Refer to the
156156
Symfony documentation to learn [how to create and register such classes](https://symfony.com/doc/current/cookbook/serializer.html#adding-normalizers-and-encoders).
157157

158158
API Platform Core will automatically call the serializer with your defined format name (`myformat` in previous examples)
159-
as `format` parameter during the deserialization process. Then it will return the result to the client with the asked MIME
159+
as `format` parameter during the deserialization process. It will then return the result to the client with the requested MIME
160160
type using its built-in responder.
161161

162162
## Writing a Custom Normalizer
163163

164-
Using composition is the recommended way to implement a custom normalizer. You can use the following template to start with your
164+
Using composition is the recommended way to implement a custom normalizer. You can use the following template to start your
165165
own implementation of `CustomItemNormalizer`:
166166

167167
```yaml
@@ -220,7 +220,7 @@ final class CustomItemNormalizer implements NormalizerInterface, DenormalizerInt
220220
```
221221

222222
For example if you want to make the `csv` format work for even complex entities with a lot of hierarchy, you have to
223-
flatten or remove too complex relations:
223+
flatten or remove overly complex relations:
224224

225225
```php
226226
<?php

0 commit comments

Comments
 (0)