Skip to content

Commit

Permalink
docs: check that description has an empty line before it (#32830)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman committed Sep 26, 2024
1 parent 6465f0b commit d07f6cf
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
4 changes: 3 additions & 1 deletion docs/src/api/class-androiddevice.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ Launches a process in the shell on the device and returns a socket to communicat

### param: AndroidDevice.open.command
* since: v1.9
- `command` <[string]> Shell command to execute.
- `command` <[string]>

Shell command to execute.

## async method: AndroidDevice.pinchClose
* since: v1.9
Expand Down
8 changes: 6 additions & 2 deletions docs/src/api/class-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -4093,12 +4093,16 @@ await page.GotoAsync("https://www.microsoft.com");
### param: Page.setViewportSize.width
* since: v1.10
* langs: csharp, java
- `width` <[int]> page width in pixels.
- `width` <[int]>

Page width in pixels.

### param: Page.setViewportSize.height
* since: v1.10
* langs: csharp, java
- `height` <[int]> page height in pixels.
- `height` <[int]>

Page height in pixels.

## async method: Page.tap
* since: v1.8
Expand Down
2 changes: 0 additions & 2 deletions docs/src/api/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,6 @@ not recorded. Make sure to call [`method: BrowserContext.close`] for videos to b
* langs: csharp, java, python
- alias-python: record_video_size
- `recordVideoSize` <[Object]>
If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be
scaled down if necessary to fit the specified size.
- `width` <[int]> Video frame width.
- `height` <[int]> Video frame height.

Expand Down
3 changes: 2 additions & 1 deletion docs/src/test-api/class-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,8 @@ Whether to box the step in the report. Defaults to `false`. When the step is box
### option: Test.step.location
* since: v1.48
- `location` <[Location]>
Specifies a custom location for the step to be shown in test reports. By default, location of the [`method: Test.step`] call is shown.

Specifies a custom location for the step to be shown in test reports and trace viewer. By default, location of the [`method: Test.step`] call is shown.

## method: Test.use
* since: v1.10
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16825,7 +16825,7 @@ export interface AndroidDevice {

/**
* Launches a process in the shell on the device and returns a socket to communicate with the launched process.
* @param command
* @param command Shell command to execute.
*/
open(command: string): Promise<AndroidSocket>;

Expand Down
9 changes: 6 additions & 3 deletions utils/doclint/api_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class ApiParser {
if (!name)
throw new Error('Invalid member name ' + spec.text);
if (match[1] === 'param') {
const arg = this.parseProperty(spec);
const arg = this.parseProperty(spec, match[2]);
if (!arg)
return;
arg.name = name;
Expand All @@ -182,7 +182,7 @@ class ApiParser {
}
} else {
// match[1] === 'option'
const p = this.parseProperty(spec);
const p = this.parseProperty(spec, match[2]);
if (!p)
return;
let options = method.argsArray.find(o => o.name === 'options');
Expand All @@ -198,11 +198,14 @@ class ApiParser {

/**
* @param {MarkdownHeaderNode} spec
* @param {string} memberName
* @returns {docs.Member | null}
*/
parseProperty(spec) {
parseProperty(spec, memberName) {
const param = childrenWithoutProperties(spec)[0];
const text = /** @type {string}*/(param.text);
if (text.substring(text.lastIndexOf('>') + 1).trim())
throw new Error(`Extra information after type while processing "${memberName}".\nYou probably need an extra empty line before the description.\n================\n${text}`);
let typeStart = text.indexOf('<');
while ('?e'.includes(text[typeStart - 1]))
typeStart--;
Expand Down

0 comments on commit d07f6cf

Please sign in to comment.