# 見出し

見出しはドキュメントに構造を与えるのに役立ちます。また、見出しにキーワードを使うことで、検索エンジンがその構造を理解しやすくなり、検索結果でページの順位を高めるのに役立つことがあります。

GitBook には 3 つの見出しレベルがあります。見出しレベル 1（H1）と 2（H2）は、次の場所に表示されます。 [ページアウトライン](/docs/documentation/ja-gitbook-documentation/rissu/gitbook-ui.md#page-outline).

### アンカーリンク

ページに見出しを追加すると、アンカーリンクが作成されます。その後、これらの特定のセクションに直接リンクして、関連情報を示すことができます。

#### アンカーへのリンク

公開コンテンツ、または読み取り専用モードの非公開コンテンツでは、タイトルにカーソルを合わせて、横に表示される `#` をクリックすると、アンカーリンクを確認できます。これによりブラウザ上部の URL が更新されるので、コピーして他の場所で使用できます。

GitBook スペース内のページから特定のアンカーにリンクしたい場合は、 [相対リンク](/docs/documentation/ja-gitbook-documentation/creating-content/formatting/inline.md#relative-links)を使用できます。これにより、見出しを変更してもリンク切れを防ぐために自動で更新されます。

#### アンカーを編集

デフォルトでは、アンカーリンクはヘッダーのテキストと同じになります。その URL を GitBook の外部でリンク先として使う予定がある場合、後でヘッダーを変更するとアンカーリンクは壊れてしまいます。その場合、リンク先はアンカーの位置ではなく、ページの先頭に訪問者を移動させます。

これを避けるには、 **オプションメニュー** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="/files/ce0e0a07ded643c4e219bbfe214239e291d0c7a1" alt="The Options menu icon in GitBook"></picture> を開いてヘッダーのアンカーリンクを手動で設定し、次に **アンカーを編集**を選択します。その後、使用したいアンカーリンクを入力できます。これは、ヘッダー自体を変更してもアンカーとして維持されます。

### Markdown での表現

GitBook は SEO に最適化されたページを生成します。つまり、GitBook のページタイトルは Markdown 上で自動的に第 1 レベルの見出しとして表現されます。

```markdown
# ページタイトルです
```

つまり、 [Git と内容を同期している](/docs/documentation/ja-gitbook-documentation/getting-started/git-sync.md)場合、エディタで追加されたページヘッダーは 1 レベル下として表現されます。

{% code overflow="wrap" %}

```markdown
## 見出し 1
### 見出し 2
#### 見出し 3
```

{% endcode %}

### 見出しの例 <a href="#example-of-a-heading" id="example-of-a-heading"></a>

## 見出し 1

### 見出し 2

#### 見出し 3


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/creating-content/blocks/heading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
