-------------------------------------------------------------------------------
One method of doing Frames (aka Netscape v2).
The inital frame document needs to have a default non-frames
document while most of this information is also stored in various
sub-frame documents used.
The problem is ensuring all these documents line up, so they contain the
same indexing and data, as appropriate.
EG:
Frames document...
=======8<--------CUT HERE----------axes/crowbars permitted---------------
Framed Document
=======8<--------CUT HERE----------axes/crowbars permitted---------------
Rather than duplicate the information in multiple places, and
asking for trouble...
Wirth's Rule: Never store data in more than one place,
sooner or later you will update one and not the other.
I created a C Perprocessed file and use #ifdef lines to mark out
to what file information should be placed. Then I use CPP commands
like the following to generate the various documents.
/usr/lib/cpp -undef -P -DFRAME Doc.cpp | sed '/^$/d' Document.html
/usr/lib/cpp -undef -P -DINDEX Doc.cpp | sed '/^$/d' Index.html
/usr/lib/cpp -undef -P -DTOP Doc.cpp | sed '/^$/d' Top.html
The sed part about is not needed but included to remove extra
blank lines generated by cpp. Other documents types can be generated
from a common source.
I could have used m4 for this putpose, but found that m4 is more suited
to full marco applications and has troublesome quoting. It is especially
annoying to have a marco expanded when no marco was intended, particular
m4's builtin marcos.
Cpp is clean, and line based making it quick and simple to block out
various parts..
Here is a Cpp Example for the above...
This was cut down from the Frames method I use for the WWW AIcons
section. See the mirrors from
http://www.cit.gu.edu.au/images/Images.html
=======8<--------CUT HERE----------axes/crowbars permitted---------------
/* Doc.cpp (example frames cpp file)
**
** This is C Proprocessor generator to split this source file into
** a netscape ``FRAMES'' compatable set of files.
**
** Example File Generation...
** /usr/lib/cpp -undef -P -DFRAME Doc.cpp | sed '/^$/d' Document.html
** /usr/lib/cpp -undef -P -DINDEX Doc.cpp | sed '/^$/d' Index.html
** /usr/lib/cpp -undef -P -DTOP Doc.cpp | sed '/^$/d' Top.html
**
** Anthony Thyssen 20 April 1996
*/
Framed Document
/* Frame Format if possible */
#if ! defined(INDEX) && ! defined(TOP) && ! defined(EXT)
#endif
#if defined(INDEX)
#endif
/* Document Title */
#if defined(INDEX)
Doc Index
#elif defined(TOP)
Document Top Sheet (Framed)
#else
Document
Frameless browsers rule OK!''
#endif
/* General Links (in index) */
#if defined(FRAME) || defined(INDEX)
Up to Parent
#endif
/* Mirror Links (in top) */
#if defined(TOP)
Mirrors of This Document
#endif
#if defined(DEFAULT) || defined(TOP)
#endif
/* Main Document Links (index) */
#if defined(FRAME)
Chapters
#elif defined(INDEX)
Top Page
#endif
#if defined(DEFAULT) || defined(INDEX)
#endif
#if defined(FRAME)
#endif
/* Main Welcome (top) */
#if defined(FRAME) || defined(TOP)
Top Sheet Blurb Heading
Dated: 20 April, 1996
Author: Anthony Thyssen, <Anthony.Thyssen@gmail.com>
#if ! defined(INDEX) && ! defined(TOP)
#endif
=======8<--------CUT HERE----------axes/crowbars permitted---------------
-------------------------------------------------------------------------------