docbook-apps

  • 1.  WebHelp search indexes

    Posted 02-03-2012 10:40
    At the MySQL Docs team, we build targets using make and xsltproc.
    There's no documentation how to do that for creating WebHelp output,
    though -- all the docs I've seen just explain how to build output with Ant.

    Anyway, I've got this working with xsltproc and our build infrastructure
    now, except for one thing: The search functionality works, but it
    doesn't find anything. I compared the output created by Ant (using the
    Oxygen Editor), and the one created by xsltproc, and found that the
    latter doesn't create any index files in the content/search/ directory.
    Those files are named index-1.js, index-2.js, and index-3.js. If they're
    created, that is. :-)

    The WebHelp documentation on this is very sparse, and again
    Ant-specific. It says:

    To build the indexer, you must have installed the JDK version 1.5 or
    higher and set the ANT_HOME environment variable. Run ant build-indexer
    to recompile nw-cms.jar

    In the builds.xml configuration file for Ant, I see quite a few lines
    relating to the indexer, but I don't know how to rewrite that for make.

    Any pointers how to run the indexer from our make-based environment?

    --
    Cheers,

    Stefan Hinz <stefan.hinz@oracle.com>, MySQL Documentation Manager

    Phone: +49-30-82702940, Fax: +49-30-82702941, http://dev.mysql.com/doc

    ORACLE Deutschland B.V.& Co. KG
    Registered Office: Riesstr. 25, 80992 Muenchen, Germany
    Commercial Register: Local Court Of Munich, HRA 95603
    Managing Director: Jürgen Kunz

    General Partner: ORACLE Deutschland Verwaltung B.V.
    Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
    Register Of Chamber Of Commerce: Midden-Niederlande, No. 30143697
    Managing Directors: Alexander van der Ven, Astrid Kepper, Val Maher



  • 2.  Re: [docbook-apps] WebHelp search indexes

    Posted 02-03-2012 11:53
    On Fri, Feb 3, 2012 at 4:09 PM, Stefan Hinz <stefan.hinz@oracle.com> wrote:
    > At the MySQL Docs team, we build targets using make and xsltproc. There's
    no
    > documentation how to do that for creating WebHelp output, though -- all
    the
    > docs I've seen just explain how to build output with Ant.
    >
    > Anyway, I've got this working with xsltproc and our build infrastructure
    > now, except for one thing: The search functionality works, but it doesn't
    > find anything. I compared the output created by Ant (using the Oxygen
    > Editor), and the one created by xsltproc, and found that the latter
    doesn't
    > create any index files in the content/search/ directory. Those files are
    > named index-1.js, index-2.js, and index-3.js. If they're created, that is.
    > :-)
    >
    > The WebHelp documentation on this is very sparse, and again Ant-specific.
    It
    > says:
    >
    > To build the indexer, you must have installed the JDK version 1.5 or
    higher
    > and set the ANT_HOME environment variable. Run ant build-indexer to
    > recompile nw-cms.jar

    Based on this, I assume you are using 1.76.1 of the stylesheets not a
    snapshot? Either way, since you are a user, recompiling of the indexer is
    not needed.

    AFAIR, 1.76.1 didn't have support for building webhelp via make. So, if
    needed you could have just copy the Makefile from a snapshot to your
    webhelp directory, and tweak as necessary. Invoke the indexer is currently
    done by 'ant index' command. The make command also calls ANT inside the
    script.

    >
    > In the builds.xml configuration file for Ant, I see quite a few lines
    > relating to the indexer, but I don't know how to rewrite that for make.

    I suppose you are not eager to install ANT, eh? :)

    Unfortunately, you can not run 1.76.1 without ANT. The indexer there is
    specific to ANT, because it uses ANT task definition (taskdef). The good
    news is that the current snapshot does not depend on ANT. So, if needed you
    could just read the ANT script and convert it to make. But you need to have
    Java installed (with JAVA_HOME properly set.)

    So, what you can do is just use the indexer from snapshot inside 1.76.1.
    Are you interested in trying this bridged webhelp? Or use the latest
    version?
    Former also shouldn't be a big deal. I can help you out there if needed.
    Possible steps that comes into my mind is,

    1. Replace webhelpindexer.jar in docbook-xsl-1.76.1/extensions/, and copy
    tagsoup-1.2.1.jar to the same directory.
    2. Then read the 'index' target in the ant build.xml. This one is pretty
    easier to understand, not like the previous.
    3. Adapt it to 'make'.

    Apart from the file copying, the java task looks like the following without
    all the clutter. [1] You can do the same via make by invoking java with the
    relevant parameters and the classpath set.

    ie. java -DhtmlDir=docs/content -DindexerLanguage="xx" -DfillTheRest=true
    -classpath path/to/lucene/1.jar:2.jar:/path/to/tagsoup/jar

    I probably have missed something here because I haven't tried this.

    [1]
    <java classname="com.nexwave.nquindexer.IndexerMain" fork="true">
    <sysproperty key="htmlDir" value="${output-dir}/content"/>
    <sysproperty key="indexerLanguage"
    value="${webhelp.indexer.language}"/>
    <sysproperty key="htmlExtension" value="${html.extension}"/>
    <sysproperty key="doStem" value="${enable.stemming}"/>
    <sysproperty key="tocFile" value="${toc.file}"/>