Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some styling changes to Markdown (Links in Callouts) #525

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pages/docs/data-fetching.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ This is the very fundamental API of SWR. The `fetcher` here is an async function
The returned value will be passed as `data`, and if it throws, it will be caught as `error`.

<Callout emoji="💡">
Note that <code>fetcher</code> can be omitted from the parameters if it's{' '}
<Link href="/docs/global-configuration">provided globally</Link>.
Note that <code>fetcher</code> can be omitted from the parameters if it's
[provided globally](/docs/global-configuration)
</Callout>

## Fetch [#fetch]
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/data-fetching.fr-FR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ La valeur retournée sera passée en tant que `data`, et si elle lance une erreu

<Callout emoji="💡">
Notez que <code>fetcher</code> peut être omis des paramètres s'il est{' '}
<Link href="/docs/global-configuration">fourni globalement</Link>.
[fourni globalement](/docs/global-configuration)
</Callout>

## Récupération [#fetch]
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/data-fetching.ja.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const { data, error } = useSWR(key, fetcher)

<Callout emoji="💡">
<code>fetcher</code> が{' '}
<Link href="/docs/global-configuration">グローバルで提供されている</Link>{' '}
場合は、パラメーターから省略できることに注意してください。
[場合は、パラメーターから省略できることに注意してください。](/docs/global-configuration)

</Callout>

## Fetch [#fetch]
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/data-fetching.ko.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { data, error } = useSWR(key, fetcher)
반환된 값은 `data`로 전달되며, 만약 throws라면 `error`로 잡힙니다.

<Callout emoji="💡">
<code>fetcher</code>가 <Link href="/docs/global-configuration">전역으로 제공</Link>된다면
<code>fetcher</code>가 [전역으로 제공](/docs/global-configuration)된다면
파라미터에서 생략할 수 있습니다.
</Callout>

Expand Down
8 changes: 4 additions & 4 deletions pages/docs/data-fetching.pt-BR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ O valor retornado será passado como `data`, e se ele der erro, será capturado

<Callout emoji="💡">
Note que <code>fetcher</code> pode ser omitido dos parâmetros se ele for{' '}
<Link href="/docs/global-configuration">fornecido globalmente</Link>.
[fornecido globalmente](/docs/global-configuration).
</Callout>

## Fetch [#fetch]
## Fetch [#fetch]

