home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
footnote.zip
/
footnote.ih
next >
Wrap
Text File
|
1999-11-17
|
5KB
|
117 lines
;----------------------------------------------------------------------------
; MODULE NAME: FOOTNOTE.IH
;
; $Author: Dennis_Bareis $
; $Revision: 1.2 $
; $Date: 02 Oct 1999 18:40:42 $
; $Logfile: E:/DB/PVCS.IT/OS2/PPWIZARD/NESTCHK.H_V $
;
; DESCRIPTION: This is a simple header to make it easier to use
; footnotes in HTML a footnote is defined where required
; using the "FN" macro and then the macro "ExpandFootNotes"
; is used to list them.
;----------------------------------------------------------------------------
;--- Make sure only included once! ------------------------------------------
#ifndef HEADER_FOOTNOTE_IH
#define HEADER_FOOTNOTE_IH 99.321
#require 99.321
;-------------------------------------------------------------------------
;--- Footnote options, including code can override (USER OPTIONS) --------
;-------------------------------------------------------------------------
#ifndef FOOTNOTE_NUMBER_IN_TEXT
#define FOOTNOTE_NUMBER_IN_TEXT <SUP><??RxFootNoteCnt></SUP>
#endif
#ifndef FOOTNOTE_NUMBER_IN_LIST
#defineRexx FOOTNOTE_NUMBER_IN_LIST
RxFmtFnNumb = '<SUP>' || RxIndex || '</SUP>';
#defineRexx
#endif
#ifndef FOOTNOTE_BEFORE_EACH
#define FOOTNOTE_BEFORE_EACH <P>
#endif
#ifndef FOOTNOTE_BEFORE_TEXT_IN_LIST
#define FOOTNOTE_BEFORE_TEXT_IN_LIST
#endif
#ifndef FOOTNOTE_AFTER_EACH
#define FOOTNOTE_AFTER_EACH
#endif
#ifndef FOOTNOTE_FONTSTART
#define FOOTNOTE_FONTSTART <?NewLine><FONT Size="-1">
#endif
#ifndef FOOTNOTE_FONTEND
#define FOOTNOTE_FONTEND <?NewLine></FONT>
#endif
;--- Initialization ------------------------------------------------------
#RexxVar RxFootNoteCnt = 0
#RexxVar RxFooterTxtCnt = 0
;--- This macro is used to hold text of each footnote --------------------
;--- This macro is used to hold text of each footnote --------------------
#define FN \
#RexxVar RxFootNoteCnt + 1 -\
#define+ FN#_TMP {$Text} -\
#evaluate ^FN#<??RxFootNoteCnt>^ ^MacroGet('FN#_TMP')^ -\
<A NAME="FN_REF_<??RxFootNoteCnt>"> -\
<A HREF="#FN_TXT_<??RxFootNoteCnt>"><$FOOTNOTE_NUMBER_IN_TEXT></A>
;--- Expands Footnotes ---------------------------------------------------
#DefineRexx RexxExpandFootNotes
if RxFootNoteCnt = 0 then
RxFnText = '';
else
do
;--- Die on error (easy restriction to remove) -----------
if RxFooterTxtCnt <> 0 then
Error("Can't have more than one set of footnotes!");
;--- There is at least 1 footnote ------------------------
RxFnText = '<$FOOTNOTE_FONTSTART>';
RxAfter = '';
do RxIndex = 1 to RxFootNoteCnt
;--- Get previously stored Text ----------------------
RxFnThis = MacroGet('FN#' || RxIndex);
;--- Format Footnote Number --------------------------
<$FOOTNOTE_NUMBER_IN_LIST>;
;--- Output label (target for orig footnote #) -------
RxFnText = RxFnText || '<?NewLine><A NAME="FN_TXT_' || RxIndex || '">';
;--- Output text before each FN (normally '<P>') -----
RxFnText = RxFnText || '<$FOOTNOTE_BEFORE_EACH>';
;--- Output FN# as link to original footnote number --
RxFnText = RxFnText || '<A HREF="#FN_REF_' || RxIndex || '">' || RxFmtFnNumb || '</A>';
;--- Output possible seperator text ------------------
RxFnText = RxFnText || '<$FOOTNOTE_BEFORE_TEXT_IN_LIST>';
;--- Output the footnote text ------------------------
RxFnText = RxFnText || RxFnThis;
;--- Output stuff after text of footnote -------------
RxFnText = RxFnText || '<$FOOTNOTE_AFTER_EACH>';
end;
RxFnText = RxFnText || '<$FOOTNOTE_FONTEND><?NewLine>'
;--- Reset footnote counter ------------------------------
RxFooterTxtCnt = RxFooterTxtCnt + 1;
RxFootNoteCnt = 0;
end;
if RxFnText <> '' then
call ProcessNext RxFnText
#DefineRexx
#define ExpandFootNotes \
#evaluate ^^ ^<$RexxExpandFootNotes>^
;--- End of Header file -----------------------------------------------------
#endif