Class Assembler

java.lang.Object
org.apache.sis.internal.book.Assembler

public final class Assembler extends Object
Generates the developer guide from the given input file. This class performs the following processing:
  • Replace elements of the form <xi:include href="introduction.html"/> by content of the <body> element in the file given by the href attribute.
  • Complete <abbr> elements without title attribute by reusing the last title used for the same abbreviation. This automatic insertion is performed only for the first occurrence of that abbreviation after a h? element.
  • Replace the <!-- TOC --> comment by a table of content generated from all <h1>, <h2>, etc. found in the document.
See package javadoc for usage example.
Since:
0.7
Version:
1.3
Author:
Martin Desruisseaux (Geomatys)
  • Constructor Summary

    Constructors
    Constructor
    Description
    Assembler(File input)
    Creates a new assembler for the given input and output files.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    Generates the "static/book/en|fr/developer-guide.html" files from "source/developer-guide/[fr/]index.html" files.
    void
    run(File output)
    Assembles the document and writes to the destination.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • run

      public void run(File output) throws IOException, SAXException, BookException, TransformerException
      Assembles the document and writes to the destination.
      Parameters:
      output - the output file (e.g. "site/content/en/developer-guide.html").
      Throws:
      IOException - if an error occurred while reading or writing file.
      SAXException - if an error occurred while parsing an input XML.
      BookException - if an error was found in the content of the XML file.
      TransformerException - if an error occurred while formatting the output XML.
    • main

      public static void main(String[] args) throws Exception
      Generates the "static/book/en|fr/developer-guide.html" files from "source/developer-guide/[fr/]index.html" files. The only argument expected by this method is the root of sis-site project.
      Parameters:
      args - command-line arguments. Should contain exactly on value, which is the site root directory.
      Throws:
      Exception - if an I/O error, a XML parsing error or other kinds of error occurred.
      Since:
      0.8