Você pode usar qualquer biblioteca para lidar com a obtenção de dados, por exemplo o `fetch` polyfill [developit/unfetch](https://github.com/developit/unfetch):

Expand All @@ -36,7 +36,7 @@ function App () {
<a target="_blank" rel="noopener" href="https://nextjs.org/blog/next-9-1-7#new-built-in-polyfills-fetch-url-and-objectassign">New Built-In Polyfills: fetch(), URL, and Object.assign</a>
</Callout>

## Axios [#axios]
## Axios [#axios]

```js
import axios from 'axios'
Expand All @@ -49,7 +49,7 @@ function App () {
}
```

## GraphQL [#graphql]
## GraphQL [#graphql]

Ou usando GraphQL com bibliotecas como [graphql-request](https://github.com/prisma-labs/graphql-request):

Expand Down
2 changes: 1 addition & 1 deletion pages/docs/data-fetching.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { data, error } = useSWR(key, fetcher)

<Callout emoji="💡">
Обратите внимание, что <code>fetcher</code> можно не указывать в параметрах, если он{' '}
<Link href="/docs/global-configuration">предоставляется глобально</Link>.
[предоставляется глобально](/docs/global-configuration).
</Callout>

## Выборка (Fetch) [#fetch]
Expand Down
4 changes: 3 additions & 1 deletion pages/docs/data-fetching.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const { data, error } = useSWR(key, fetcher)
返回值将作为 `data` 传递,如果抛出错误,将作为 `error` 被捕获。

<Callout emoji="💡">
注意:如果 <code>fetcher</code> 是<Link href="/docs/global-configuration">全局配置</Link>提供的,可以从参数中忽略。
注意:如果 <code>fetcher</code> 是
[全局配置](/docs/global-configuration)
提供的,可以从参数中忽略。
</Callout>

## Fetch [#fetch]
Expand Down
3 changes: 1 addition & 2 deletions pages/docs/getting-started.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Inside your React project directory, run the following:
</Tab>
</Tabs>


## Quick Start [#quick-start]

For normal RESTful APIs with JSON data, first you need to create a `fetcher` function, which is just a wrapper of the native `fetch`:
Expand All @@ -36,7 +35,7 @@ const fetcher = (...args) => fetch(...args).then(res => res.json())

<Callout emoji="💡">
If you want to use GraphQL API or libs like Axios, you can create your own fetcher function.
Check <Link href="/docs/data-fetching">here</Link> for more examples.
Check [here](/docs/data-fetching) for more examples.
</Callout>

Then you can import `useSWR` and start using it inside any function components:
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/getting-started.es-ES.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const fetcher = (...args) => fetch(...args).then(res => res.json())

<Callout emoji="💡">
Si tu quieres usar API GraphQL o librerías como Axios, puedes crear tu propia función fetcher. Consulta
<Link href="/docs/data-fetching">aqui</Link> para ver más ejemplos.
[aqui](/docs/data-fetching) para ver más ejemplos.
</Callout>

Luego puede importar `useSWR` y empezar a usarlo dentro de cualquier componente de la función:
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/getting-started.fr-FR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const fetcher = (...args) => fetch(...args).then(res => res.json())

<Callout emoji="💡">
Si vous souhaitez utiliser l'API GraphQL ou des librairies comme Axios, vous pouvez créer votre propre fonction fetcher.
Consultez <Link href="/docs/data-fetching">cet page</Link> pour plus d'exemples.
Consultez [cet page](/docs/data-fetching) pour plus d'exemples.
</Callout>

Ensuite, vous pouvez importer `useSWR` et commencer à l'utiliser dans n'importe quelle fonction composant :
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/getting-started.ja.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const fetcher = (...args) => fetch(...args).then(res => res.json())

<Callout emoji="💡">
もし GraphQL API または Axios のようなライブラリを使いたい場合は、独自のフェッチャー関数を作ることができます。
その他の例は<Link href="/docs/data-fetching">こちら</Link>をご覧ください。
その他の例は [こちら](/docs/data-fetching) をご覧ください。
</Callout>

そして、 `useSWR` をインポートして、任意の関数コンポーネント内で使用することができます:
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/getting-started.ko.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const fetcher = (...args) => fetch(...args).then(res => res.json())

<Callout emoji="💡">
GraphQL API 또는 Axios와 같은 라이브러리를 사용하려면 여러분만의 fetcher 함수를 생성하면 됩니다.
<Link href="/docs/data-fetching">여기</Link>에서 더 많은 예시를 확인하세요.
[여기](/docs/data-fetching)에서 더 많은 예시를 확인하세요.
</Callout>

그 다음, `useSWR`을 임포트하고 함수 컴포넌트 내에서 사용하여 시작하면 됩니다.
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/getting-started.pt-BR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const fetcher = (...args) => fetch(...args).then(res => res.json())

<Callout emoji="💡">
Se você quer usar APIs GraphQL ou outras bibliotecas como Axios, você pode criar sua própria função fetcher.
Veja mais exemplos clicando <Link href="/docs/data-fetching">aqui</Link>.
Veja mais exemplos clicando [aqui](/docs/data-fetching).
</Callout>

Então você pode importar `useSWR` e começar a usá-lo em qualquer componente funcional:
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/getting-started.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const fetcher = (...args) => fetch(...args).then(res => res.json())
<Callout emoji="💡">
Если вы хотите использовать GraphQL API или библиотеки, такие как Axios, вы можете создать свою
собственную fetcher-функцию.
Смотрите примеры <Link href="/docs/data-fetching">здесь</Link>.
Смотрите примеры [здесь](/docs/data-fetching).
</Callout>

Затем можете импортировать `useSWR` и использовать его внутри функциональных компонентов:
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/getting-started.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const fetcher = (...args) => fetch(...args).then((res) => res.json())
```

<Callout emoji="💡">
如果要使用 GraphQL API 或类似 Axios 的库,可以自己创建 fetcher 函数。 点击 <Link href="/docs/data-fetching">这里</Link> 查看更多示例。
如果要使用 GraphQL API 或类似 Axios 的库,可以自己创建 fetcher 函数。 点击 [这里](/docs/data-fetching) 查看更多示例。
</Callout>

然后你可以 import `useSWR` 并开始在任何函数组件中使用它:
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/revalidation.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from 'next/link'
# Automatic Revalidation

<Callout>
If you want to manually revalidate the data, check <Link href="/docs/mutation">mutation</Link>.
If you want to manually revalidate the data, check [mutation](/docs/mutation)</Link>.
</Callout>

## Revalidate on Focus [#revalidate-on-focus]
Expand Down Expand Up @@ -97,4 +97,4 @@ A SWR hook mounts as:

`revalidateIfStale` useful to control the mount behaviour. By default `revalidateIfStale` is set to true.

If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
4 changes: 2 additions & 2 deletions pages/docs/revalidation.es-ES.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from 'next/link'
# Revalidación Automática

<Callout>
Si quiere revalidar manualmente los datos, compruebe <Link href="/docs/mutation">mutation</Link>.
Si quiere revalidar manualmente los datos, compruebe [mutation](/docs/mutation).
</Callout>

## Revalidar on focus [#revalidate-on-focus]
Expand Down Expand Up @@ -102,4 +102,4 @@ A SWR hook mounts as:

`revalidateIfStale` useful to control the mount behaviour. By default `revalidateIfStale` is set to true.

If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
2 changes: 1 addition & 1 deletion pages/docs/revalidation.fr-FR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from 'next/link'
# Auto Revalidation

<Callout>
Si vous voulez revalider manuellement les données, consultez <Link href="/docs/mutation">mutation</Link>.
Si vous voulez revalider manuellement les données, consultez [mutation](/docs/mutation).
</Callout>

## Revalider lors du Focus [#revalidate-on-focus]
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/revalidation.ja.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from 'next/link'
# 自動再検証

<Callout>
データを手動で再検証する場合は、<Link href="/docs/mutation">ミューテーション</Link>を確認してください。
データを手動で再検証する場合は、[ミューテーション](/docs/mutation) を確認してください。
</Callout>

## フォーカス時の再検証 [#revalidate-on-focus]
Expand Down Expand Up @@ -97,4 +97,4 @@ A SWR hook mounts as:

`revalidateIfStale` useful to control the mount behaviour. By default `revalidateIfStale` is set to true.

If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
4 changes: 2 additions & 2 deletions pages/docs/revalidation.ko.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from 'next/link'
# 자동 갱신

<Callout>
수동으로 데이터를 갱신하려면 <Link href="/docs/mutation">뮤테이션</Link>을 확인하세요.
수동으로 데이터를 갱신하려면 [뮤테이션](/docs/mutation) 을 확인하세요.
</Callout>

## 포커스 시에 갱신하기 [#revalidate-on-focus]
Expand Down Expand Up @@ -97,4 +97,4 @@ A SWR hook mounts as:

`revalidateIfStale` useful to control the mount behaviour. By default `revalidateIfStale` is set to true.

If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
4 changes: 2 additions & 2 deletions pages/docs/revalidation.pt-BR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from 'next/link'
# Revalidação Automática

<Callout>
Se você quer validar manualmente os dados, verifique <Link href="/docs/mutation">Mutação</Link>.
Se você quer validar manualmente os dados, verifique [Mutação](/docs/mutation).
</Callout>

## Revalidar ao Focar [#revalidate-on-focus]
Expand Down Expand Up @@ -97,4 +97,4 @@ A SWR hook mounts as:

`revalidateIfStale` useful to control the mount behaviour. By default `revalidateIfStale` is set to true.

If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
4 changes: 2 additions & 2 deletions pages/docs/revalidation.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from 'next/link'
# Автоматическая ревалидация

<Callout>
Вы можете ревалидировать данные вручную, смотрите <Link href="/docs/mutation">мутацию</Link>.
Вы можете ревалидировать данные вручную, смотрите [мутацию](/docs/mutation).
</Callout>

## Ревалидация при фокусировке [#revalidate-on-focus]
Expand Down Expand Up @@ -98,4 +98,4 @@ A SWR hook mounts as:

`revalidateIfStale` useful to control the mount behaviour. By default `revalidateIfStale` is set to true.

If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
6 changes: 3 additions & 3 deletions pages/docs/revalidation.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from 'next/link'
# 自动重新请求

<Callout>
如果你想手动重新请求数据,请查看 <Link href="/docs/mutation">mutation</Link>
如果你想手动重新请求数据,请查看 [mutation](/docs/mutation)
</Callout>

## 聚焦时重新请求 [#revalidate-on-focus]
Expand Down Expand Up @@ -70,7 +70,7 @@ import useSWRImmutable from 'swr/immutable'
useSWRImmutable(key, fetcher, options)
```

它具有与普通 `useSWR` hook 相同的 API 接口。你还可以通过禁用以下重新请求​​选项来执行相同的操作:
它具有与普通 `useSWR` hook 相同的 API 接口。你还可以通过禁用以下重新请求 ​​ 选项来执行相同的操作:

```js
useSWR(key, fetcher, {
Expand All @@ -97,4 +97,4 @@ A SWR hook mounts as:

`revalidateIfStale` useful to control the mount behaviour. By default `revalidateIfStale` is set to true.

If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
If `revalidateIfStale` is set to true it only refetches if there's any cache data else it will not refetch.
2 changes: 1 addition & 1 deletion pages/docs/suspense.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Callout } from 'nextra-theme-docs'
# Suspense

<Callout emoji="🚨" type="error">
React still <strong>doesn't recommend</strong> using `Suspense` in data frameworks like SWR (<a href="https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks" target="_blank" rel="noopener">More information</a>). These APIs may change in the future as the results of our research.
React still <strong>doesn't recommend</strong> using `Suspense` in data frameworks like SWR ([more information](https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks)). These APIs may change in the future as the results of our research.
</Callout>

You can enable the `suspense` option to use SWR with React Suspense:
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/suspense.es-ES.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Callout } from 'nextra-theme-docs'
# Suspense

<Callout emoji="🚨" type="error">
React still <strong>doesn't recommend</strong> using `Suspense` in data frameworks like SWR (<a href="https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks" target="_blank" rel="noopener">More information</a>). These APIs may change in the future as the results of our research.
React still <strong>doesn't recommend</strong> using `Suspense` in data frameworks like SWR ([More information](https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks)). These APIs may change in the future as the results of our research.
</Callout>

Puede activar la opción `suspense` para utilizar SWR con React Suspense:
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/suspense.fr-FR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Callout } from 'nextra-theme-docs'
# Suspense

<Callout emoji="🚨" type="error">
React <strong>ne recommande toujours pas</strong> d'utiliser `Suspense` dans les frameworks de données comme SWR (<a href="https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks" target="_blank" rel="noopener">Plus d'informations</a>). Ces API peuvent changer à l'avenir en fonction des résultats de nos recherches.
React <strong>ne recommande toujours pas</strong> d'utiliser `Suspense` dans les frameworks de données comme SWR ([Plus d'informations](https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks)). Ces API peuvent changer à l'avenir en fonction des résultats de nos recherches.
</Callout>

Vous pouvez activer l'option `suspense` pour utiliser SWR avec React Suspense :
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/suspense.ja.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Callout } from 'nextra-theme-docs'
# サスペンス

<Callout emoji="🚨" type="error">
React はまだサスペンスをデータ取得フレームワークである SWR などで使うことを <strong>推奨していません</strong> (<a href="https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks" target="_blank" rel="noopener">詳細</a>)。 これらの API は将来的に私たちの調査により変更される可能性があります。
React はまだサスペンスをデータ取得フレームワークである SWR などで使うことを <strong>推奨していません</strong> ([詳細](https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks))。 これらの API は将来的に私たちの調査により変更される可能性があります。
</Callout>

React サスペンスで SWR を使用するには、 `suspense` オプションを有効にします。
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/suspense.ko.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Callout } from 'nextra-theme-docs'
# 서스펜스

<Callout emoji="🚨" type="error">
리액트는 여전히 SWR(<a href="https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks" target="_blank" rel="noopener">추가 정보</a>) 과 같은 데이터 프레임워크에서 서스펜스를 사용하는 것을 권장하지 않습니다. 이러한 API는 향후 연구 결과에 따라 변경될 수 있습니다.
리액트는 여전히 SWR ([추가 정보](https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks)) 과 같은 데이터 프레임워크에서 서스펜스를 사용하는 것을 권장하지 않습니다. 이러한 API는 향후 연구 결과에 따라 변경될 수 있습니다.
</Callout>

React 서스펜스를 SWR과 함께 사용하려면 `suspense` 옵션을 활성화하세요.
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/suspense.pt-BR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Callout } from 'nextra-theme-docs'
# Suspense

<Callout emoji="🚨" type="error">
O React <strong>não recomenda</strong> usar `Suspense` em frameworks de dados como o SWR (<a href="https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks" target="_blank" rel="noopener">Mais informações</a>). Essas APIs podem mudar no futuro como resultados da nossa pesquisa.
O React <strong>não recomenda</strong> usar `Suspense` em frameworks de dados como o SWR ([Mais informações](https://reactjs.org/blog/2022/03/29/react-v18.html#suspense-in-data-frameworks)). Essas APIs podem mudar no futuro como resultados da nossa pesquisa.
</Callout>

Você pode habilitar a opção `suspense` para usar SWR com React Suspense:
Expand Down
Loading