Package org.jppf.doc

Class HtmlDocGenerator

java.lang.Object
org.jppf.doc.HtmlDocGenerator

public class HtmlDocGenerator extends Object
This class generates an HTML doc based on HTML templates and text files for the content.

The goal is to programmatically realize something like a client-side include for HTML documents. The templates are place holders inserted within the HTML code. They can hold parameters to make them more generic and reusable.
A template can be nested within another template.

Rationale: HTML docs often contain more code for the visual rendering of the content than for the content itself. For example, using rounded tables holding the actual content implies a lot of additional table constructs and ends up cluttering the code. This makes the documentation difficult to maintain.
This implementation provides a means to leave the additional rendering constructs in separate files, with the double benefit of making the doc easier to author, read and maintain, and making it possible to reuse the visual effects easily.
Author:
Laurent Cohen
  • Field Details

  • Constructor Details

    • HtmlDocGenerator

      public HtmlDocGenerator()
  • Method Details

    • generatePage

      public void generatePage(String source, String target, String templateFolder) throws Exception
      Generate a target HTML document for a document source, using a specified location for the templates to use.
      Parameters:
      source - the source document.
      target - the target HTML document.
      templateFolder - the location of the templates.
      Throws:
      Exception - if any error occurs while reading, parsing or writing any of the files.
    • main

      public static void main(String... args)
      Test this class.
      Parameters:
      args - the options to use.