The Table of Contents macro scans the headings on the current Confluence page to create a table of contents based on those headings. This helps readers find their way around lengthy pages, by summarising the content structure and providing links to headings.

目次マクロを使用する

ヒント: エディタ ツールバーにすばやくアクセスするには、[挿入] > [目次] を選択します。

目次マクロをページに追加する方法

  1. In the Confluence editor, choose Insert > Other Macros.
  2. Find and select the required macro.

オートコンプリートでマクロを素早く入力する方法

Type { and the beginning of the macro name, to see a list of suggested macros. Details are in Using Autocomplete.

既存のマクロを編集する方法: マクロのプレースホルダをクリックして、[編集] を選択します。マクロのパラメータが編集可能な場合、マクロのダイアログ ウィンドウが開きます。

マクロ パラメーター

パラメータは、マクロ出力の内容や形式を制御するために設定するオプションです。

パラメーター

既定

説明

出力タイプ

list

  • list – 一般的なリスト タイプの目次を生成します。
  • flat — 横型メニュー タイプの一連のリンクを精製します。

Display Section Numbering

clear

見出しにアウトライン ナンバリングを適用します。例: 1.1、1.2、1.3.

リスト スタイル

disc

各リスト項目のブレット ポイントのスタイルを選択します。有効な CSS スタイルを使用できます。 例:

  • none — リスト スタイルの表示なし
  • circle —  丸のリスト スタイル
  • disc — 黒丸のリスト スタイル。一般的な箇条書きリスト。このリスト例で使用しています。
  • square — 正方形のリスト スタイル
  • decimal — 番号付きリスト (1、2、3、4、5)
  • lower-alpha — the list is lower-case, alphabetised (a, b, c, d, e)
  • lower-roman — 小文字のローマ数字のリスト スタイル (i、ii、iii、iv、v、vi)
  • upper-roman — 大文字のローマ数字 (I、II、III、IV、V、VI) のリスト スタイル。

Heading Indent

 

CSS の数に従って、リストのインデントを作成します。10px と入力すると、一連の見出しが 10 px でインデントされます。たとえば、レベル 1 の見出しのインデントは 10 px となり、レベル 2 の見出しはさらに 10 px でインデントされます。

Separator

brackets

このパラメーターはフラットリストにのみ適用されます。 次の値のいずれかを入力できます。

  • brackets — 各アイテムは、角かっこ [ ] で囲まれます。
  • braces — 各項目をかっこ { } で囲む。
  • parens — 各アイテムをかっこ ( ) で囲む。
  • pipe — 各アイテムをパイプで区切る。
  • anything — 入力する値によってそれぞれが区切られます。テキストをセパレーターとして入力できます (例: 「***」)。カスタム セパレーターを使用している場合、テキストは入力されたとおりに表示されることに注意してください。文字を区切る追加スペースなどは入りません。

Minimum Heading Level

1

TOC リストを開始する最大見出しレベルを選択します。たとえば、2 と入力すると、レベル 2 以下の見出しが含まれますが、レベル 1 の見出しは含まれません。

最大見出しレベル

7

含める最小の見出しレベルを指定します。たとえば、2 と入力すると、レベル 1 および 2 の見出しが含まれますが、レベル 3 以下の見出しは含まれません。

見出しを含める

 

Filter headings to include according to specific criteria. You can use wildcard characters. See Sun's Regex documentation for examples of constructing regular expression strings.

 

見出しを除外する

 

Filter headings to enclude according to specific criteria. You can use wildcard characters. See Sun's Regex documentation for examples of constructing regular expression strings.

 

印刷用

オン

既定では、TOC は印刷用に設定されています。このチェックボックスをクリアすると、ページを印刷した際に TOC は表示されなくなります。

CSS Class Name

 

お使いの CSS スタイル シートにカスタムの TOC がある場合、このパラメーターを使用して、指定した "class" 属性で <div> タグ内に TOC を出力できます。

以下の例は、この目次に基づいています。

フィルターされた目次

This example filters the headings to include those that contain 'Favourite', but excludes headings which end with 'Things'. The list is styled with Roman numerals.

パラメーター
リスト スタイルupper-roman
見出しを含める
Favourite*
見出しを除外する
.*Things

コンテンツの結果の表は次のようになります。

フラット リスト

この例では、すべての見出しをフィルターし、角括弧 (既定のリスト スタイル) で囲まれた「Unknowns」のフラット リストをレンダリングします。

パラメーター
出力タイプ
フラット
最大見出しレベル
2
見出しを含める
Unknown*

コンテンツの結果の表は次のようになります。

注意

  • When you use a Table of Contents macro in a template, you will see an error when you preview the template itself. But the Table of Contents macro works on the pages that people create from the template – the table of contents shows up after they have saved the page. (This is probably because the template is not defined as a page, and the Table of Contents macro works for pages only.)

  • Due to an outstanding issue in the Table of Contents macro (CONF-10619), the macro browser's Refresh function does not render any parameter modifications. Currently, the rendering of parameter value modifications to the Table of Contents macro occurs only after the page is saved.
  • Using HTML heading markup with the Table of Contents macro
    The Table of Contents macro cannot handle HTML heading markup on its own. Hence, if you use the HTML and HTML Include macros to render HTML heading markup in a Confluence page, the Table of Contents macro will not create a contents list out of these headings. (For more information about this issue, please refer to TOC-93.)
    However, if you insert an HTML anchor into each HTML heading on your page (based on the following syntax), the Table of Contents macro will incorporate these headings into your contents list.

    <h2><a name="pagename-headingname"></a>見出し名</h2>

    アンカー名の構文は、ハイフンで区切られたページ名と見出し名です。すべてのスペースを削除し、すべてのテキストを小文字に変換してください。すべての句読点を、対応する URL エンコードに変換してください。

コー​​ドの例

参照先:

  • ラベルなし