Confluence 4.2 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
The Table of Contents macro scans the headings of the current Confluence page to dynamically create a table of contents from your page headings. This helps readers navigate lengthy pages by summarising the content structure and providing links to headings. Headings are indented progressively.
Using the Table of Contents Macro
ヒント: エディタ ツールバーにすばやくアクセスするには、[挿入] > [目次] を選択します。
目次マクロをページに追加する方法
- In the Confluence editor, choose Insert > Other Macros.
- Find and select the required macro.
オートコンプリートでマクロを素早く入力する方法
To edit an existing macro: Click the macro placeholder and choose Edit. This will display the parameters of the macro in the Macro Browser.
マクロ パラメーター
パラメータは、マクロ出力の内容や形式を制御するために設定するオプションです。
パラメーター | 既定 | 説明 |
|---|---|---|
出力タイプ | list |
|
Display Section Numbering | clear | 見出しにアウトライン ナンバリングを適用します。例: 1.1、1.2、1.3. |
リスト スタイル | なし | 各リスト項目のブレット ポイントのスタイルを選択します。有効な CSS スタイルを使用できます。 例:
|
Heading Indent |
| CSS の数に従って、リストのインデントを作成します。 |
Separator | brackets | このパラメーターはフラットリストにのみ適用されます。 次の値のいずれかを入力できます。
|
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" 属性で |
例
以下の例は、この目次に基づいています。
フィルターされた目次
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* |
コンテンツの結果の表は次のようになります。
注意
- 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>
The syntax for the anchor name is the page name and heading name separated by a hyphen, in which the page and heading names have all spaces removed and are converted to lowercase. If punctuation marks occur within a page or heading name, each mark should usually be converted to its URL escape code in the anchor name.
