HtmlCompiler 1.0.5

by Ronald Koster

Table of Contents

Introduction and License
Properties
Includes
Usage



Main Table of Contents

HtmlCompiler 1.0.5

by Ronald Koster

Introduction

Html is very nice markup language. It has however, one anoying omittance: it has no include tag. How nice it be would if it had a tag like this: <include src="some_fragment.html"/>. Well now it does!

Write your html documents with this tag, run it through HtmlCompiler, aka. Htmlc, and you will get the desired output. HtmlCompiler is an Html compiler accepting Html files also containing include tags and ANT style properties.

Links:
Htmlc home page
Sources
Binaries

PS. These documentation files serve as a manual but and also an example of HtmlCompiler, aka. htmlc.

License

HtmlCompiler is licensed under the terms of the Apache License, Version 2.0.



Main Table of Contents

Properties

Table of Contents

ANT like properties
Escaping

ANT like properties

Like ANT properties can be included into a text like: ${<property.name>}.

Unlike ANT the properties must be provided in a properties file. See Usage.

Escaping

Is also done like ANT: by doubling '$'. So ${some_name} will be replaced with some_value, but $${some_name} will result in ${some_name}.



Main Table of Contents

Includes

Table of Contents

Include tag
Nesting

Include tag

A new tag, <include>, is introduced. It syntax is like:

<include src="some_filename" tag="some_tag_name"/>
The src attribute is mandatory, the tag attribute is optional. The include element is replaced by the content from some_filename. Or if the tag attribute is present, the content of the first element with tag name some_tag_name from some_filename. (Since it is a literal instead of a logical replace the tag is named include instead of import.)

NB.:

  1. some_filename must be relative to ${input.dir}.
  2. While properties or includes present:
    1. Replace properties.
    2. Replace <include> tags.
  3. some_tag_name can be any HTML or self invented tag name. They are harmless since HTML specifies unknown tags must be ignored. See <toc> element in ${input.dir}/index.html and ${input.dir}/print_version.html.

Nesting

See:



Main Table of Contents

Usage

Table of Contents

Syntax

Syntax

Usage (EBNF style):

java {-D<option.name>=<option.value>} org.htmlc.HtmlCompiler <file>{ <file>}
Or using an alternative notation (Regular Expression style):
java (-D<option.name>=<option.value>)* org.htmlc.HtmlCompiler <file>+
Possible values for <option.name>: