@@ -5,37 +5,35 @@ Thanks for taking the time to contribute! :smile:
5
5
## Table of Contents
6
6
7
7
- [ Contributing to Cypress Documentation] ( #contributing-to-cypress-documentation )
8
- - [ Table of Contents] ( #table-of-contents )
9
8
- [ Code of Conduct] ( #code-of-conduct )
10
9
- [ Writing Documentation] ( #writing-documentation )
11
10
- [ Using Vue Components] ( #using-vue-components )
12
11
- [ Alerts] ( #alerts )
13
- - [ Images] ( #images )
14
- - [ Videos] ( #videos )
15
- - [ Icons] ( #icons )
12
+ - [ Images] ( #images )
13
+ - [ Videos] ( #videos )
14
+ - [ Icons] ( #icons )
16
15
- [ Partials] ( #partials )
17
16
- [ Writing a Partial] ( #writing-a-partial )
18
17
- [ Using Partials] ( #using-partials )
19
- - [ When to use Partials instead of Vue components] ( #when-to-use-partials-instead-of-vue-components )
20
18
- [ Limitations] ( #limitations )
19
+ - [ When to use Partials instead of Vue components] ( #when-to-use-partials-instead-of-vue-components )
21
20
- [ Adding Examples] ( #adding-examples )
22
21
- [ Adding Plugins] ( #adding-plugins )
23
22
- [ Adding Pages] ( #adding-pages )
24
- - [ Deleting Pages] ( #deleting-pages )
25
23
- [ A Worked Example] ( #a-worked-example )
26
- - [ Writing the Changelog] ( #writing-the-changelog )
27
- - [ Categories] ( #categories )
24
+ - [ Deleting Pages] ( #deleting-pages )
28
25
- [ Committing Code] ( #committing-code )
29
- - [ Linting] ( #linting )
30
26
- [ Pull Requests] ( #pull-requests )
27
+ - [ Writing the Changelog] ( #writing-the-changelog )
28
+ - [ Categories] ( #categories )
31
29
- [ Contributor License Agreement] ( #contributor-license-agreement )
32
30
- [ Deployment] ( #deployment )
33
31
- [ Trigger workflow build] ( #trigger-workflow-build )
34
32
35
33
## Code of Conduct
36
34
37
35
All contributors are expected to abide by our
38
- [ Code of Conduct] ( https://github.com/cypress-io/cypress/wiki/code-of-conduct ) .
36
+ [ Code of Conduct] ( https://github.com/cypress-io/cypress/blob/develop/CODE_OF_CONDUCT.md ) .
39
37
40
38
## Writing Documentation
41
39
@@ -75,7 +73,7 @@ prop to `info`, `tip`, `warning`, or `danger`.
75
73
< Alert type= " info" > This is an important message.< / Alert>
76
74
```
77
75
78
- ### Images
76
+ #### Images
79
77
80
78
If you are starting a new page and want to add images, add a new folder to
81
79
[ ` assets/img ` ] ( /assets/img ) . For example when adding a new "Code Coverage" page
@@ -94,7 +92,7 @@ include the image using the
94
92
Typically you should include the ` alt ` and ` title ` attributes to give the user
95
93
more information about the image.
96
94
97
- ### Videos
95
+ #### Videos
98
96
99
97
You can embed videos within the markdown with the
100
98
[ ` <DocsVideo> ` ] ( /components/global/DocsVideo.vue ) component. Currently, it
@@ -110,10 +108,11 @@ accessibility reasons.
110
108
>
111
109
```
112
110
113
- ### Icons
111
+ #### Icons
114
112
115
- [ Font Awesome] ( https://fontawesome.com/ ) icons can be used within markdown. Set
116
- the ` name ` prop to the name of the Font Awesome icon. Make sure that the icon
113
+ [ Font Awesome] ( https://fontawesome.com/ ) icons can be used within markdown by
114
+ using the [ ` <Icon> ` ] ( /components/global/Icon.vue ) component. Set the ` name ` prop
115
+ to the name of the Font Awesome icon you want to use. Make sure that the icon
117
116
appears in the list of imported icons within the ` nuxt.config.js ` file under the
118
117
` fontawesome ` key.
119
118
@@ -165,7 +164,17 @@ within the `content` directory. You must provide the path relative to the
165
164
` pizza-recipe.md ` was located at ` /content/recipes/pizza-recipe.md ` , the
166
165
` ::include ` directive would be ` ::include{file=recipes/pizza-recipe.md} ` .
167
166
168
- #### When to use Partials instead of Vue components
167
+ #### Limitations
168
+
169
+ When including the ` ::include{file=FILE_NAME} ` directive in another markdown
170
+ file, Nuxt's hot module reloading will automatically trigger the partial's
171
+ content to be inserted into the markdown file. However, if you wish to make
172
+ changes to the partial file itself, you will need to stop and restart the
173
+ development server with ` yarn start ` to see the changes. This is because the
174
+ custom remark plugin that is enabling this partial system is only ran when the
175
+ server is started and not on each hot module reload.
176
+
177
+ ### When to use Partials instead of Vue components
169
178
170
179
It is possible to create partials using Vue components in the markdown instead
171
180
of using the ` ::include{file=FILE_NAME} ` directive. However, there are downsides
@@ -184,16 +193,6 @@ when you want to inject reusable markdown into multiple files. A `<Partial>` Vue
184
193
component may be a better fit if you wish to add custom interactivity to
185
194
reusable strings of text.
186
195
187
- #### Limitations
188
-
189
- When including the ` ::include{file=FILE_NAME} ` directive in another markdown
190
- file, Nuxt's hot module reloading will automatically trigger the partial's
191
- content to be inserted into the markdown file. However, if you wish to make
192
- changes to the partial file itself, you will need to stop and restart the
193
- development server with ` yarn start ` to see the changes. This is because the
194
- custom remark plugin that is enabling this partial system is only ran when the
195
- server is started and not on each hot module reload.
196
-
197
196
### Adding Examples
198
197
199
198
To add a course, blog, talk, podcast, or screencast to our docs, submit a
@@ -240,12 +239,13 @@ Each plugin submitted to the plugins list should have the following:
240
239
241
240
### Adding Pages
242
241
243
- To add a page such as a new guide or API documentation:
242
+ To add a page, such as a new guide or API documentation:
244
243
245
244
- Add the new page to the relevant directory under [ ` content ` ] ( /content ) .
246
245
- Link to your new page in the [ ` sidebar.json ` ] ( /content/_data/sidebar.json ) .
247
- - Add translations for the sidebar link for each supported language (for
248
- English, this is located in [ ` en.json ` ] ( /content/_data/en.json ) ).
246
+ - Add translations for the sidebar link for each supported language. Currently
247
+ only English is supported and this is located in
248
+ [ ` en.json ` ] ( /content/_data/en.json ) ).
249
249
- Build the documentation site locally so that you can visually inspect your new
250
250
page and the links to it.
251
251
- ** REQUIRED** : Commit the new file using git - we auto-generate the doc to
@@ -265,18 +265,6 @@ To add a page such as a new guide or API documentation:
265
265
> specific layout I want to create. The page will then be accessible at the
266
266
> route ` /guides/my-dashboard-guide ` .
267
267
268
- ### Deleting Pages
269
-
270
- To delete a page:
271
-
272
- - Delete the page from the relevant directory under [ ` content ` ] ( /content ) .
273
- - Remove the link from the the [ ` sidebar.json ` ] ( /content/_data/sidebar.json ) .
274
- - ** REQUIRED** : Commit the change using git - we auto-remove the doc within each
275
- supported language, this auto-generation depends on the file being deleted in
276
- git, the build will not work until this is commited.
277
- - Build the documentation site locally so that you can visually inspect and make
278
- sure it was properly deleted.
279
-
280
268
#### A Worked Example
281
269
282
270
Let's imagine that the Cypress team has just added a new command called
@@ -289,10 +277,10 @@ API documentation for commands is in the
289
277
2 . Write the document. Look to the existing documentation to see how to
290
278
structure the content.
291
279
3 . Open the [ ` content/_data/sidebar.json ` ] ( /content/_data/sidebar.json ) file and
292
- add a link the new ` privatestate ` page. In this example we're adding a
293
- command so we'll add a link underneath the ` api ` section.
280
+ add a link the new ` privatestate ` page. In this example, we're adding a
281
+ command, so we'll add a link underneath the ` api ` section.
294
282
295
- ``` json
283
+ ``` diff
296
284
"api": [
297
285
{
298
286
"title": "API",
@@ -311,10 +299,10 @@ API documentation for commands is in the
311
299
"slug": "as"
312
300
},
313
301
// ...
314
- {
315
- "title" : " privateState" ,
316
- "slug" : " privatestate"
317
- }
302
+ + {
303
+ + "title": "privateState",
304
+ + "slug": "privatestate"
305
+ + }
318
306
]
319
307
}
320
308
]
@@ -374,46 +362,33 @@ a menu structure up to three (3) levels deep:
374
362
]
375
363
```
376
364
377
- 4 . Submit a [ pull request] ( #Pull-Requests ) for your change.
378
-
379
- ### Writing the Changelog
380
-
381
- When adding to the Changelog, create a new file in
382
- [ ` content/_changelogs ` ] ( /content/_changelogs ) named as the version number. Be
383
- sure to follow the category structure defined below (in this order). Each bullet
384
- point in the list should _ always_ be associated to an issue on the
385
- [ ` cypress ` ] ( https://github.com/cypress-io/cypress ) repo and link to that issue
386
- (except for Documentation changes).
365
+ ### Deleting Pages
387
366
388
- #### Categories
367
+ To delete a page:
389
368
390
- - ** Summary** - If it is a large release, you may write a summary explaining
391
- what the point of this release is (mostly used for breaking releases)
392
- - ** Breaking Changes** - The users current implementation of Cypress may break
393
- after updating.
394
- - ** Deprecations** - Features have been deprecated, but will not break after
395
- updating.
396
- - ** Features** - A new feature
397
- - ** Bugfixes** - A bug existed in Cypress and a PR fixed the issue
398
- - ** Misc** - Not a feature or bugfix, but work that was done. May be internal
399
- work that was done and associated with an issue
400
- - ** Documentation Changes** - our docs were updated based on behavior changes in
401
- release
369
+ - Delete the page from the relevant directory under [ ` content ` ] ( /content ) .
370
+ - Remove the link from the the [ ` sidebar.json ` ] ( /content/_data/sidebar.json ) .
371
+ - ** REQUIRED** : Commit the change using git - we auto-remove the doc within each
372
+ supported language, this auto-generation depends on the file being deleted in
373
+ git, the build will not work until this is commited.
374
+ - Build the documentation site locally so that you can visually inspect and make
375
+ sure it was properly deleted.
402
376
403
377
## Committing Code
404
378
405
- ### Linting
406
-
407
- Javascript code is linted with [ ESLint] ( https://eslint.org/ ) .
408
-
409
379
### Pull Requests
410
380
411
381
You should push your local changes to your forked GitHub repository and then
412
382
open a pull request (PR) from your repo to the
413
383
` cypress-io/cypress-documentation ` repo.
414
384
415
- - The PR should be from your repository to the ` master ` branch in
416
- ` cypress-io/cypress-documentation `
385
+ - The PR should be from your repository to the appropriate branch in the
386
+ ` cypress-io/cypress-documentation ` repository.
387
+ - For documation changes that are not tied to a feature release, open a PRs
388
+ against the ` master ` branch.
389
+ - For documentation additions for unreleased features, open a PR against the
390
+ corrsponding ` X.Y.Z-release ` branch. Once the release it performed, this
391
+ branch will be merged into master by the releaser.
417
392
- When opening a PR for a specific issue already open, please use the
418
393
` closes #issueNumber ` syntax in the pull request description&mdash ; for
419
394
example, ` closes #138 ` &mdash ; so that the issue will be
@@ -436,6 +411,30 @@ open a pull request (PR) from your repo to the
436
411
git branch name. For example, if my branch was named ` my-branch ` , my branch
437
412
preview will be available at ` https://my-branch--cypress-docs.netlify.app ` .
438
413
414
+ ### Writing the Changelog
415
+
416
+ When adding to the Changelog, create a new file in
417
+ [ ` content/_changelogs ` ] ( /content/_changelogs ) named as the version number. Be
418
+ sure to follow the category structure defined below (in this order). Each bullet
419
+ point in the list should _ always_ be associated to an issue on the
420
+ [ ` cypress ` ] ( https://github.com/cypress-io/cypress ) repo and link to that issue
421
+ (except for Documentation changes).
422
+
423
+ #### Categories
424
+
425
+ - ** Summary** - If it is a large release, you may write a summary explaining
426
+ what the point of this release is (mostly used for breaking releases)
427
+ - ** Breaking Changes** - The users current implementation of Cypress may break
428
+ after updating.
429
+ - ** Deprecations** - Features have been deprecated, but will not break after
430
+ updating.
431
+ - ** Features** - A new feature
432
+ - ** Bugfixes** - A bug existed in Cypress and a PR fixed the issue
433
+ - ** Misc** - Not a feature or bugfix, but work that was done. May be internal
434
+ work that was done and associated with an issue
435
+ - ** Documentation Changes** - our docs were updated based on behavior changes in
436
+ release
437
+
439
438
### Contributor License Agreement
440
439
441
440
We use a [ ` cla-assistant.io ` ] ( https://cla-assistant.io/ ) web hook to make sure
0 commit comments