# Fumadocs (Framework Mode, Waku): クイックスタート
URL: /ja/docs/waku
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/index.ja.mdx

Fumadocs 入門

# Set up Fumadocs

Instructions for AI agents to set up Fumadocs on Waku. The setup changes between versions, so run the commands below and read the linked docs instead of writing the setup from memory. Add `.md` to the URL of a docs page to read it as Markdown.

## New Site

Create a new docs site in a new folder, or as a workspace package of a monorepo:

```bash
npx create-fumadocs-app@latest my-docs --template waku --install --yes
```

- `my-docs` is the folder to create.
- `--yes` skips the prompts, and the options you don't pass use their defaults. The options are listed in https://fumadocs.dev/docs/cli/create-fumadocs-app.md

## Existing App

To add docs to an existing app, run the CLI in the folder of the app:

```bash
npx @fumadocs/cli@latest init
```

- The CLI detects the framework, and adds the docs pages with their own layout beside the existing routes.
- `--i18n` sets up internationalization.
- The CLI asks before it overwrites a file. Without a terminal, it keeps the file and prints its name. Pass `--yes` only when every file it writes can be overwritten.

To set up by hand, or to merge a file that the CLI kept, follow https://fumadocs.dev/docs/waku/manual-installation.md

## After the Setup

Both commands print the next steps. Start the dev server and open the docs, at `/docs` unless the output names another path.

For the tasks that follow, read the docs page of the task first:

- Writing pages: https://fumadocs.dev/docs/waku/markdown.md
- Organizing pages and folders: https://fumadocs.dev/docs/waku/page-conventions.md
- Customizing the UI: https://fumadocs.dev/docs/waku/guides/customize-ui.md
- Changing the theme and colors: https://fumadocs.dev/docs/ui/theme.md
- Other tasks: https://fumadocs.dev/llms.txt lists every docs page.

## 用語 [#terminology]

**Markdown/MDX:** Markdown は、書式付きテキストを作成するためのマークアップ言語です。Fumadocs は Markdown と MDX (Markdown のスーパーセット) をネイティブにサポートしています。

**[Bun](https://bun.sh):** JavaScript ランタイムです。本ガイドではスクリプトの実行に使用します。Node.js を使いたい場合は、代わりに [unrun](https://gugustinette.github.io/unrun/guide/getting-started.html#cli) をお試しください。

より高度なカスタマイズを行うには、React.js の基本的な知識があると役立ちます。

## 自動インストール [#automatic-installation]

Node.js 22以上が必要です。

```npm
npm create fumadocs-app
```

使用する組み込みテンプレートを選択するよう求められます。

* **フレームワーク**: Next.js、React Router、TanStack Start、Waku、Astro
* **コンテンツソース**: Fumadocs MDX、または Astro のコンテンツコレクション

新しい Fumadocs アプリが初期化され、以下の機能がデフォルトで設定されます。

* [LLM 連携](/docs/waku/integrations/llms)
* [動的なメタデータ画像](/docs/waku/integrations/og)

<Callout title="既存のコードベースに導入する場合">
[手動インストール](/docs/waku/manual-installation)ガイドに従ってセットアップしてください。
</Callout>

### お楽しみください！ [#enjoy]

docs フォルダーに最初の MDX ファイルを作成しましょう。

```mdx title="content/docs/index.mdx"
---
title: Hello World
---

## Yo what's up
```

開発モードでアプリを起動します。

```npm
npm run dev
```

http://localhost:3000/docs を開くと、作成したページを確認できます。

## よくある質問 [#faq]

よく寄せられる質問をまとめています。

<Accordions>
<Accordion id="upgrade-fumadocs" title="APIが見つからない、バグがあるなどの理由でエラーが発生していますか?">
お探しのAPIや修正は、新しいバージョンで提供されている可能性があります。[Fumadocsをアップグレード](/docs/waku/upgrade)してから、もう一度お試しください。
</Accordion>

<Accordion id="change-base-url" title="ドキュメントのベースルートはどうすれば変更できますか?">
ルーティングは Waku が処理します。まず docs ルートを移動してください (`/docs/*` -&gt; `/info/*`) 。

`src/pages/docs` を `src/pages/info` に移動します。

最後に、`source.ts` でページのベース URL を更新します。

```ts title="lib/source.ts"
import { loader } from 'fumadocs-core/source';

export const source = loader({
  baseUrl: '/info', // 新しい値に変更 [!code highlight]
});
```

テンプレートでは、この値は `lib/shared.ts` 内で `docsRoute` として定義されています。Markdown のリンクにも反映されるよう、変更する際はこの値を編集してください。
</Accordion>

<Accordion id="multi-docs" title="複数のドキュメントを実装するにはどうすればよいですか?">
[レイアウトタブ](/docs/ui/layouts/docs#layout-tabs)の使用をおすすめします。
</Accordion>

<Accordion id="vite-context-error" title="React コンテキストでエラーが発生する場合">
Vite の事前バンドルには、不可解な問題がいくつかあります ([#3910](https://github.com/vitejs/vite/issues/3910)) 。
Fumadocs を事前バンドルの対象から除外し、`noExternal` に追加してください。

```ts title="vite.config.ts"
import { defineConfig } from 'vite';

export default defineConfig({
  resolve: {
    // 必要に応じて、Fumadocs の他の依存パッケージも追加してください
    noExternal: ['fumadocs-core', 'fumadocs-ui', 'fumadocs-openapi', '@fumadocs/base-ui'],
  },
});
```
</Accordion>
</Accordions>

## さらに詳しく [#learn-more]

初めての方もご安心ください。ご質問はいつでも歓迎しています。

わかりにくい点があれば、[Github Discussion](https://github.com/fuma-nama/fumadocs/discussions) でぜひフィードバックをお寄せください！

### コンテンツの執筆 [#writing-content]

ドキュメントを執筆する際は、以下を必ずお読みください。

<Cards>
<Card href="/docs/markdown" title="Markdown">
/docs/waku/markdown" title="Markdown">
  Fumadocs には、コンテンツ執筆に役立つ追加機能がいくつか用意されています。
</Card>

<Card href="/docs/navigation" title="ナビゲーション">
/docs/waku/navigation" title="ナビゲーション">
  ナビゲーション構造をカスタマイズする方法を説明します。
</Card>

<Card href="/docs/page-conventions" title="ページスラッグとページツリー">
/docs/waku/page-conventions" title="ページスラッグとページツリー">
  コンテンツを整理する方法を説明します。
</Card>

<Card href="/docs/ui/components" title="コンポーネント" description="ドキュメントを充実させるために利用できるコンポーネントの一覧です" />
</Cards>

### 特殊な要件 [#special-needs]

<Cards>
<Card href="/docs/deploying/static" title="静的エクスポートの設定" description="ドキュメントで静的エクスポートを有効にする方法を説明します">
/docs/waku/deploying/static
</Card>

<Card href="/docs/internationalization" title="国際化" description="i18n を有効にする方法を説明します">
/docs/waku/internationalization
</Card>

<Card href="/docs/ui/theme" title="カラーテーマ" description="Fumadocs UI にテーマを追加します" />

<Card href="/docs/ui/layouts" title="レイアウト" description="Fumadocs UI のレイアウトをカスタマイズします" />
</Cards>