Package org.jppf.doc
Class HtmlDocGenerator
java.lang.Object
org.jppf.doc.HtmlDocGenerator
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.
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringStart of a template line comment.static final StringEnd of a content parameter value.static final StringStart of a content parameter value.static final StringSeparator for parameter name/value pair.static final StringEnd of a template parameter placeholder.static final StringStart of a template parameter placeholder.static final StringEnclosing sequence for parameter values.static final StringEnd of a template insertion.static final StringStart of a template insertion. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
TEMPLATE_START
Start of a template insertion.- See Also:
-
TEMPLATE_END
End of a template insertion.- See Also:
-
CONTENT_START
Start of a content parameter value.- See Also:
-
CONTENT_END
End of a content parameter value.- See Also:
-
EQUALS
Separator for parameter name/value pair.- See Also:
-
QUOTE
Enclosing sequence for parameter values.- See Also:
-
COMMENT
Start of a template line comment.- See Also:
-
PARAM_START
Start of a template parameter placeholder.- See Also:
-
PARAM_END
End of a template parameter placeholder.- See Also:
-
-
Constructor Details
-
HtmlDocGenerator
public HtmlDocGenerator()
-
-
Method Details
-
generatePage
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
Test this class.- Parameters:
args- the options to use.
-