ヘルプ・ボリューム内のトピック階層は、ホーム・トピックから始まります。各ヘルプ・ボリュームにはホーム・トピックが必ず 1 つなければなりません。ホーム・トピックの下にある第 1 レベルのサブトピックは、<chapter> または <s1> と入力されます。
サブトピックのレベルを追加する場合は、<s2> や <s3> などのように入力します。ヘルプタグのマークアップ言語は、<s1> から <s9> までの 9 つのトピック・レベルをサポートしています。しかし、第 3 または 第 4 レベルよりも下にある情報は、多くの読者にとって見つけにくいものになってしまいます。
ヘルプ・ボリュームが表示されたら、ヘルプ・ウィンドウはそのトピック・ツリーにトピックのリストを表示します。<chapter> か <s1...s9> のタグが入力されているトピックは、トピック・ツリーに自動的に表示されます。トピックをブラウズし表示するには、この方法が簡単です。
トピック内から他の関連情報を表示するには、ハイパーリンクを作成します。そのためには、それぞれのトピックに固有の ID を割り当て、ハイパーリンクがヘルプ情報内のどこでも特定の ID を参照できるようにします。
このサンプルに一致する階層を作成したいとします。
Tutorial for New Users Module 1: Getting Started Module 2: Creating Your First Report Module 3: Printing the Report Module 4: Saving Your Work and Quitting Task Reference Starting and Stopping To Start the Program To Quit the Program Creating Reports To Create a Detailed Report To Create a Summary Report Concepts for Advanced Users Using Report Hot Links Sharing Reports within a Workgroup Reference Command Summary Report Attributes Summary
その場合、ヘルプ・ボリュームのマークアップの概要は次のようになります。(各トピックの本文や各トピックの ID は省略します。)
<hometopic> Welcome to Report Master <chapter> Tutorial for New Users <s1> Module 1: Getting Started <s1> Module 2: Creating Your First Report <s1> Module 3: Printing the Report <s1> Module 4: Saving Your Work and Quitting <chapter> Task Reference <s1> Starting and Stopping <s2> To Start the Program <s2> To Quit the Program <s1> Creating Reports <s2> To Create a Detailed report <s2> To Create a Summary report <chapter> Concepts for Advanced Users <s1> Using Report Hot Links <s1> Sharing Reports within a Workgroup <chapter> Reference <s1> Command Summary <s1> Report Attributes Summary
ここでインデントが使用されているのは、ヘルプ・ボリュームの構造をより見やすくするためです。ソース・ファイルでインデントする必要はありません。
「トピックへのアクセス」では、トピックへの ID の割り当てについて説明しています。
「ハイパーリンクの作成」では、ハイパーリンクの作成方法について説明しています。
次のように <hometopic> 要素を使用します。
<hometopic> Title Body of topic.
メタ情報セクション (<metainfo>) を入れる場合、必ずその後ろにホーム・トピックを続けてください。
次に、タイトルと本文 1 文のみで構成されているホーム・トピックの例を示します。
<hometopic> Welcome to My Application Congratulations, you've entered the online help for My Application.
次の例は、4 つのサブトピックにハイパーリンクするホームトピックです。
<hometopic> Welcome to Report Master Welcome to the online help for Report Master. Choose one of the following hyperlinks: <list bullet> * <xref Tutorial> * <xref Tasks> * <xref Concepts> * <xref Reference> <¥list> If you need help, press F1.
上記のマークアップの出力は次のとおりです。
別のトピックを同じレベルに追加するには、同じ要素を繰り返します。
または、サブトピック (階層内でさらに 1 レベル下のトピック) を追加するには、前のトピックよりも 1 レベル下にある要素を使用します。
現在のトピックが <s1> である場合、<s2> を使用してサブトピックを入力します。
<s1 id=getting-started> Getting Started <s2 id=starting-the-program> Starting the Program Here's the body of the first subtopic. <s2 id=stopping-the-program> Stopping the Program Here's the body of the second subtopic.
2 番目の <s2> も <s1> のサブトピックです。
親子兄弟メタファは、階層内のトピック間の関係を記述するのに使用されることもあります。前の例では、<s1> トピックは両方の <s2> (「子」トピック) の「親」です。2 つの <s2> はお互いに「兄弟」になります。3 つのすべてのトピックは、ホーム・トピックの「子孫」です。