Skip to content

Commit

Permalink
docs: fix website (#9935)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Mar 29, 2023
1 parent 57e11b3 commit dcd8818
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ or [managing browsers yourself](https://pptr.dev/api/puppeteer.browserfetcher).
If you are managing browsers yourself, you will need to call
[`puppeteer.launch`](https://pptr.dev/api/puppeteer.puppeteernode.launch) with
an an explicit
[`executablePath`](https://pptr.dev/api/puppeteer.launchoptions.executablepath)
(or [`channel`](https://pptr.dev/api/puppeteer.launchoptions.channel) if it's
[`executablePath`](https://pptr.dev/api/puppeteer.launchoptions)
(or [`channel`](https://pptr.dev/api/puppeteer.launchoptions) if it's
installed in a standard location).

When using `puppeteer-core`, remember to change the import:
Expand Down Expand Up @@ -177,7 +177,7 @@ import puppeteer from 'puppeteer';
Puppeteer launches Chromium in
[headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome).
To launch a full version of Chromium, set the
[`headless`](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions.headless)
[`headless`](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions)
option when launching a browser:

```ts
Expand Down
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ There are two reasons for this:
This means that Puppeteer does not support licensed formats such as AAC or
H.264. (However, it is possible to force Puppeteer to use a
separately-installed version Chrome instead of Chromium via the
[`executablePath` option to `puppeteer.launch`](./api/puppeteer.launchoptions.executablepath).
[`executablePath` option to `puppeteer.launch`](./api/puppeteer.launchoptions).
You should only use this configuration if you need an official release of
Chrome that supports these media formats.)
- Since Puppeteer (in all configurations) controls a desktop version of
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ about the ambient environment is needed (in this case, `__dirname`).
#### Enabling experiments

By default, experiments are turned off, but they can be individually turned on
using the [`experiments`](../api/puppeteer.configuration.experiments) key.
using the [`experiments`](../api/puppeteer.configuration) key.

For example, if you want to enable ARM-native macOS chromium, you can use

Expand Down
14 changes: 7 additions & 7 deletions docs/guides/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ before
These methods can be used to debug any situation. These should be used as a
quick sanity check before diving into more complex methods.

### Turn off [`headless`](../api/puppeteer.browserlaunchargumentoptions.headless)
### Turn off [`headless`](../api/puppeteer.browserlaunchargumentoptions)

Sometimes it's useful to see what the browser is displaying. Instead of
launching in
[`headless`](../api/puppeteer.browserlaunchargumentoptions.headless) mode,
[`headless`](../api/puppeteer.browserlaunchargumentoptions) mode,
launch a full version of the browser with
[`headless`](../api/puppeteer.browserlaunchargumentoptions.headless) set to
[`headless`](../api/puppeteer.browserlaunchargumentoptions) set to
`false`:

```ts
Expand All @@ -38,7 +38,7 @@ const browser = await puppeteer.launch({headless: false});

### Puppeteer "slow-mo"

The [`slowMo`](../api/puppeteer.browserconnectoptions.slowmo) option slows down
The [`slowMo`](../api/puppeteer.browserconnectoptions) option slows down
Puppeteer operations by a specified amount of milliseconds. It's another way to
help see what's going on.

Expand All @@ -55,7 +55,7 @@ const browser = await puppeteer.launch({

Since client code runs in the browser, doing `console.*` in client code will not
directly log to Node.js. However, you can [listen](../api/puppeteer.page.on) for
the [`console`](../api/puppeteer.pageeventobject.console) event which returns a
the [`console`](../api/puppeteer.pageeventobject) event which returns a
payload with the logged text.

```ts
Expand All @@ -66,7 +66,7 @@ await page.evaluate(() => console.log(`url is ${location.href}`));

### Use the debugger in the browser

1. Set [`devtools`](../api/puppeteer.browserlaunchargumentoptions.devtools) to
1. Set [`devtools`](../api/puppeteer.browserlaunchargumentoptions) to
`true` when launching Puppeteer:

```ts
Expand Down Expand Up @@ -98,7 +98,7 @@ to this
[Chromium bug](https://bugs.chromium.org/p/chromium/issues/detail?id=833928), so
if you want to try something out, you have to add it to your test file.

1. Set [`headless`](../api/puppeteer.browserlaunchargumentoptions.headless) to
1. Set [`headless`](../api/puppeteer.browserlaunchargumentoptions) to
`false`.
2. Add `debugger` to any server code you want debugged. For example,

Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ or [managing browsers yourself](https://pptr.dev/api/puppeteer.browserfetcher).
If you are managing browsers yourself, you will need to call
[`puppeteer.launch`](https://pptr.dev/api/puppeteer.puppeteernode.launch) with
an an explicit
[`executablePath`](https://pptr.dev/api/puppeteer.launchoptions.executablepath)
(or [`channel`](https://pptr.dev/api/puppeteer.launchoptions.channel) if it's
[`executablePath`](https://pptr.dev/api/puppeteer.launchoptions)
(or [`channel`](https://pptr.dev/api/puppeteer.launchoptions) if it's
installed in a standard location).

When using `puppeteer-core`, remember to change the import:
Expand Down Expand Up @@ -177,7 +177,7 @@ import puppeteer from 'puppeteer';
Puppeteer launches Chromium in
[headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome).
To launch a full version of Chromium, set the
[`headless`](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions.headless)
[`headless`](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions)
option when launching a browser:

```ts
Expand Down
10 changes: 6 additions & 4 deletions website/src/theme/SearchBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import Head from '@docusaurus/Head';
import Link from '@docusaurus/Link';
import {useHistory} from '@docusaurus/router';
import {isRegexpStringMatch} from '@docusaurus/theme-common';
import {useContextualSearchFilters} from '@docusaurus/theme-common';
import {useSearchPage} from '@docusaurus/theme-common/internal';
import {
useContextualSearchFilters,
useSearchLinkCreator,
} from '@docusaurus/theme-common';
import Translate from '@docusaurus/Translate';
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
Expand All @@ -19,9 +21,9 @@ function Hit({hit, children}) {
return <Link to={hit.url}>{children}</Link>;
}
function ResultsFooter({state, onClose}) {
const {generateSearchPageLink} = useSearchPage();
const createSearchLink = useSearchLinkCreator();
return (
<Link to={generateSearchPageLink(state.query)} onClick={onClose}>
<Link to={createSearchLink(state.query)} onClick={onClose}>
<Translate
id="theme.SearchBar.seeAll"
values={{count: state.context.nbHits}}
Expand Down
8 changes: 3 additions & 5 deletions website/src/theme/SearchPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import {
usePluralForm,
isRegexpStringMatch,
useEvent,
useSearchQueryString,
} from '@docusaurus/theme-common';
import {
useTitleFormatter,
useSearchPage,
} from '@docusaurus/theme-common/internal';
import {useTitleFormatter} from '@docusaurus/theme-common/internal';
import Translate, {translate} from '@docusaurus/Translate';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
Expand Down Expand Up @@ -128,7 +126,7 @@ function SearchPageContent() {
} = themeConfig;
const documentsFoundPlural = useDocumentsFoundPlural();
const docsSearchVersionsHelpers = useDocsSearchVersionsHelpers();
const {searchQuery, setSearchQuery} = useSearchPage();
const [searchQuery, setSearchQuery] = useSearchQueryString();
const initialSearchResultState = {
items: [],
query: null,
Expand Down

0 comments on commit dcd8818

Please sign in to comment.