定義說明 topics

現在我們有可以建立 topics 檔的範例內容檔案。 topics 檔透過將 topic ID 和標籤對映到其中一個 HTML 檔中的某個參照,將索引鍵 進入點定義到 HTML 內容檔。 topics 檔就像一組 html 內容的目錄。

移轉至該平台的應用程式可以使用 topics 檔將進入點定義到現存的文件來重複使用該 文件。

一個外掛程式可以有一個或多個 topics 檔。 Topics 檔有時稱為導覽檔,因為它們說明如何瀏覽 html 內容。 我們的範例文件分成三大類:concepts、tasks 和 reference。 我們如何製作代表這個結構的 topics 檔?

我們可以製作一個大型 topics 檔,或為內容的每一個主要種類建立個別 topics 檔。 應該以文件團隊合作的方式做出這個決策。 如果另一位作者擁有每一個種類,建議您保留每一個種類的個別 topics 檔。 平台架構沒有指定它。

在這個範例中,我們會為每一個主要內容種類建立一個 topics 檔。 這麼少的檔案並不需要每一個種類有個別的 topics 檔。我們包括 這個範例,當做我們有很多檔案或不同的作者擁有每一個內容種類。

我們的檔案如下:

topics_Concepts.xml

<topics id="conceptsAll">

 <topic label="Concept1" href="doc/concepts/concept1.html">

     <topic label="Concept1_1" href="doc/concepts/concept1_1.html"/>

     <topic label="Concept1_2" href="doc/concepts/concept1_2.html"/>

 </topic> 
</topics>

topics_Tasks.xml

<topics id="tasksAll">

 <topic id="plainTasks" label="Plain Stuff">

 <topic label="Task1" href="doc/tasks/task1.html"/>

 <topic label="Task2" href="doc/tasks/task2.html"/>

 </topic> <topic id="funTasks" label="Fun Stuff" >

     <topic label="Task3_1" href="doc/tasks/task3_1.html"/>

     <topic label="Task3_2" href="doc/tasks/task3_2.html"/>

 </topic>

</topics>

topics_Ref.xml

<topics id="refAll">

 <topic label="Ref1" href="doc/ref/ref1.html"/>

 <topic label="Ref2" href="doc/ref/ref2.html"/>

</topics>

提供 Topics 作為 topics 儲存器元素的一部份。 topic 可以是內容的簡單鏈結。例如,"Task1" 對內容提供 labelhref 鏈結。topic 也可以是沒有內容的階 層式子項 topics 群組。例如,"Fun Stuff" 只有一個 label 和子項 topics,但沒有 href。Topics 也可以兩者都 有。"Concept1" 有 href 和子項 topics。

href 中的引數若作為鏈結使用時,是假設它相對於現行外掛程式。

開始將這些 topics 包括到整體文件 Web 時,我們會根據它們的 ID 參照它們。 只能操作含有 ID 的 topics。若要包括某特定 topic 的子項 topics,我們可以包括母項 topic。例如,包括 "Concept1" 也會包括 "Concept1_1" 和 "Concept1_2。 "

稍後我們會修改 plugin.xml 來新增指向這些檔案的實際構成要素。