Skip to content

Commit

Permalink
Fix docs links and add examples to sidebar (#2895)
Browse files Browse the repository at this point in the history
* Fix docs links

* Add examples to sidebar

* Correct docs link from main readme

* Switch to relative paths in docs readme

* move examples down

---------

Co-authored-by: Ezekiel Keator <[email protected]>
Co-authored-by: Aras Abbasi <[email protected]>
  • Loading branch information
3 people authored Mar 5, 2024
1 parent 5bb84ba commit 03a2d43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ For more information about their behavior, please reference the body mixin from

## Common API Methods

This section documents our most commonly used API methods. Additional APIs are documented in their own files within the [documentation](./documentation/) folder and are accessible via the navigation list on the left side of the docs site.
This section documents our most commonly used API methods. Additional APIs are documented in their own files within the [docs](./docs/) folder and are accessible via the navigation list on the left side of the docs site.

### `undici.request([url, options]): Promise`

Arguments:

* **url** `string | URL | UrlObject`
* **options** [`RequestOptions`](./documentation/docs/api/Dispatcher.md#parameter-requestoptions)
* **options** [`RequestOptions`](./docs/api/Dispatcher.md#parameter-requestoptions)
* **dispatcher** `Dispatcher` - Default: [getGlobalDispatcher](#undicigetglobaldispatcher)
* **method** `String` - Default: `PUT` if `options.body`, otherwise `GET`
* **maxRedirections** `Integer` - Default: `0`
Expand All @@ -110,14 +110,14 @@ Returns a promise with the result of the `Dispatcher.request` method.

Calls `options.dispatcher.request(options)`.

See [Dispatcher.request](./documentation/docs/api/Dispatcher.md#dispatcherrequestoptions-callback) for more details, and [request examples](./documentation/examples/README.md) for examples.
See [Dispatcher.request](./docs/api/Dispatcher.md#dispatcherrequestoptions-callback) for more details, and [request examples](./examples/README.md) for examples.

### `undici.stream([url, options, ]factory): Promise`

Arguments:

* **url** `string | URL | UrlObject`
* **options** [`StreamOptions`](./documentation/docs/api/Dispatcher.md#parameter-streamoptions)
* **options** [`StreamOptions`](./docs/api/Dispatcher.md#parameter-streamoptions)
* **dispatcher** `Dispatcher` - Default: [getGlobalDispatcher](#undicigetglobaldispatcher)
* **method** `String` - Default: `PUT` if `options.body`, otherwise `GET`
* **maxRedirections** `Integer` - Default: `0`
Expand All @@ -127,14 +127,14 @@ Returns a promise with the result of the `Dispatcher.stream` method.

Calls `options.dispatcher.stream(options, factory)`.

See [Dispatcher.stream](documentation/docs/api/Dispatcher.md#dispatcherstreamoptions-factory-callback) for more details.
See [Dispatcher.stream](./docs/api/Dispatcher.md#dispatcherstreamoptions-factory-callback) for more details.

### `undici.pipeline([url, options, ]handler): Duplex`

Arguments:

* **url** `string | URL | UrlObject`
* **options** [`PipelineOptions`](documentation/docs/api/Dispatcher.md#parameter-pipelineoptions)
* **options** [`PipelineOptions`](./docs/api/Dispatcher.md#parameter-pipelineoptions)
* **dispatcher** `Dispatcher` - Default: [getGlobalDispatcher](#undicigetglobaldispatcher)
* **method** `String` - Default: `PUT` if `options.body`, otherwise `GET`
* **maxRedirections** `Integer` - Default: `0`
Expand All @@ -144,7 +144,7 @@ Returns: `stream.Duplex`

Calls `options.dispatch.pipeline(options, handler)`.

See [Dispatcher.pipeline](documentation/docs/api/Dispatcher.md#dispatcherpipelineoptions-handler) for more details.
See [Dispatcher.pipeline](./docs/api/Dispatcher.md#dispatcherpipelineoptions-handler) for more details.

### `undici.connect([url, options]): Promise`

Expand All @@ -153,7 +153,7 @@ Starts two-way communications with the requested resource using [HTTP CONNECT](h
Arguments:

* **url** `string | URL | UrlObject`
* **options** [`ConnectOptions`](documentation/docs/api/Dispatcher.md#parameter-connectoptions)
* **options** [`ConnectOptions`](./docs/api/Dispatcher.md#parameter-connectoptions)
* **dispatcher** `Dispatcher` - Default: [getGlobalDispatcher](#undicigetglobaldispatcher)
* **maxRedirections** `Integer` - Default: `0`
* **callback** `(err: Error | null, data: ConnectData | null) => void` (optional)
Expand All @@ -162,7 +162,7 @@ Returns a promise with the result of the `Dispatcher.connect` method.

Calls `options.dispatch.connect(options)`.

See [Dispatcher.connect](documentation/docs/api/Dispatcher.md#dispatcherconnectoptions-callback) for more details.
See [Dispatcher.connect](./docs/api/Dispatcher.md#dispatcherconnectoptions-callback) for more details.

### `undici.fetch(input[, init]): Promise`

Expand Down Expand Up @@ -301,7 +301,7 @@ Upgrade to a different protocol. See [MDN - HTTP - Protocol upgrade mechanism](h
Arguments:

* **url** `string | URL | UrlObject`
* **options** [`UpgradeOptions`](documentation/docs/api/Dispatcher.md#parameter-upgradeoptions)
* **options** [`UpgradeOptions`](./docs/api/Dispatcher.md#parameter-upgradeoptions)
* **dispatcher** `Dispatcher` - Default: [getGlobalDispatcher](#undicigetglobaldispatcher)
* **maxRedirections** `Integer` - Default: `0`
* **callback** `(error: Error | null, data: UpgradeData) => void` (optional)
Expand All @@ -310,7 +310,7 @@ Returns a promise with the result of the `Dispatcher.upgrade` method.

Calls `options.dispatcher.upgrade(options)`.

See [Dispatcher.upgrade](documentation/docs/api/Dispatcher.md#dispatcherupgradeoptions-callback) for more details.
See [Dispatcher.upgrade](./docs/api/Dispatcher.md#dispatcherupgradeoptions-callback) for more details.

### `undici.setGlobalDispatcher(dispatcher)`

Expand Down
2 changes: 2 additions & 0 deletions docs/docsify/sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* [Util](/docs/api/Util.md "Undici API - Util")
* [RedirectHandler](/docs/api/RedirectHandler.md "Undici API - RedirectHandler")
* [RetryHandler](/docs/api/RetryHandler.md "Undici API - RetryHandler")
* Examples
* [Undici Examples](/examples/ "Undici Examples")
* Best Practices
* [Proxy](/docs/best-practices/proxy.md "Connecting through a proxy")
* [Client Certificate](/docs/best-practices/client-certificate.md "Connect using a client certificate")
Expand Down

0 comments on commit 03a2d43

Please sign in to comment.