#Generating HTML or a PDF of Apache Impala (Incubating) Documentation

##Prerequisites: Make sure that you have a recent version of a Java JDK installed and that your JAVA_HOME environment variable is set. This procedure has been tested with JDK 1.8.0. See Setting JAVA_HOME at the end of these instructions.

  • Open a terminal window and run the following commands to get the Impala documentation source files from Git:

    Where doc_prototype is the branch where Impala documentation source files are uploaded.

  • Download the DITA Open Toolkit version 2.3.3 from the DITA Open Toolkit web site:

    [https://github.com/dita-ot/dita-ot/releases/download/2.3.3/dita-ot-2.3.3.zip] (https://github.com/dita-ot/dita-ot/releases/download/2.3.3/dita-ot-2.3.3.zip)

    Note: A DITA-OT 2.3.3 User Guide is included in the toolkit. Look for userguide.pdf in the doc directory of the toolkit after you extract it. For example, if you extract the toolkit package to the /Users/<username>/DITA-OT directory on Mac OS, you will find the userguide.pdf at the following location:

    /Users/<username>/DITA-OT/doc/userguide.pdf

##To generate HTML or PDF:

  1. In the directory where you cloned the Impala documentation files, you will find the following important configuration files in the docs subdirectory. These files are used to convert the XML source you downloaded from the Apache site to PDF and HTML:

    • impala.ditamap: Tells the DITA Open Toolkit what topics to include in the Impala User/Administration Guide. This guide also includes the Impala SQL Reference.
    • impala_sqlref.ditamap: Tells the DITA Open Toolkit what topics to include in the Impala SQL Reference.
    • impala_html.ditaval: Further defines what topics to include in the Impala HTML output.
    • impala_pdf.ditaval: Further defines what topics to include in the Impala PDF output.
  2. Extract the contents of the DITA-OT package into a directory where you want to generate the HTML or the PDF.

  3. Open a terminal window and navigate to the directory where you extracted the DITA-OT package.

  4. Run one of the following commands, depending on what you want to generate:

    • To generate HTML output of the Impala User and Administration Guide, which includes the Impala SQL Reference, run the following command:

      ./bin/dita -input <path_to_impala.ditamap> -format html5 -output <path_to_build_output_directory> -filter <path_to_impala_html.ditaval>

    • To generate PDF output of the Impala User and Administration Guide, which includes the Impala SQL Reference, run the following command:

      ./bin/dita -input <path_to_impala.ditamap> -format pdf -output <path_to_build_output_directory> -filter <path_to_impala_pdf.ditaval>

    • To generate HTML output of the Impala SQL Reference, run the following command:

      ./bin/dita -input <path_to_impala_sqlref.ditamap> -format html5 -output <path_to_build_output_directory> -filter <path_to_impala_html.ditaval>

    • To generate PDF output of the Impala SQL Reference, run the following command:

      ./bin/dita -input <path_to_impala_sqlref.ditamap> -format pdf -output <path_to_build_output_directory> -filter <path_to_impala_pdf.ditaval>

    Note: For a description of all command-line options, see the DITA Open Toolkit User Guide in the doc directory of your downloaded DITA Open Toolkit.

  5. Go to the output directory that you specified in Step 3 to view the HTML or PDF that you generated. If you generated HTML, open the index.html file with a browser to view the output.

Set your JAVA_HOME environment variable to tell your computer where to find the Java executable file. For example, to set your JAVA_HOME environment on Mac OS X when you the the 1.8.0_101 version of the Java Development Kit (JDK) installed and you are using the Bash version 3.2 shell, perform the following steps:

  1. Edit your /Users/<username>/.bash_profile file and add the following lines to the end of the file:

    Where jdk1.8.0_101.jdk is the version of JDK that you have installed. For example, if you have installed jdk1.8.0_102.jdk, you would use that value instead.

  2. Test to make sure you have set your JAVA_HOME correctly:

    • Open a terminal window and type: $JAVA_HOME/bin/java -version
    • Press return. If you see something like the following:Then you've successfully set your JAVA_HOME environment variable to the binary stored in /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home.