HTP

Source code: ref/default.htp

Table of Contents
  htp.def
  macros.def
  htp.htt

<BLOCK body>

<H2>Using default files</H2>
<p>
Often you want to use the same templates, the same options, and the
same macros in all htp files in a certain project.  To support this
htp parses a default file that can contain the necessary template,
macro definitions.  It can also include other htp files.
</p>

<p>
At program start, htp will look for an environment variable called
<code>HTPDEF</code>.  This variable can be set to a specific file.
htp will load in this file and process it like any other, except that
htp will not generate any output from it.  In other words, it will
only cull macros, options, and other settings.  Plain text and other
HTML markups will be ignored and shouldn't be present in this file.
</p>

<p>
htp will then search the current directory for a file named
&quot;htp.def&quot;.  This file, called the project default file, is
also processed like the <code>HTPDEF</code> file.
</p>

<p> The file &quot;htp.def&quot; should contain all macros, metatags
(see next section), options and templates common to all files in the
directory.  That is, if you organize your HTML file groups in separate
directories, each directory has it's own project default file with
settings and macros particular to that project.</p>

<p>The use of a global <code>HTPDEF</code> file instead of project
default files makes it difficult to share projects with other people,
as they would need the same global configuration.  Using it is
therefore deprecated by now.  </p>

<h2>Organizing your files</h2>

<P>
htp has been designed to break apart two components required to
HTML files: design and content.  This is good as it allows you to
change your design without having to touch the content and to add new
content without having to think about the design.
</P>

<P> The design of your pages is best kept in a template file as seen
in the last section.  As mentioned earlier these reference manual is
also created from a template file.</p>

<P> Page content should be held in separate files, each using <manlink
HREF="file.html">
 <code>file include</code> or
<code>template</code></manlink> to point to a template file.  By using
<A HREF="default.html">global and project default files</A> and
keeping logical groupings of subject matter in separate directories,
this dissection of design and content becomes quite natural.</P>

<P>
Although htp does not enforce any file naming conventions, I've adopted
the following file extensions for my own sanity:

<dl>

<dt><STRONG>.htp</STRONG>:</dt>
<dd>Content file defining macros containing the textual content.  The
macros are expanded by the template file. </dd>

<dt><STRONG>.htt</STRONG>:</dt>
<dd>Template file describing page layout. </dd>

<dt><STRONG>.def</STRONG>:</dt>
<dd>Include file holding common macros and setting options. </dd>

<dt><STRONG>.hti</STRONG>:</dt>
<dd>Include file holding common content (when included from htp files)
or common layout parts (when included from templates).  </dd> </UL>
</P>

<p>So much about files.  In the <a href="metatag.html">next
section</a> you can learn how to customize htp to your own needs by
defining your own tags.</p>


</BLOCK>

  page source
  htp project
  htp homepage
hosted by
SourceForge.net
HTML coding Powered by htp
htp on-line reference / http://htp.sourceforge.net/ref/
Authors: Jim Nelson, Jochen Hoenicke, Michael Möller.
Maintainers: Jochen Hoenicke.

Copyright © 1995-96 Jim Nelson.
Copyright © 2001-2003 Jochen Hoenicke.
Permission to reproduce and distribute this hypertext document granted according to terms described in the License section.

last updated Tue Feb 22, 2011