OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Webhelp and Modular Docs


Hi Gregorio,
Give the attached build.xml a try. It includes support for resolving
xinclude. This version also supports profiling via 2-pass profiling (the
xinclude step also does the profiling).

Note that if you're doing complicated stuff like pulling in sections
from sibling directories and those sections contain images, there will
be problems. I'll need to do some fancy stuff to collect images in cases
like that, make sure there are no naming collisions, and put them all in
the output dir.

David

On 04/01/2011 11:27 AM, gpevaco@aol.com wrote:
> Hello everyone: 
>
>
>
> While attempting to use Webhelp to generate some HTML from Docbook files, I came upon a modular document, that contains XInclude references to other documents. Webhelp failed there. 
> Which leads me to ask, Is there any way that the Webhelp can process modular documents that use the xi:include? 
>
> If I actually combine the documents into a single XML file, then it works just fine. 
> However this defeats the purpose of having modular documents. 
> So the question is can Webhelp be used for modular documents?
>
>  
> Thank you in advance. 
>  
> /Gregorio 
>
>
>  
>

<project default="help" name="mainbuild">

  <dirname property="ant.file.dir" file="${ant.file.mainbuild}"/>
  <loadproperties srcFile="${ant.file.dir}/build.properties"/>
  <property name="webhelp.include.search.tab" value="true"/>
  <property name="xercesImpl" value="/usr/share/java/xercesImpl.jar"/>

  <property name="extensions.dir" value="${ant.file.dir}/../extensions"/>

    <path id="classpath">
        <pathelement location="${extensions.dir}/webhelpindexer.jar"/>
	<pathelement location="${extensions.dir}/lucene-analyzers-3.0.0.jar"/>
	<pathelement location="${extensions.dir}/lucene-core-3.0.0.jar"/>
    </path>

  <condition property="perform-validation-dtd">
	<equals arg1="${validate-against-dtd}" arg2="true"/>
  </condition>
  <condition property="do-search-indexing">
	<equals arg1="${webhelp.include.search.tab}" arg2="true"/>
  </condition>

  <target name="validate" if="perform-validation-dtd">
    <xmlvalidate file="${input-xml}" classname="org.apache.xerces.parsers.SAXParser"/>
  </target>

  <target name="chunk" depends="clean">
	
	<mkdir dir="${output-dir}"/>
	<tempfile property="xincluded-profiled.xml"/>
	<tempfile property="dummy.html"/>

	<xslt
	    in="${input-xml}"
	    out="${xincluded-profiled.xml}"
	    style="${ant.file.dir}/../profiling/profile.xsl">
	  <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration"
		       value="org.apache.xerces.parsers.XIncludeParserConfiguration"/>
	  <param name="profile.arch" expression="${profile.arch}" if="profile.arch"/>
	  <param name="profile.audience" expression="${profile.audience}" if="profile.audience"/>
	  <param name="profile.condition" expression="${profile.condition}" if="profile.condition"/>
	  <param name="profile.conformance" expression="${profile.conformance}" if="profile.conformance"/>
	  <param name="profile.lang" expression="${profile.lang}" if="profile.lang"/>
	  <param name="profile.os" expression="${profile.os}" if="profile.os"/>
	  <param name="profile.revision" expression="${profile.revision}" if="profile.revision"/>
	  <param name="profile.revisionflag" expression="${profile.revisionflag}" if="profile.revisionflag"/>
	  <param name="profile.role" expression="${profile.role}" if="profile.role"/>
	  <param name="profile.security" expression="${profile.security}" if="profile.security"/>
	  <param name="profile.status" expression="${profile.status}" if="profile.status"/>
	  <param name="profile.userlevel" expression="${profile.userlevel}" if="profile.userlevel"/>
	  <param name="profile.vendor" expression="${profile.vendor}" if="profile.vendor"/>
	  <param name="profile.wordsize" expression="${profile.wordsize}" if="profile.wordsize"/>
	  <param name="profile.attribute" expression="${profile.attribute}" if="profile.attribute"/>
	  <param name="profile.value" expression="${profile.value}" if="profile.value"/>
	</xslt>

	<xslt
	  in="${xincluded-profiled.xml}"
	  out="${dummy.html}"
	  style="${stylesheet-path}"
	  scanincludeddirectories="false"
	  classpath="${xslt-processor-classpath}">
	  <param name="webhelp.include.search.tab" expression="${webhelp.include.search.tab}"
		if="webhelp.include.search.tab"/>
	  <param name="output_file_name" expression="${output_file_name}"/>
	  <param name="webhelp.base.dir" expression="${output-dir}" if="output-dir"/>
	  <param name="webhelp.indexer.language" expression="${webhelp.indexer.language}" if="webhelp.indexer.language"/>
	</xslt>
	
	<delete file="${dummy.html}"/>
	<delete file="${xincluded-profiled.xml}"/>

	<!-- copy common content such as js files of tree, css etc. to template folder. They will be copied to doc folder. They are NOT page specific! -->
	<copy todir="${output-dir}">
	  <fileset dir="${ant.file.dir}/template">
		<include name="**/*"/>
		<exclude name="**/content/search/**"/>
	  </fileset>
	</copy>

	<!-- Very simple-minded copy to handle the source document's images -->
	<!-- TODO: Look at html help code that produces a manifest file...list of images -->
	<!--       Customize webhelp.xsl to produce ant file to copy images actually used? -->
	<dirname property="input-images-basedir" file="${input-xml}"/>
	<copy todir="${output-dir}/content" failonerror="false">
	  <fileset dir="${input-images-basedir}" includes="${input-images-dirs}" />
	</copy>
  </target>

  <target name="index" if="do-search-indexing">

	<copy todir="${output-dir}">
	  <fileset dir="${ant.file.dir}/template">
		<include name="**/*"/>
		<exclude name="**/content/search/*.props"/>
		<exclude name="**/content/search/stemmers/*"/>
	  </fileset>
	</copy>

	<!-- We separate this out so we only copy the stopwords list and stemmer for the indexer language -->
	<copy todir="${output-dir}">
	  <fileset dir="${ant.file.dir}/template">
		<include name="**/content/search/default.props"/>
		<include name="**/content/search/punctuation.props"/>
		<include name="**/content/search/${webhelp.indexer.language}*.props"/>
		<include name="**/content/search/stemmers/${webhelp.indexer.language}_stemmer.js"/>
	  </fileset>
	</copy>

	<!--taskdef name="indexertask"
	  classname="com.nexwave.nquindexer.IndexerMain">
	  <classpath refid="classpath"/>
	</taskdef-->

	<echo>Indexing html files in ${output-dir}/content</echo>

       <java classname="com.nexwave.nquindexer.IndexerMain"> 
	 <arg value="${output-dir}/content"/>
	 <arg value="${webhelp.indexer.language}"/>	
         <classpath>
	    <path refid="classpath"/>
	    <pathelement location="/usr/share/java/xercesImpl.jar"/>  	
	    <pathelement location="/usr/share/java/xml-apis.jar"/>  	 
         </classpath>
       </java>	
 
	<!--indexertask htmldir="${output-dir}/content" indexerLanguage="${webhelp.indexer.language}"/-->

	<delete>
	  <fileset dir="${output-dir}/content/search" includes="*.props"/>
	</delete>

  </target>

  <target name="webhelp" depends="validate,chunk,index"/>


  <target name="clean">
	<delete dir="${output-dir}"/>
  </target>

  <target name="help">
	<echo>
Usage:
webhelp:       Generates the document in webhelp format and indexes the content.
clean:         Deletes webhelp output directory.
index:         Indexes the content.
	</echo>
  </target>

</project>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]