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.
HtmlCompiler is licensed under the terms of the Apache License, Version 2.0.
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.
Is also done like ANT: by doubling '$'. So ${some_name}
will be replaced with
some_value
, but $${some_name}
will result in ${some_name}
.
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.:
some_filename
must be relative to ${input.dir}.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.
<include src="${fragment}"/>
in ${input.dir}/properties.html
and its result in ${output.dir}/properties.html and ${output.dir}/print_version.html.
It results at both in the following text to be included: Hello world.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>: