Common Mobile Output

  Options

Common Mobile Output

How to build Mobile output without specifying Mobile platform. This section describes how to build html content without specifically build for particular mobile platform. Instead the output can view by a desktop web browser.

Note

When you build for a particular mobile platfrom, ant script will include additional requirement for that platform such as cordova-version.js.

  1. In a text editor, edit the build.properties file in the mobile directory and make the changes indicated by the comments.

    Important

    You must set appropriate values for xslt-processor-classpath, xercesImpl.jar, and xml-apis.jar.

    . Note that not all DocBook parameters are passed in to the xsls by the build.xml by default. You may need to modify the build.xml to pass in some DocBook parameters.

    • The path (relative to the build.xml file) to your input document. To use your own input document, create a build.xml file of your own and import this build.xml.

      input-xml=docsrc/readme.xml

    • The directory in which to put the output files. This directory is created if it does not exist.

      output-dir=www

    • The set of files to be excluded: Add excluded files separated by ","/ comma. Ex: ch02.*.html,ch03.html => will be excluded all files those are started with [ch02. and .html and any thing between] files and ch03.html file.

      indexer-excluded-files=menubar.html,settings.html,toc.html

    • The file name of the menu bar of mobile application

      mobile.menubar.filename=menubar.html

      The file name of the settings of mobile application

      mobile.settings.filename=settings.html

      The file name of the table of content of mobile application

      mobile.toc.filename=toc.html

    • If you are using a customization layer that imports mobile.xsl, use this property to point to it.

      stylesheet-path=${ant.file.dir}/xsl/mobile.xsl

    • If your document has image directories that need to be copied to the output directory, you can list patterns here. See the Ant documentation for fileset for documentation on patterns.

      input-images-dirs=images/**,figures/**,graphics/**

    • By default, the ant script assumes your images are stored in the same directory as the input-xml. If you store your image directories in another directory, specify it here. and uncomment this line.

      input-images-basedir=/path/to/image/location

    • Modify the follosing so that they point to your local copy of the jars indicated:

       * Saxon 6.5 jar
       * Xerces 2: xercesImpl.jar
       * xml-commons: xml-apis.jar
       
      xslt-processor-classpath=/usr/share/java/saxon-6.5.5.jar 
      xercesImpl.jar=/usr/share/java/xercesImpl.jar
      xml-apis.jar=/usr/share/java/xml-apis.jar
                    

    • For non-ns version only, this validates the document against a dtd.

      validate-against-dtd=true

    • The extension for files to be indexed (html/htm/xhtml etc.)

      html.extension=html

    • indexer-language is used to tell the search indexer which language the docbook is written. This will be used to identify the correct stemmer, and punctuations that differs from language to language. see the documentation for details. en=English, fr=French, de=German, zh=Chinese, ja=Japanese etc.

      mobile.indexer.language=en

    • Enables/Disables stemming Stemming allows better querying for the search

      enable.stemming=true

    • Set admon.graphics to 1 to user graphics for note, tip, etc.

      admon.graphics=0

      suppress.footer.navigation=0

  2. Test the package by running the command ant mobile -Doutput-dir=test-ouput at the command line in the mobile directory. It should generate a copy of this documentation in the doc directory. Open test-output\index.html the output in a browser. Once you have confirmed that the process worked, you can delete the test-output directory.

    Important

    The Saxon 6.5 jar should not be in your CLASSPATH when you generate the mobile output. If you have any problems, try running ant with an empty CLASSPATH.

  3. To process your own document, simply refer to this package from another build.xml in arbitrary location on your system:

    1. Create a new build.xml file that defines the name of your source file, the desired output directory, and imports the build.xml from this package. For example:

      <project>
        <property name="input-xml" value="path-to/yourfile.xml"/>
        <property name="input-images-dirs" value="images/** figures/** graphics/**"/>
        <property name="output-dir" value="path-to/desired-output-dir"/>
        <import file="path-to/docbook-mobile/build.xml"/>
      </project>
    2. From the directory containing your newly created build.xml file, type $ ant mobile.web to build your document. This mobile output can use to view by a web browser.

      Important

      The command $ ant mobile.web will create html output with out importing PhoneGap libraries. It can use to host our documentation on the web.