Skip to content

Commit d4c7049

Browse files
authored
Lint Markdown (api-platform#1264)
1 parent 78b7082 commit d4c7049

Some content is hidden

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

59 files changed

+853
-566
lines changed

.github/workflows/cd.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches:
66
- main
77
- '*.*'
8-
- ci/github-actions
98

109
jobs:
1110
deploy:

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
uses: github/super-linter@v3
2020
env:
2121
VALIDATE_ALL_CODEBASE: false
22-
DEFAULT_BRANCH: main
22+
VALIDATE_EDITORCONFIG: false
23+
VALIDATE_JSCPD: false
24+
DEFAULT_BRANCH: 2.6
2325
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2426

2527
- uses: actions/cache@v2

.markdownlint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MD013:
2+
line_length: 400
3+
no-inline-html:
4+
allowed_elements: [a, p, img, br]

admin/components.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
### AdminGuesser
66

7-
`<AdminGuesser>` creates a complete Admin Context and Interface, rendering automatically an [`<AdminUI>` component](https://marmelab.com/react-admin/Admin.html#unplugging-the-admin-using-admincontext-and-adminui) for resources exposed by a web API documented with any format supported by `@api-platform/api-doc-parser` (for Hydra documented APIs, use the [`<HydraAdmin>`component](admin/components.md#hydraadmin) instead). It also creates a [`schemaAnalyzer`](admin/components.md#schemaAnalyzer) context, where the schemaAnalyzer service (for getting information about the provided API documentation) is stored.
7+
`<AdminGuesser>` creates a complete Admin Context and Interface, rendering automatically an [`<AdminUI>` component](https://marmelab.com/react-admin/Admin.html#unplugging-the-admin-using-admincontext-and-adminui) for resources exposed by a web API documented with any format supported by `@api-platform/api-doc-parser` (for Hydra documented APIs,
8+
use the [`<HydraAdmin>`component](admin/components.md#hydraadmin) instead). It also creates a [`schemaAnalyzer`](admin/components.md#schemaAnalyzer) context, where the schemaAnalyzer service (for getting information about the provided API documentation) is stored.
9+
810
The `<AdminGuesser>` renders all exposed resources by default, but you can choose what resource you want to render by passing [`<ResourceGuesser>` components](admin/components/#resourceguesser) as children.
911
Deprecated resources are hidden by default, but you can add them back using an explicit `<ResourceGuesser>` component.
1012

@@ -30,7 +32,8 @@ const App = () => (
3032
export default App;
3133
```
3234

33-
**Props**
35+
#### Props
36+
3437
| Name | Type | Value | required | Description |
3538
|-------------------|--------------------|----------------|----------|----------------------------------------------------------------------------------|
3639
| dataProvider | object or function | - | yes | communicates with your API |
@@ -41,7 +44,8 @@ export default App;
4144

4245
### ResourceGuesser
4346

44-
Based on React-Admin's [`<Resource>` component](https://marmelab.com/react-admin/Resource.html), the ResourceGuesser provides default props [`<CreateGuesser>`](admin/components.md#createguesser), [`<ListGuesser>`](admin/components.md#listguesser), [`<EditGuesser>`](admin/components.md#editguesser) and [`<ShowGuesser>`](admin/components.md#showguesser). Otherwise you can pass it your own CRUD components using `create`, `list`, `edit`, `show` props.
47+
Based on React-Admin's [`<Resource>` component](https://marmelab.com/react-admin/Resource.html), the ResourceGuesser provides default props [`<CreateGuesser>`](admin/components.md#createguesser), [`<ListGuesser>`](admin/components.md#listguesser), [`<EditGuesser>`](admin/components.md#editguesser) and [`<ShowGuesser>`](admin/components.md#showguesser).
48+
Otherwise you can pass it your own CRUD components using `create`, `list`, `edit`, `show` props.
4549

4650
```javascript
4751
// App.js
@@ -66,7 +70,8 @@ const App = () => (
6670
export default App;
6771
```
6872

69-
**Props**
73+
#### ResourceGuesser Props
74+
7075
| Name | Type | Value | required | Description |
7176
|------|--------|-------|----------|--------------------------|
7277
| name | string | - | yes | endpoint of the resource |
@@ -77,8 +82,11 @@ You can also use props accepted by React-Admin's [`<Resource>` component](https:
7782

7883
### ListGuesser
7984

80-
Based on React-Admin's [`<List>`](https://marmelab.com/react-admin/List.html), ListGuesser displays a list of resources in a [`<Datagrid>`](https://marmelab.com/react-admin/List.html#the-datagrid-component), according to children passed to it (usually [`<FieldGuesser>`](admin/components/#fieldguesser) or any [`field` component](https://marmelab.com/react-admin/Fields.html#basic-fields) available in React-Admin).
85+
Based on React-Admin's [`<List>`](https://marmelab.com/react-admin/List.html), ListGuesser displays a list of resources in a [`<Datagrid>`](https://marmelab.com/react-admin/List.html#the-datagrid-component), according to children passed to it (usually [`<FieldGuesser>`](admin/components/#fieldguesser) or any [`field` component](https://marmelab.com/react-admin/Fields.html#basic-fields)
86+
available in React-Admin).
87+
8188
Use `hasShow` and `hasEdit` props if you want to display `show` and `edit` buttons (both set to `true` by default).
89+
8290
By default, `<ListGuesser>` comes with [`<Pagination>`](admin/components.md#pagination).
8391

8492
```javascript
@@ -96,14 +104,15 @@ export const BooksList = props => (
96104
</ListGuesser>
97105
);
98106
```
99-
**Props**
107+
108+
#### ListGuesser Props
109+
100110
| Name | Type | Value | required | Description |
101111
|----------|------------------|-------|----------|-----------------------------------------|
102112
| children | node or function | - | no | - |
103113
| resource | string | - | yes | endpoint of the resource |
104114
| filters | element | - | no | filters that can be applied to the list |
105115

106-
107116
You can also use props accepted by React-Admin's [`<List>`](https://marmelab.com/react-admin/List.html).
108117

109118
### CreateGuesser
@@ -126,7 +135,8 @@ export const BooksCreate = props => (
126135
);
127136
```
128137

129-
**Props**
138+
#### CreateGuesser Props
139+
130140
| Name | Type | Value | required | Description |
131141
| Name | Type | Value | required | Description |
132142
|----------|------------------|-------|----------|--------------------------|
@@ -155,7 +165,8 @@ export const BooksEdit = props => (
155165
);
156166
```
157167

158-
**Props**
168+
#### EditGuesser Props
169+
159170
| Name | Type | Value | required | Description |
160171
|----------|------------------|-------|----------|--------------------------|
161172
| children | node or function | - | no | - |
@@ -182,7 +193,8 @@ export const BooksShow = props => (
182193
);
183194
```
184195

185-
**Props**
196+
#### ShowGuesser Props
197+
186198
| Name | Type | Value | required | Description |
187199
|----------|------------------|-------|----------|--------------------------|
188200
| children | node or function | - | no | - |
@@ -214,7 +226,8 @@ const App = () => (
214226
export default App;
215227
```
216228

217-
**Props**
229+
#### HydraAdmin Props
230+
218231
| Name | Type | Value | required | Description |
219232
|------------|--------|-------|----------|-----------------------|
220233
| entrypoint | string | - | yes | entrypoint of the API |
@@ -252,7 +265,9 @@ export const BooksShow = props => (
252265
</ShowGuesser>
253266
)
254267
```
255-
**Props**
268+
269+
#### FieldGuesser Props
270+
256271
| Name | Type | Value | required | Description |
257272
|--------|--------|-------|----------|--------------------------|
258273
| source | string | - | yes | endpoint of the resource |
@@ -263,7 +278,8 @@ You can also use props accepted by React-Admin's [`Basic Fields`](https://marmel
263278

264279
Uses React-Admin's [`<ReferenceInput>`](https://marmelab.com/react-admin/Inputs.html#referenceinput) to generate inputs according to your API documentation (e.g. number HTML input for numbers, checkbox for booleans, selectbox for relationships...)
265280

266-
**Props**
281+
#### InputGuesser Props
282+
267283
| Name | Type | Value | required | Description |
268284
|--------|--------|-------|----------|--------------------------|
269285
| source | string | - | yes | endpoint of the resource |

admin/customizing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,4 @@ For instance, using an autocomplete input is straightforward, [checkout the dedi
185185
API Platform is built on top of [React Admin](https://marmelab.com/react-admin/).
186186
You can use all the features provided by the underlying library with API Platform Admin, including support for [file upload](https://marmelab.com/react-admin/DataProviders.html#decorating-your-data-provider-example-of-file-upload), [authentication](https://marmelab.com/react-admin/Authentication.html), [authorization](https://marmelab.com/react-admin/Authorization.html) and deeper customization.
187187

188-
To learn more about these capabilities, refer to [the React Admin documentation](https://marmelab.com/react-admin/).
188+
To learn more about these capabilities, refer to [the React Admin documentation](https://marmelab.com/react-admin/).

admin/getting-started.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ Otherwise, all you need to install API Platform Admin is a JavaScript package ma
88

99
If you don't have an existing React Application, create one using [Create React App](https://create-react-app.dev/):
1010

11-
$ yarn create react-app my-admin
11+
```console
12+
yarn create react-app my-admin
13+
```
1214

1315
Go to the directory of your project:
1416

15-
$ cd my-admin
17+
```console
18+
cd my-admin
19+
```
1620

1721
Finally, install the `@api-platform/admin` library:
1822

19-
$ yarn add @api-platform/admin
23+
```console
24+
yarn add @api-platform/admin
25+
```
2026

2127
## Creating the Admin
2228

@@ -59,7 +65,10 @@ nelmio_cors:
5965
6066
Clear the cache to apply this change:
6167
62-
$ docker-compose exec php bin/console cache:clear --env=prod
68+
```console
69+
docker-compose exec php \
70+
bin/console cache:clear --env=prod
71+
```
6372

6473
Your new administration interface is ready! Type `yarn start` to try it!
6574

admin/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ API Platform Admin is a tool to automatically create a beautiful and fully featu
66
for any API supporting [the Hydra Core Vocabulary](http://www.hydra-cg.com/) or other API specification formats supported by [`@api-platform/api-doc-parser`](https://github.com/api-platform/api-doc-parser) (experimental support for [OpenAPI](https://www.openapis.org/) is also available).
77

88
API Platform Admin is the perfect companion of APIs created
9-
using [the API Platform framework](https://api-platform.com), but also supports APIs written with any other programming language or framework as long as they expose a standard Hydra API documentation.
9+
using [the API Platform framework](https://api-platform.com), but also supports APIs written with any other programming language or framework as long as they expose a standard Hydra API documentation.
1010

1111
API Platform Admin is a 100% standalone Single-Page-Application with no coupling to the server part,
1212
according to the API-first paradigm.
@@ -21,7 +21,7 @@ You can **customize everything** by using provided React Admin and [Material UI
2121
* Automatically generates an admin interface for all the resources of the API thanks to hypermedia features of Hydra
2222
* Generates 'list', 'create', 'show', and 'edit' screens, as well as a delete button
2323
* Generates suitable inputs and fields according to the API doc (e.g. number HTML input for numbers, checkbox for booleans, selectbox for relationships...)
24-
* Generates suitable inputs and fields according to Schema.org types if available (e.g. email field for http://schema.org/email)
24+
* Generates suitable inputs and fields according to Schema.org types if available (e.g. email field for `http://schema.org/email`)
2525
* Handles relationships
2626
* Supports pagination
2727
* Supports filters and ordering

client-generator/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Client Generator is the fastest way to scaffold fully featured webapps and nativ
44

55
![Screencast](images/client-generator-demo.gif)
66

7-
*Generated React and React Native apps, updated in real time*
7+
## Generated React and React Native Apps, Updated in Real Time
88

99
It is able to generate apps using the following frontend stacks:
1010

client-generator/nextjs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Create a [Next.js application with express server](https://github.com/zeit/next.
1818

1919
Enable TypeScript in your next project
2020

21-
$ yarn add --dev typescript @types/react @types/node
21+
yarn add --dev typescript @types/react @types/node
2222

2323
Install required dependencies:
2424

25-
$ yarn add lodash.get lodash.has @types/lodash isomorphic-unfetch formik
25+
yarn add lodash.get lodash.has @types/lodash isomorphic-unfetch formik
2626

2727
## Generating Routes
2828

@@ -35,7 +35,7 @@ Install required dependencies:
3535

3636
You can launch the server with
3737

38-
$ yarn dev
38+
yarn dev
3939

4040
Go to `http://localhost:3000/books/` to start using your app.
4141

client-generator/nuxtjs.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ The Nuxt.js Client Generator generates components for Server Side Rendered appli
88

99
Create a [Nuxt.js application](https://nuxtjs.org/guides/get-started/installation#using-create-nuxt-app). The easiest way is to execute:
1010

11-
$ npx create-nuxt-app your-app-name
12-
# or
13-
$ yarn create nuxt-app your-app-name
11+
```console
12+
npx create-nuxt-app your-app-name
13+
```
1414

15-
It will ask you some questions you can use these answers :
15+
or:
1616

17+
```console
18+
yarn create nuxt-app your-app-name
1719
```
20+
21+
It will ask you some questions you can use these answers :
22+
23+
```console
1824
Project name: your-app-name
1925
Programming language: JavaScript
2026
Package manager: Yarn
@@ -30,8 +36,10 @@ Deployment target: Static (Static/JAMStack hosting)
3036

3137
Install required dependencies:
3238

33-
$ yarn add moment lodash vue-i18n vuelidate vuex-map-fields nuxt-i18n
34-
# yarn add --dev @nuxtjs/vuetify @nuxtjs/fontawesome
39+
```console
40+
yarn add moment lodash vue-i18n vuelidate vuex-map-fields nuxt-i18n
41+
yarn add --dev @nuxtjs/vuetify @nuxtjs/fontawesome
42+
```
3543

3644
## Updating nuxtjs config
3745

@@ -48,19 +56,22 @@ Update your `nuxt.config.js` with following:
4856
// to avoid name conflicts in generators
4957
components: false,
5058
```
59+
5160
## Generating Routes
5261

53-
$ npx @api-platform/client-generator https://demo.api-platform.com . --generator nuxt
54-
# Replace the URL by the entrypoint of your Hydra-enabled API
62+
```console
63+
npx @api-platform/client-generator https://demo.api-platform.com . --generator nuxt
64+
```
5565

56-
> Note: Omit the resource flag to generate files for all resource types exposed by the API.
66+
Replace the URL by the entrypoint of your Hydra-enabled API
5767

58-
## Updating default layout
68+
**Note:** Omit the resource flag to generate files for all resource types exposed by the API.
5969

70+
## Updating default layout
6071

6172
Update your `layouts/default.vue` with following:
6273

63-
```javascript
74+
```vue
6475
<template>
6576
<v-app>
6677
<alert />
@@ -132,9 +143,11 @@ export default {
132143

133144
## Starting the Project
134145

135-
You can launch the server with
146+
You can launch the server with:
136147

137-
$ yarn dev
148+
```console
149+
yarn dev
150+
````
138151

139152
Go to `https://localhost:3000/books/` to start using your app.
140153

0 commit comments

Comments
 (0)