<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT index EMPTY>
<!ATTLIST index
file CDATA #REQUIRED>
索引文件的配置标记:
<!ELEMENT index (entry)* >
<!ELEMENT entry (entry | topic)* >
<!ATTLIST entry keyword CDATA #REQUIRED >
<!ELEMENT topic EMPTY >
<!ATTLIST topic href CDATA #REQUIRED >
<!ATTLIST topic title CDATA #IMPLIED >
索引元素
索引元素代表实例的实例。索引由条目组成。每个条目都与特定的关键字相对应。添加的所有索引都合并到帮助系统提供给用户的主索引中。构建索引时,将按字母顺序追加条目。
条目元素
条目元素代表索引的关键字。每个条目都可以包含若干个指向与关键字相关联的帮助主题的链接。条目还可以是其他条目(子条目)的容器,从而构造关键字层次结构。允许条目既是子条目的容器也包含主题。
主题元素
主题元素提供对关键字的相关帮助内容的引用。href 属性是与清单文件所属的插件相关的。如果您需要访问另一插件中的文件,可使用以下的语法:
<topic label="topic in another plug-in" href="../other.plugin.id/concepts/some_other_file.html" />
当有多个主题与一个相关联相关联时,可使用 title 属性来对帮助内容的链接进行命名。如果未指定此属性,则标题来自拥有该链接的 TOC。如果该链接未属于任何 TOC,则必须指定标题属性,否则标题将是未定义的。
(在 plugin.xml 文件中)
<extension point=
"org.eclipse.help.index"
>
<index file=
"index.xml"
/>
</extension>
(在 index.xml 文件中)
<index>
<entry keyword="Vehicle">
<topic href="inventory_of_wheel.html"/>
<entry keyword="Car">
<topic href="car.html"/>
</entry>
<entry keyword="Ship">
<topic href="ship.html"/>
</entry>
<entry keyword="Airplane">
<topic href="airplane.html" title="History of aviation"/>
<topic href="jet.html" title="Jet engine"/>
</entry>
</entry>
<entry keyword="Engine">
<entry keyword="Horse">
<topic href="horse.html"/>
</entry>
<entry keyword="Steamer">
<topic href="steamer.html"/>
</entry>
<entry keyword="Wankel engine">
<topic href="wankel.html"/>
</entry>
<entry keyword="Jet engine">
<topic href="jet.html"/>
</entry>
</entry>
<entry keyword="Electricity">
<topic href="electricity.html"/>
</entry>
</index>
国际化 可以对索引 XML 文件进行翻译,并且应该将生成的副本(包含已翻译的关键字)放在 nl/<language>/<country> 或 nl/<language> 目录中。<language> 和 <country> 表示语言环境代码中使用的双字母语言和国家或地区代码。例如,应该将繁体中文版本放在 nl/zh/TW 目录中。nl/<language>/<country> 目录的优先级高于 nl/<language>。仅当在 nl/<language>/<country> 目录中找不到文件时,才会使用 nl/<language> 中的文件。最后搜索插件的根目录。
Copyright (c) 2006 Intel Corporation and others.
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which
accompanies
this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html