> For the complete documentation index, see [llms.txt](https://gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/documentation/ja-gitbook-documentation/creating-content/blocks/heading.md).

# 見出し

見出しはドキュメントの構造を分かりやすくします。また、見出しにキーワードを使うと検索エンジンもその構造を理解しやすくなり、ページが検索結果でより上位に表示されるのに役立ちます。

GitBook では見出しレベルが3段階あります。見出しレベル1（H1）と2（H2）は、ページのアウトラインに [ページのアウトライン](/url/gitbook.com/docs/documentation/ja-gitbook-documentation/rissu/gitbook-ui.md#page-outline).

### アンカーリンク

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

#### アンカーにリンクする

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

GitBook スペース内のページから特定のアンカーにリンクしたい場合は、 [相対リンク](/url/gitbook.com/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 と同期すると](/url/gitbook.com/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

{% hint style="info" %}
ページタイトルは、ページ本文の見出しブロックとは別です。ページタイトルを **ページオプション**で非表示にすると、H1、H2、H3 の見出しは引き続き表示されます。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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-open-v2-preview.gitbook.workers.dev/url/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.
