HFL Formats

HFL Formats

The real power of HFL lies in its ability to define and use formats. Formats are pre-defined files containing HFL code and maybe content that combine to create a certain effect. Most formats create a single low-level aspect of a page or effect. Other higher-level formats combine the effects of lower-level formats to create higher-level effects.

As an example, one might have a format 'navbar.dropdown2.hfmt' that creates a certain type of navigation menu bar that has a drop-down effect. A second format 'navbar.color_scheme5.hfmt' might apply a certain set of colors to that navbar. A third format 'main_content9.hfmt' might incorporate that navbar into the main body of a page. And a fourth format 'page_layout4.hfmt' might define the overall layout of a page, incorporating the body into its page design.

Each format can provide some amount of content, be it some HTML structure, some CSS styling, some javascript snippets, or perhaps some graphic images. Most content will probably be used internally with the page, to provide elements necessary for layout effects. Other content such as shared CSS, javascript or images will be stored externally in separate files or directories. User-friendly formats can also provide sample CSS or javascript code, that can be used as a starting point for customizing a look.

Each of the files or directories for content items needs to be collated and combined into central locations for their content types. One of the main features of formats is that they mark their content so that collation is simple. Typically, each format marks its provided content with a unique tag that stores it in a unique file or folder that is under a common shared directory. The collation step is a simple matter of merging each sub-file or directory into a single unit. Individual elements of one format can be updated without disturbing the order or content of elements of other formats. The result is that external content items like central .css files, javascript libraries and image directories can be created automatically from the formats.

Previous: HFL Transformations Next: HFL Language Differences