> For the complete documentation index, see [llms.txt](https://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.com/docs/documentation/ja-gitbook-documentation/creating-content/blocks/heading.md).

# 見出し

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

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

### アンカーリンク

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

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

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

セクション内のページから特定のアンカーにリンクしたい場合は、 [相対リンク](/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

{% 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
