After hours of Googling and banging my head against a wall, I finally managed to pre-index an Eclipse Help documentation plugin using just Ant and a minimal Eclipse distribution.
A heads up: the information here is somewhat skewed towards DITA-OT users, but I'm sure it's mostly useful even if you don't use DITA-OT.
Your Eclipse Help plugin's plugin.xml
must look something like this:
<?xml version="1.0" encoding="utf-8"?>
<plugin>
<extension point="org.eclipse.help.toc">
<toc file="toc.xml" primary="true"/>
<index path="index"/>
</extension>
<extension point="org.eclipse.help.index">
<index file="index.xml"/>
</extension>
</plugin>
The key is <index path="index"/>
. DITA-OT does not add this element by default, so you need to create a plugin that overrides org.dita.eclipsehelp/xsl/map2pluginImpl.xsl
and adds that element. Maybe DITA-OT should even add it by default?
Furthermore, you need a certain, minimal set of Eclipse JAR plugins in $ECLIPSE_HOME/plugins
to run org.eclipse.help.internal.base.ant.BuildHelpIndex
, which is the Java class that does the indexing. See eclipse-plugins.txt
for a list of plugins that worked for me on Eclipse 3.8. You might possibly be able to trim down the list of plugins even further, but eclipse-plugins.txt
has a set that will allow you to pre-index and run the Help System.
Also, I'm fairly sure you need to have something like this in your product plugin's plugin_customization.ini
for things to work correctly:
org.eclipse.help.base/locales=en
Once that's sorted out, you can use the targets in build.xml
to pre-index a documentation plugin that's in the folder specified in the output.dir
Ant property. Remember: this folder must contain plugin.xml
(with <index path="index"/>
as specified above) and the documentation HTML files.
If the pre-indexing process is successful, a folder called index
will appear in output.dir
, after which you can package the whole thing into a JAR file and deploy it into Eclipse Help System.