Chapter 6. Recompiling the sources
Prev |  | Next

## Chapter 6. Recompiling the sources

Directory `doc_kit/src/org/scilab/doc_kit/` contains the source code of two utility classes needed by some of the above command-line tools:

HelpViewer.java

  The source code of `sciviewhelp`.

CopyConvert.java

  A preprocessor used as the first pass in `sci2html`, `sci2chm`, `sci2jh` and `sci2pdf`.

  This preprocessor:

  - Creates a ``flat' (entity references are expanded; XIncludes are not supported) copy of the XML document to be transformed.

  - If the source document contains an embedded MathML element (`imagedata/mml:math`), this element is extracted to a temporary file, then the temporary file is converted to a PNG image by the means of JEuclid. After doing this, the original `imagedata/mml:math` found in the source is replaced in the flat XML document by an `imagedata` element pointing to the generated PNG file (`imagedata/@fileref`).

  - Same for embedded SVG elements which are converted to PNG images by the means of Batik.

  - If the source document contains an `imagedata` element pointing to a MathML file (filename extension is "`.mml`"), this file is converted to PNG by the means of JEuclid. After doing that, the `imagedata` element contained in the flat XML document is made to point to the `.png` file rather than to the `.mml` file.

  - Same for `imagedata` elements pointing to SVG files (filename extension is "`.svg`" or "`.svgz`"), but in this case, it is Batik which is used to perform the conversion.

  - Same for `imagedata` elements pointing to "`.tex`" files (assumed to contain math equations), but in this case, it is TEX+Ghostscript which are used to perform the conversion.

    The `CopyConvert` preprocessor searches the following programs in the `PATH`: `latex`, `dvips`, `gs` on Unix/`gswin32c` on Windows, `ps2pdf`.

The above sources may be recompiled by running ant in the `doc_kit/src/` directory:

    C:\doc_kit/src> dir /w
    ...
    build.xml   [org]       [class]
    ...
    C:\doc_kit/src> ant
    Buildfile: build.xml

    init:

    compile:
    ...

Doing this rebuilds `sci_doc_kit.jar` in `doc_kit/lib/`.

Prev |  | Next
Chapter 5. The command-line tools | Home | Chapter 7. Companion tools