Guava

The Guava Tools

Example - test5.htt


Home  Computer Software  Guava Main Page  Guava Examples 

The following source code should be compiled with:
 
$ htt2html -o test5 -op t5_ test5.htt

 
/* test5.htt */

/* This is the start of the page template. */

#include "colours.inc"

/* _CONTENTS_ is a special macro that will be inserted into the
   contents page to produce the contents table entries.  The _C_LINK
   macro is defined automatically.  The _C_CONTENTS_ENTRY is defined
   in the header data for each page. */

#define _CONTENTS_ <P>Jump to <A HREF=_C_LINK>_C_CONTENTS_ENTRY</A>

<HTML>

<HEAD>
<TITLE> TITLESTRING </TITLE>
</HEAD>

<BODY BGCOLOR = BG_COLOUR
      TEXT    = TX_COLOUR
      VLINK   = VL_COLOUR
      LINK    = LN_COLOUR >

<HTML>

	/* This block inserts links back to the contents page on every
	   page except the contents page itself.  The PAGE macro is
	   defined automatically, and is zero for the index page. */

#if (PAGE != 0)
	/* In test4 we assumed that the default name 'index.html'
	   would be used for the contents page.  That is not the case
	   in test5, but we can use the _CONT_ macro, which is defined
	   automatically and always contains the name of the contents
	   page. */

	<P><A HREF=_CONT_>Back to the contents page.</A>
#endif

	/* Add links to the next and previous pages, but only if they
	   exist.  (_PREV_ isn't defined for the first page in the
	   document and _NEXT isn't defined for the last.) */
#ifdef _PREV_
	<P><A HREF=_PREV_>Go to the previous page.</A>
#endif

#ifdef _NEXT_
	<P><A HREF=_NEXT_>Go to the next page.</A>
#endif

	<P>This text will appear above the page text on every page.

	<PAGE>

	<P>This text will appear below the page text on every page.

</HTML>

/* This is the end of the page template. */


/* This is the page data for the contents page. */

/* Only macros whose names begin with the _C_ prefix are available for
   use in the _CONTENTS_ macro and in cross references. */

<HDR>
#define TITLESTRING Contents Page
<DATA>
<P> This is the contents list:
<CONTENTS>


/* This is the start of the page data for the other pages. */

<HDR>
#define TITLESTRING Page One Title
#define _C_CONTENTS_ENTRY Page One
<DATA>
<P>This is the text for page one.

/* Create a link to the third page. */
<P>This is a link to <A HREF=<REF:_C_LINK,_C_NUM=3>>page 3</A> 
created using the &lt;REF&gt; macro.


<HDR>
#define TITLESTRING Page Two Title
#define _C_CONTENTS_ENTRY Page Two
<DATA>
<P>This is the text for page two.

/* Display the contents table entry of the third page. */
<P>The third page contents table entry is 
<QUOTE><REF:_C_CONTENTS_ENTRY,_C_NUM=3><QUOTE>.


<HDR>
#define TITLESTRING Page Three Title
#define _C_CONTENTS_ENTRY Page Three
<DATA>
<P>This is the text for page three.

/* I'm not sure why you would want to cross-reference a page
   by its filename, but you can if you want to... */
<P>The page called t5_02.html is number <REF:_C_NUM,_C_LINK=t5_02.html>.
	

 
/* colours.inc */

#define BG_COLOUR "#006600"  /* Dark green */
#define TX_COLOUR "#FFFFFF"  /* White */
#define VL_COLOUR "#999999"  /* Grey  */
#define LN_COLOUR "#FFFFFF"  /* White */
	

 

This output will be produced:
 

test5.html
<!-- HTML generated at Wed Dec  1 23:00:53 1999.
hss2html by Steve Morphet 1999. -->
<HTML>
<HEAD>
<TITLE> Contents Page </TITLE>
</HEAD>
<BODY BGCOLOR = "#006600"
      TEXT    = "#FFFFFF"
      VLINK   = "#999999"
      LINK    = "#FFFFFF" >
<HTML>
	<P><A HREF=t5_01.html>Go to the next page.</A>
	<P>This text will appear above the page text on every page.
<P> This is the contents list:
<P>Jump to <A HREF=t5_01.html>Page One</A>
<P>Jump to <A HREF=t5_02.html>Page Two</A>
<P>Jump to <A HREF=t5_03.html>Page Three</A>
	<P>This text will appear below the page text on every page.
</HTML>
	

 

t5_01.html
<!-- HTML generated at Wed Dec  1 23:00:53 1999.
hss2html by Steve Morphet 1999. -->
<HTML>
<HEAD>
<TITLE> Page One Title </TITLE>
</HEAD>
<BODY BGCOLOR = "#006600"
      TEXT    = "#FFFFFF"
      VLINK   = "#999999"
      LINK    = "#FFFFFF" >
<HTML>
	<P><A HREF=test5.html>Back to the contents page.</A>
	<P><A HREF=test5.html>Go to the previous page.</A>
	<P><A HREF=t5_02.html>Go to the next page.</A>
	<P>This text will appear above the page text on every page.
<P>This is the text for page one.
<P>This is a link to <A HREF=t5_03.html>page 3</A> 
created using the &lt;REF&gt; macro.
	<P>This text will appear below the page text on every page.
</HTML>
	

 

t5_02.html
<!-- HTML generated at Wed Dec  1 23:00:53 1999.
hss2html by Steve Morphet 1999. -->
<HTML>
<HEAD>
<TITLE> Page Two Title </TITLE>
</HEAD>
<BODY BGCOLOR = "#006600"
      TEXT    = "#FFFFFF"
      VLINK   = "#999999"
      LINK    = "#FFFFFF" >
<HTML>
	<P><A HREF=test5.html>Back to the contents page.</A>
	<P><A HREF=t5_01.html>Go to the previous page.</A>
	<P><A HREF=t5_03.html>Go to the next page.</A>
	<P>This text will appear above the page text on every page.
<P>This is the text for page two.
<P>The third page contents table entry is 
"Page Three".
	<P>This text will appear below the page text on every page.
</HTML>
	

 

t5_03.html
<!-- HTML generated at Wed Dec  1 23:00:53 1999.
hss2html by Steve Morphet 1999. -->
<HTML>
<HEAD>
<TITLE> Page Three Title </TITLE>
</HEAD>
<BODY BGCOLOR = "#006600"
      TEXT    = "#FFFFFF"
      VLINK   = "#999999"
      LINK    = "#FFFFFF" >
<HTML>
	<P><A HREF=test5.html>Back to the contents page.</A>
	<P><A HREF=t5_02.html>Go to the previous page.</A>
	<P>This text will appear above the page text on every page.
<P>This is the text for page three.
<P>The page called t5_02.html is number 2.
	<P>This text will appear below the page text on every page.
</HTML>
	



Email: