sdf-2.001/004075500042570001753000000000000672243774200121365ustar00iancmtr00000400000236sdf-2.001/t/004075500042570001753000000000000672243775100124015ustar00iancmtr00000400000236sdf-2.001/t/general/004075500042570001753000000000000672243775100140165ustar00iancmtr00000400000236sdf-2.001/t/general/lineno.sdf010064400042570001753000000011410672214703100157570ustar00iancmtr00000400000236# This file tests line numbering in messages Hello world UNKNOWNP[unknownp]Some text with an {{N[unknown]unknown attribute}} and [[unknown_var]] on the second and {{UNKNOWN:unknown object}} on the third line. !macro badstuff H9: Heading with a bad level Some text with an {{WXYZ:unknown tag}}. !endmacro !badstuff BADP[badp]Some more text with a {{N[bad]bad attribute}} on the second and {{BAD:bad object}} on the third line. # Try bad stuff inside a block !block appendix H0: Heading with a bad level Some text with an {{WXYZ:unknown tag}}. H9: Another heading with a bad level !endblock !badstuff sdf-2.001/t/general/checked/004075500042570001753000000000000672243774100154035ustar00iancmtr00000400000236sdf-2.001/t/general/checked/macro.log010064400042570001753000000000000622022557200171600ustar00iancmtr00000400000236sdf-2.001/t/general/checked/formats.log010064400042570001753000000000000622022557200175320ustar00iancmtr00000400000236sdf-2.001/t/general/checked/para1.log010064400042570001753000000000000622022557200170630ustar00iancmtr00000400000236sdf-2.001/t/general/checked/phrase.out010064400042570001753000000003500637716120400174030ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text with an {{1[]implicit}} style. N[orig_style='N']Some text with an {{B[]explicit}} style or {{U[]two}}. N[orig_style='N']Some text with an {{EX[] example}} style or {{EX[] two}}. sdf-2.001/t/general/checked/para2.log010064400042570001753000000000000622022557200170640ustar00iancmtr00000400000236sdf-2.001/t/general/checked/lineno.log010064400042570001753000000017000672214705300173570ustar00iancmtr00000400000236lineno.sdf warning, para. on 6: unknown paragraph style 'UNKNOWNP' lineno.sdf warning, para. on 6: unknown paragraph attribute 'unknownp' lineno.sdf warning, para. on 6: variable 'unknown_var' not defined lineno.sdf warning, para. on 6: unknown phrase attribute 'unknown' lineno.sdf warning, para. on 6: unknown phrase style 'UNKNOWN' lineno.sdf warning, macro on 18: unknown paragraph style 'H9' lineno.sdf warning, macro on 18: unknown phrase style 'WXYZ' lineno.sdf warning, para. on 20: unknown paragraph style 'BADP' lineno.sdf warning, para. on 20: unknown paragraph attribute 'badp' lineno.sdf warning, para. on 20: unknown phrase attribute 'bad' lineno.sdf warning, para. on 20: unknown phrase style 'BAD' lineno.sdf warning, block on 26: unknown phrase style 'WXYZ' lineno.sdf warning, block on 26: unknown paragraph style 'A9' lineno.sdf warning, macro on 35: unknown paragraph style 'H9' lineno.sdf warning, macro on 35: unknown phrase style 'WXYZ' sdf-2.001/t/general/checked/zero.log010064400042570001753000000000000622022557200170360ustar00iancmtr00000400000236sdf-2.001/t/general/checked/expr.log010064400042570001753000000000000622022557200170350ustar00iancmtr00000400000236sdf-2.001/t/general/checked/macro.out010064400042570001753000000001710637716117200172270ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']abc is A B C. N[orig_style='N']def is D E F. N[orig_style='N']xyz is X Y Y Y . sdf-2.001/t/general/checked/formats.out010064400042570001753000000003030672214564600176000ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Hello World in uppercase is HELLO WORLD. N[orig_style='N']Hello World in lowercase is hello world. N[orig_style='N']This file was last modified in 1999. sdf-2.001/t/general/checked/para1.out010064400042570001753000000003160637716117600171370ustar00iancmtr00000400000236__tuning[] __endtuning[] H1[orig_style='H1']First Level heading N[orig_style='N']A simple paragraph. H2[orig_style='H2']Second level heading N[orig_style='N']Another simple paragraph with more than 1 line. sdf-2.001/t/general/checked/para2.out010064400042570001753000000001110637716120200171170ustar00iancmtr00000400000236__tuning[] __endtuning[] __variable[]xx 64 N[orig_style='N']Hello world. sdf-2.001/t/general/checked/lineno.out010064400042570001753000000012330672214705300174060ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Hello world UNKNOWNP[orig_style='UNKNOWNP';unknownp=1]Some text with an {{N[unknown=1]unknown attribute}} and on the second and {{UNKNOWN[]unknown object}} on the third line. H9[orig_style='H9']Heading with a bad level N[orig_style='N']Some text with an {{WXYZ[]unknown tag}}. BADP[badp=1;orig_style='BADP']Some more text with a {{N[bad=1]bad attribute}} on the second and {{BAD[]bad object}} on the third line. N[orig_style='N']Some text with an {{WXYZ[]unknown tag}}. A9[orig_style='H9']Another heading with a bad level H9[orig_style='H9']Heading with a bad level N[orig_style='N']Some text with an {{WXYZ[]unknown tag}}. sdf-2.001/t/general/checked/zero.out010064400042570001753000000006720637716121000171040ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']0 N[orig_style='N']1 N[orig_style='N']2 __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]F1}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]F2}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']0 __cell[cols=1;rows=1] N[orig_style='N']a __row[]Body __cell[cols=1;rows=1] N[orig_style='N']1 __cell[cols=1;rows=1] N[orig_style='N']0 __endtable[] sdf-2.001/t/general/checked/expr.out010064400042570001753000000001020637716116000170730ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']xyz is 1 and !xyz is 0. sdf-2.001/t/general/checked/phrase.log010064400042570001753000000000000622022557200173410ustar00iancmtr00000400000236sdf-2.001/t/general/zero.t010064400042570001753000000000300647265372200151500ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/general/formats.sdf010064400042570001753000000005270647017662200161650ustar00iancmtr00000400000236# This file tests variable/expression formatting #!define FORMAT_UPPER 'tr/a-z/A-Z/, $_' #!define FORMAT_LOWER 'tr/A-Z/a-z/, $_' #!define FORMAT_YEAR '&FormatTime(\'$year\', $_)' !define abc 'Hello World' [[abc]] in uppercase is [[UPPER:abc]]. [[abc]] in lowercase is [[LOWER:abc]]. This file was last modified in [[YEAR:DOC_MODIFIED]]. sdf-2.001/t/general/expr.t010064400042570001753000000000300647265372200151470ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/general/lineno.t010064400042570001753000000000300647265372200154550ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/general/macro.sdf010064400042570001753000000002470622022557200156020ustar00iancmtr00000400000236# This file tests macro continuation !define abc "A B C" !define def \ "D E F" !define xyz \ "X " .\ "Y " x\ 3 abc is [[abc]]. def is [[def]]. xyz is [[xyz]]. sdf-2.001/t/general/zero.sdf010064400042570001753000000001270622022557200154550ustar00iancmtr00000400000236# This file tests "zero" paragraphs 0 1 2 !block table F1 F2 0 a 1 0 !endblock sdf-2.001/t/general/expr.sdf010064400042570001753000000001200622022557200154450ustar00iancmtr00000400000236# This file test expressions !define xyz xyz is [[xyz]] and !xyz is [[!xyz]]. sdf-2.001/t/general/para1.sdf010064400042570001753000000002350622022557200155020ustar00iancmtr00000400000236# This file tests paragraph tagging H1: First Level heading A simple paragraph. H2: Second level heading Another simple paragraph with more than 1 line. sdf-2.001/t/general/phrase.sdf010064400042570001753000000002720635340446200157650ustar00iancmtr00000400000236# This file tests object tagging Some text with an {{implicit}} style. Some text with an {{B: explicit}} style or {{U:two}}. Some text with an {{EX: example}} style or {{EX: two}}. sdf-2.001/t/general/para2.sdf010064400042570001753000000001320622022557200154770ustar00iancmtr00000400000236# This file tests a paragraph immediately after a pragma __variable[]xx 64 Hello world. sdf-2.001/t/general/para1.t010064400042570001753000000000300647265372200151750ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/general/para2.t010064400042570001753000000000300647265372200151760ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/general/macro.t010064400042570001753000000000300647265372200152720ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/general/formats.t010064400042570001753000000000300647265372200156440ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/general/phrase.t010064400042570001753000000000300647265372200154530ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/004075500042570001753000000000000672243775200135035ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/004075500042570001753000000000000672243775200150715ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/on_para.log010064400042570001753000000000660622022557200171760ustar00iancmtr00000400000236on_para.sdf warning, text prepended to 28: prepending sdf-2.001/t/macro/checked/class.log010064400042570001753000000010610632307675400166720ustar00iancmtr00000400000236class.sdf warning, filter on 14: unknown object 'D' in class 'widgets' class.sdf warning, para. on 31: unknown object 'F' in class 'widgets' (name EP) class.sdf warning, para. on 31: unknown object 'Omega' in class 'widgets' (long EP) class.sdf warning, para. on 35: unknown object 'F' in class 'widgets' (name EP) class.sdf warning, para. on 35: unable to expand object 'F' in class 'widgets' class.sdf warning, para. on 35: unknown object 'Omega' in class 'widgets' (long EP) class.sdf warning, para. on 35: unable to shrink object 'Omega' in class 'widgets' sdf-2.001/t/macro/checked/default.out010064400042570001753000000004760637716125200172450ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Variable num1 is 1. Variable num2 is 42. N[orig_style='N']Variable str1 is My favorite station. Variable str2 is Hello world. N[orig_style='N']Variable num3 is 28. Variable str3 is AA-My favorite station-ZZ. N[orig_style='N']Variable num2 is 42. Variable str2 is Hello world. sdf-2.001/t/macro/checked/inherit.log010064400042570001753000000003060661527233400172240ustar00iancmtr00000400000236inherit.sdf warning, macro on 22: unable to find library 'abc' inherit.sdf warning, macro on 26: unable to find library 'xyz/qwe' inherit.sdf warning, macro on 30: unable to find '/qwe/xyz/xyz.sdm' sdf-2.001/t/macro/checked/export.log010064400042570001753000000000000622022557200170640ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/undef.out010064400042570001753000000002240637716140000167040ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Variable num1 is 42. Variable str1 is Hello world. N[orig_style='N']Variable num1 is . Variable str1 is . sdf-2.001/t/macro/checked/elsif.out010064400042570001753000000000000622022557200166730ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/init.out010064400042570001753000000001750637716133600165630ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']The new document style is memo. N[orig_style='N']The final document style is memo. sdf-2.001/t/macro/checked/else.log010064400042570001753000000001370622022557200165060ustar00iancmtr00000400000236else.sdf error, macro on 6: !else not expected else.sdf error, macro on 14: !else not expected sdf-2.001/t/macro/checked/endtable.log010064400042570001753000000001740622022557200173350ustar00iancmtr00000400000236endtable.sdf error, macro on 4: !endtable not expected endtable.sdf error, EOF at 9: !endtable missing for !table on line 7 sdf-2.001/t/macro/checked/cell.log010064400042570001753000000001370622022557200164750ustar00iancmtr00000400000236cell.sdf error, macro on 4: !cell not expected cell.sdf error, macro on 10: !cell not expected sdf-2.001/t/macro/checked/on_phras.out010064400042570001753000000007330637716136000174260ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text including a {{MYTYPE[]mytype Object}} and another {{B[]bold Object}}. N[orig_style='N']Some more text including a {{U[jump='#mytype object']mytype Object}} and another {{B[]bold Object}}. N[orig_style='N']Yet another {{U[jump='#object']Object}}. H2[orig_style='H2']{{U[jump='#A Heading which is a MYTYPE']A Heading which is a MYTYPE}} N[orig_style='N']Hello {{1[]world}}1. I hope you are {{B[]really {{U[]well}}2}}3 today. sdf-2.001/t/macro/checked/endmacro.out010064400042570001753000000000000622022557200173610ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/table.log010064400042570001753000000000000622022557200166320ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/define.log010064400042570001753000000000000622022557200167750ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/macro.out010064400042570001753000000003720637716135000167140ustar00iancmtr00000400000236__tuning[] __endtuning[] H1[orig_style='H1']A heading before macro definition H1[orig_style='H1']A heading after macro definition N[orig_style='N']This is some text with several lines in it. N[orig_style='N']And a few more. N[orig_style='N']The end. sdf-2.001/t/macro/checked/catalog.out010064400042570001753000000006010637716123000172150ustar00iancmtr00000400000236__tuning[] __endtuning[] __table[format='1*';style='plain']1 __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{THING[jump='j1']ABC}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{THING[jump='j2']DEF}} __endtable[] N[orig_style='N']Testing masking ... __table[format='1*';style='plain']1 __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{THING[jump='j1']ABC}} __endtable[] sdf-2.001/t/macro/checked/endblock.out010064400042570001753000000000000622022557200173520ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/include.log010064400042570001753000000000000622022557200171660ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/execute.out010064400042570001753000000000660637716131200172530ustar00iancmtr00000400000236__tuning[] __endtuning[] E[orig_style='E']execute.sdf sdf-2.001/t/macro/checked/block.out010064400042570001753000000007000637716122200166760ustar00iancmtr00000400000236__tuning[] __endtuning[] E[orig_style='E']Hello world. E[orig_style='E'] E[orig_style='E']How are E[orig_style='E']you? H1[orig_style='H1']Heading 1 E[orig_style='E']Name Value E[orig_style='E']xyz 42 E[orig_style='E']abc "My favorite station" H2[orig_style='H2']Heading 2 E[orig_style='E']!block define E[orig_style='E']Name Value E[orig_style='E']xyz 42 E[orig_style='E']abc "My favorite station" E[orig_style='E']!endblock sdf-2.001/t/macro/checked/row.out010064400042570001753000000000000622022557200164000ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/endif.log010064400042570001753000000001560622022557200166440ustar00iancmtr00000400000236endif.sdf error, macro on 4: !endif not expected endif.sdf error, EOF at 20: !endif missing for !if on line 9 sdf-2.001/t/macro/checked/if.log010064400042570001753000000000000622022557200161410ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/line.log010064400042570001753000000001000622022557200164730ustar00iancmtr00000400000236line.sdf warning, macro on 43: the line number should be 43 now sdf-2.001/t/macro/checked/on_para.out010064400042570001753000000012340637716135400172340ustar00iancmtr00000400000236__tuning[] __endtuning[] H1[orig_style='H1']Heading 1 before on P1[orig_style='H1']Heading 1 after on P2[orig_style='H2']Heading 2 before on P2[orig_style='H2']HEADING 2 AFTER ON P3[orig_style='H3']Heading 3 before on P3[nopb=1;notoc=1;orig_style='H3']Heading 3 after on P4[orig_style='H4']Heading 4 after on P1[orig_style='H1']Another H1 P2[nopb=1;notoc=1;orig_style='H2']ANOTHER H2 P3[nopb=1;notoc=1;orig_style='H3']Another H3 E[orig_style='E']Some prepended example text. Note[id=2;orig_style='Note']This note should have an example paragraph prepended and a normal paragraph appended! N[orig_style='N']Some appended normal text. N[orig_style='N']Some ending text. sdf-2.001/t/macro/checked/class.out010064400042570001753000000020460637716124400167220ustar00iancmtr00000400000236__tuning[] __endtuning[] __table[format='0%-100%,1*';style='plain']2 __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{WID[jump='http://www.alpha.com']A}} __cell[cols=1;rows=1] N[orig_style='N']Alpha __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{WID[jump='http://www.gamma.com']C}} __cell[cols=1;rows=1] N[orig_style='N']Gamma __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{WID[]D}} __cell[cols=1;rows=1] N[orig_style='N'] __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{WID[jump='http://www.epsilon.com']E}} __cell[cols=1;rows=1] N[orig_style='N']Epsilon __endtable[] N[orig_style='N']This paragraph contains a short form ({{WID[jump='http://www.alpha.com']A}}) and a long form ({{WIDGET[jump='http://www.alpha.com']Alpha}}) of a widget. N[orig_style='N']This paragraph contains {{WIDGET[jump='http://www.alpha.com']Alpha}} and {{WID[jump='http://www.beta.com']B}} widgets. N[orig_style='N']This paragraph contains {{WID[]F}} and {{WIDGET[]Omega}} widgets. N[orig_style='N']This paragraph contains {{WID[]F}} and {{WIDGET[]Omega}} widgets. sdf-2.001/t/macro/checked/slide.log010064400042570001753000000000000622022557200166430ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/inherit.out010064400042570001753000000003130661527233400172500ustar00iancmtr00000400000236SDF include path is now: $SDFHOME/images. SDF include path is now: $SDFHOME/images. SDF include path is now: $SDFHOME/images. SDF include path is now: $SDFHOME/images. /qwe/xyz. __tuning[] __endtuning[] sdf-2.001/t/macro/checked/insert.log010064400042570001753000000000000622022557200170470ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/export.out010064400042570001753000000002310636603441000171200ustar00iancmtr00000400000236__tuning[] __endtuning[] __object[Name='num1';value=42]Variable __object[Name='str2';value='hello world']Variable __object[Name='num2';value=77]Variable sdf-2.001/t/macro/checked/else.out010064400042570001753000000000000622022557200165210ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/endtable.out010064400042570001753000000000000622022557200173470ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/cell.out010064400042570001753000000000000622022557200165100ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/table.out010064400042570001753000000032760637716137400167160ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text before. __table[format='0%-100%,1*';style='columns']2 __row[]Heading N[orig_style='N']Hdg 1 __cell[] N[orig_style='N']Hdg 2 __row[]Body N[orig_style='N']Row 1, col 1 __cell[] N[orig_style='N']Row 1, col 2 __row[]Body N[orig_style='N']Row 2, col 1 __cell[] N[orig_style='N']Row 2, col 2 __row[]Footing N[orig_style='N']Footing 1 __cell[] N[orig_style='N']Footing 2 __endtable[] N[orig_style='N']Some text in the middle. __table[format='1*';style='rows']1 __endtable[] __table[format='1*';style='grid']1 __row[]Body __row[]Body __endtable[] __table[format='0%-100%,0%-100%,1*';style='columns']3 N[orig_style='N']Some text __cell[] __cell[] N[orig_style='N']Some text in row 1, column 3 __row[]Body __cell[] __cell[] N[orig_style='N']Some text in row 2, column2 __endtable[] __table[format='0%-100%,1*';style='columns']2 N[orig_style='N']Text in first table __row[]Body N[orig_style='N']Row 2, column 1 __cell[] N[orig_style='N']Row 2, column 2 start __table[format='0%-100%,1*';style='columns']2 N[orig_style='N']Text in second table __row[]Body N[orig_style='N']Text in second table __endtable[] N[orig_style='N']Row 2, column 2 end __row[]Body N[orig_style='N']hello world __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Body __cell[] N[orig_style='N']This is a paragraph with a few lines. __cell[] N[orig_style='N']This is: LU1[orig_style='LU1']a list LU1[orig_style='LU1']with two entries. N[orig_style='N']And another paragraph. __row[]Body __cell[] N[orig_style='N']simple cell __cell[] N[orig_style='N']And another multi-line cell with lots and lots and lots of text. N[orig_style='N']The quick brown fox jumped over the slow green frog. __endtable[] sdf-2.001/t/macro/checked/define.out010064400042570001753000000003340637716126000170430ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Variable num1 is 1. Variable num2 is 42. N[orig_style='N']Variable str1 is My favorite station. N[orig_style='N']Variable num2 is 28. Variable str2 is AA-My favorite station-ZZ. sdf-2.001/t/macro/checked/default.log010064400042570001753000000000000622022557200171670ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/include.out010064400042570001753000000002210637716132600172320ustar00iancmtr00000400000236__tuning[] __endtuning[] E[orig_style='E']# This file tests the include macro E[orig_style='E'] E[orig_style='E']!include "include.sdf"; example sdf-2.001/t/macro/checked/undef.log010064400042570001753000000001700622022557200166540ustar00iancmtr00000400000236undef.sdf warning, para. on 12: variable 'num1' not defined undef.sdf warning, para. on 12: variable 'str1' not defined sdf-2.001/t/macro/checked/elsif.log010064400042570001753000000002650622022557200166620ustar00iancmtr00000400000236elsif.sdf error, macro on 6: argument 'value' missing for macro 'elsif' elsif.sdf error, macro on 6: !elsif not expected elsif.sdf error, macro on 15: !elsif found after else macro sdf-2.001/t/macro/checked/init.log010064400042570001753000000001340622022557200165160ustar00iancmtr00000400000236init.sdf warning, macro on 7: 'OPT' variable 'OPT_STYLE' is read-only - ignoring definition sdf-2.001/t/macro/checked/endif.out010064400042570001753000000000000622022557200166560ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/line.out010064400042570001753000000001130637716134600165400ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']The file name is now myfile.xyz. sdf-2.001/t/macro/checked/on_phras.log010064400042570001753000000001000622022557200173550ustar00iancmtr00000400000236on_phras.sdf warning, para. on 5: unknown phrase style 'MYTYPE' sdf-2.001/t/macro/checked/endmacro.log010064400042570001753000000002020622022557200173370ustar00iancmtr00000400000236endmacro.sdf error, macro on 4: endmacro macro not expected endmacro.sdf error, EOF at 20: !endmacro missing for !macro on line 9 sdf-2.001/t/macro/checked/slide.out010064400042570001753000000006410637716137000167140ustar00iancmtr00000400000236__tuning[] __endtuning[] H2[orig_style='H2']Heading 2 H3[orig_style='H3']Heading 3 H1[orig_style='H1']Before H3[orig_style='H2']Heading 2 H4[orig_style='H3']Heading 3 H1[orig_style='H1']After H2[orig_style='H2']Heading 2 H3[orig_style='H3']Heading 3 H1[orig_style='H1']Before H4[orig_style='H2']Heading 2 H5[orig_style='H3']Heading 3 H1[orig_style='H1']After H2[orig_style='H2']Heading 2 H3[orig_style='H3']Heading 3 sdf-2.001/t/macro/checked/macro.log010064400042570001753000000000000622022557200166440ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/catalog.log010064400042570001753000000000000632311443000171470ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/execute.log010064400042570001753000000000000622022557200172050ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/endblock.log010064400042570001753000000002020622022557200173300ustar00iancmtr00000400000236endblock.sdf error, macro on 4: endblock macro not expected endblock.sdf error, EOF at 20: !endblock missing for !block on line 9 sdf-2.001/t/macro/checked/insert.out010064400042570001753000000001400637716134200171110ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Variable varname is abc. Variable abc is hello world. sdf-2.001/t/macro/checked/block.log010064400042570001753000000000000622022557200166350ustar00iancmtr00000400000236sdf-2.001/t/macro/checked/row.log010064400042570001753000000001330622022557200163610ustar00iancmtr00000400000236row.sdf error, macro on 4: !row not expected row.sdf error, macro on 10: !row not expected sdf-2.001/t/macro/checked/if.out010064400042570001753000000007160637716132200162120ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Monday's weather will be fine and hot with an afternoon thunderstorm. N[orig_style='N']No information for Tuesday. N[orig_style='N']Sydney will be fine on Wednesday. N[orig_style='N']Thursday's weather will be fine and hot with an afternoon thunderstorm. N[orig_style='N']No information for Friday. N[orig_style='N']Inside abc. N[orig_style='N']Inside xyz N[orig_style='N']Inside abc. N[orig_style='N']Else part of xyz. sdf-2.001/t/macro/on_para.sdf010064400042570001753000000015360626727767000156270ustar00iancmtr00000400000236# This file tests the on macro (for paragraphs) # Try changing the style H1: Heading 1 before on !on paragraph '';; $style =~ s/H/P/ H1: Heading 1 after on # Try conditionally changing the text H2: Heading 2 before on !on paragraph 'H2';; $text =~ tr/a-z/A-Z/ H2: Heading 2 after on # Try conditionally setting some attributes H3: Heading 3 before on !on paragraph 'H[23]';; $attr{'notoc'} = 1; $attr{'nopb'} = 1 H3: Heading 3 after on H4: Heading 4 after on H1: Another H1 H2: Another H2 H3: Another H3 # Try prepending/appending some text !on paragraph 'Note';; $attr{'id'}++; &PrependText('E:Some prepended example text.', '!message "prepending"; "Warning"') !on paragraph 'Note';; $attr{'id'}++; &AppendText('N:Some appended normal text.') Note: This note should have an example paragraph prepended and a normal paragraph appended! Some ending text. sdf-2.001/t/macro/block.t010064400042570001753000000000300647265372200147470ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/if.sdf010064400042570001753000000030410622022557200145560ustar00iancmtr00000400000236# This file tests conditional text # Test the if section !define CITY 'Brisbane' !if &Var("CITY") eq 'Brisbane' Monday's weather will be fine and hot with an afternoon thunderstorm. !else No information for Monday. !endif # Test the else section !define CITY 'Sydney' !if &Var("CITY") eq 'Brisbane' Tuesday's weather will be fine and hot with an afternoon thunderstorm. !else No information for Tuesday. !endif # Test the elsif section !define CITY 'Sydney' !if &Var("CITY") eq 'Brisbane' Wednesday's weather will be fine and hot with an afternoon thunderstorm. !elsif &Var("CITY") eq 'Sydney' Sydney will be fine on Wednesday. !else No information for Wednesday. !endif # Test the if section when an elsif is present !define CITY 'Brisbane' !if &Var("CITY") eq 'Brisbane' Thursday's weather will be fine and hot with an afternoon thunderstorm. !elsif &Var("CITY") eq 'Sydney' Sydney will be fine on Thursday. !else No information for Thursday. !endif # Test the else section when an elsif is present !define CITY 'Melbourne' !if &Var("CITY") eq 'Brisbane' Friday's weather will be fine and hot with an afternoon thunderstorm. !elsif &Var("CITY") eq 'Sydney' Sydney will be fine on Friday. !else No information for Friday. !endif # Test nested stuff - if inside an if !define abc !define xyz !if abc Inside abc. !if xyz Inside xyz !else Else part of xyz. !endif !else Else part of abc. !endif # Test nested stuff - else inside an if !define abc !define xyz 0 !if abc Inside abc. !if xyz Inside xyz !else Else part of xyz. !endif !else Else part of abc. !endif sdf-2.001/t/macro/else.t010064400042570001753000000000300647265372200146050ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/export.t010064400042570001753000000000300647265372200151760ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/execute.t010064400042570001753000000000300647265372200153170ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/undef.sdf010064400042570001753000000004620622022557200152650ustar00iancmtr00000400000236# This file tests the undef macro # define some values !define num1 42 !define str1 "Hello world" Variable num1 is [[num1]]. Variable str1 is [[str1]]. # now undefine them !undef num1 !undef str1 Variable num1 is [[num1]]. Variable str1 is [[str1]]. # try undefining a non-existent variable !undef num2 sdf-2.001/t/macro/inherit.sdf010064400042570001753000000010710647342107000156240ustar00iancmtr00000400000236# Test the inherit macro # Define a macro to dump the current include path in terms of # the current library directory !block script sub dump_path_Macro { local($sdfhome, $igc); $sdfhome = $'app_lib_dir; print "SDF include path is now:\n"; for $igc (@include_path) { $igc =~ s/$sdfhome/\$SDFHOME/; print "$igc.\n"; } } !endblock # Show the initial path !dump_path # Try a simple name !inherit "abc" !dump_path # Try a name with several parts !inherit "xyz/qwe" !dump_path # Try an absolute path !inherit "/qwe/xyz" !dump_path sdf-2.001/t/macro/elsif.sdf010064400042570001753000000004360622022557200152670ustar00iancmtr00000400000236# This file tests the elsif macro Some starting text. # Test an unexpected elsif (should generate an error) !elsif Some middle text. !if abc Inside abc. !else Inside else. # Test another unexpected elsif (should generate an error) !elsif xyz Inside elsif. !endif Some ending text. sdf-2.001/t/macro/on_phras.sdf010064400042570001753000000011020622022557200157650ustar00iancmtr00000400000236# This file tests the on macro (phrases) !on phrase '';; $text =~ s/object/Object/ Some text including a {{MYTYPE:mytype object}} and another {{B:bold object}}. # Try conditionally setting an attribute and changing the style !on phrase 'MY\w*';; $attr{'jump'} = "#$text"; $style = 'U' Some more text including a {{MYTYPE:mytype object}} and another {{B:bold object}}. Yet another {{MY:object}}. H2[obj="MYTYPE"] A Heading which is a MYTYPE # Try appending to a phrase !on phrase '';; $append .= ++$igc_count Hello {{world}}. I hope you are {{B:really {{U:well}}}} today. sdf-2.001/t/macro/slide.t010064400042570001753000000000300647265372400147570ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/endmacro.sdf010064400042570001753000000004650622022557200157570ustar00iancmtr00000400000236# This file tests the endmacro macro # Test an unexpected endmacro (should generate an error) !endmacro Some text. # Test a macro will no matching endmacro (should generate an error) !macro xyz Some text inside macro xyz. !macro abc This is some text with several lines in it. And a few more. !endmacro sdf-2.001/t/macro/endblock.sdf010064400042570001753000000004650622022557200157500ustar00iancmtr00000400000236# This file tests the endblock block # Test an unexpected endblock (should generate an error) !endblock Some text. # Test a block will no matching endblock (should generate an error) !block sdf Some text inside block xyz. !block sdf This is some text with several lines in it. And a few more. !endblock sdf-2.001/t/macro/insert.sdf010064400042570001753000000003260622022557200154670ustar00iancmtr00000400000236# This file tests the insert macro # define a variable with an arbitrary name !define varname "abc" !insert "define " . &Var("varname") . " 'hello world'" Variable varname is [[varname]]. Variable abc is [[abc]]. sdf-2.001/t/macro/else.sdf010064400042570001753000000003640622022557200151150ustar00iancmtr00000400000236# This file tests the else macro Some starting text. # Test an unexpected else (should generate an error) !else Some middle text. !if abc Inside abc. !endif # Test another unexpected else (should generate an error) !else Some ending text. sdf-2.001/t/macro/macro.sdf010064400042570001753000000003220622022557200152600ustar00iancmtr00000400000236# This file tests the macro macro H1: A heading before macro definition !macro abc This is some text with several lines in it. And a few more. !endmacro H1: A heading after macro definition !abc The end. sdf-2.001/t/macro/cell.sdf010064400042570001753000000001770626727672000151220ustar00iancmtr00000400000236# This file tests the cell macro # Try an unexpected cell !cell # Try another unexpected cell !table 1 !cell !endtable !cell sdf-2.001/t/macro/insert.t010064400042570001753000000000300647265372400151630ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/line.t010064400042570001753000000000300647265372400146060ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/include.sdf010064400042570001753000000001050622022557200156010ustar00iancmtr00000400000236# This file tests the include macro !include "include.sdf"; example sdf-2.001/t/macro/inherit.t010064400042570001753000000000300647265372400153210ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/elsif.t010064400042570001753000000000300647265372200147570ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/block.sdf010064400042570001753000000006620622022557200152600ustar00iancmtr00000400000236# This file tests blocks # a simple block !block example Hello world. How are you? !endblock # nested blocks where the inner one is executed !block sdf H1: Heading 1 !block example Name Value xyz 42 abc "My favorite station" !endblock H2: Heading 2 !endblock # nested blocks where the inner one is NOT executed !block example !block define Name Value xyz 42 abc "My favorite station" !endblock !endblock sdf-2.001/t/macro/on_para.t010064400042570001753000000000300647265372400152760ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/undef.t010064400042570001753000000000300647265372400147600ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/include.t010064400042570001753000000000300647265372400153020ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/if.t010064400042570001753000000000300647265372400142550ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/line.sdf010064400042570001753000000002530626730003200151050ustar00iancmtr00000400000236# This file tests the line and message macros !line 42 !message "the line number should be 43 now"; "Warning" !line 0; "myfile.xyz" The file name is now [[FILE_SHORT]]. sdf-2.001/t/macro/class.t010064400042570001753000000000300647265372200147620ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/class.sdf010064400042570001753000000015720622022557200152740ustar00iancmtr00000400000236# This file tests the class macro !class widgets 'WID,WIDGET' # Define some objects !block widgets; data; root="http://www." Name Long Jump A Alpha alpha.com B Beta beta.com C Gamma gamma.com !endblock # Now insert a table of them !block widgets Name,Jump,Long A C D E,http://www.epsilon.com,Epsilon !endblock # Hypertext should be generated for the object below This paragraph contains a short form ({{WID:A}}) and a long form ({{WIDGET:Alpha}}) of a widget. # Try short <-> long form conversion This paragraph contains {{WID[expand]A}} and {{WIDGET[shrink]Beta}} widgets. # Try unknown objects - should produce warnings This paragraph contains {{WID:F}} and {{WIDGET:Omega}} widgets. # Try short <-> long form conversion on unknown objects This paragraph contains {{WID[expand]F}} and {{WIDGET[shrink]Omega}} widgets. sdf-2.001/t/macro/endblock.t010064400042570001753000000000300647265372200154360ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/table.t010064400042570001753000000000300647265372400147460ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/macro.t010064400042570001753000000000300647265372400147600ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/endtable.sdf010064400042570001753000000001710626727522400157510ustar00iancmtr00000400000236# This file tests the endtable macro # Try an unexpected end !endtable # Try a missing end !table 1 !table 1 !endtable sdf-2.001/t/macro/row.t010064400042570001753000000000300647265372400144660ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/catalog.t010064400042570001753000000000300647265372200152670ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/define.t010064400042570001753000000000300647265372200151070ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/table.sdf010064400042570001753000000020210626727505400152570ustar00iancmtr00000400000236# This file tests the table macro Some text before. !table 2 !row "Heading" Hdg 1 !cell Hdg 2 !row Row 1, col 1 !cell Row 1, col 2 !row "Body" Row 2, col 1 !cell Row 2, col 2 !row "Footing" Footing 1 !cell Footing 2 !endtable Some text in the middle. # Try an empty table !table 1; style='rows' !endtable # Try some empty rows !table 1; style='grid' !row !row !endtable # Try some empty cells !table 3 Some text !cell !cell Some text in row 1, column 3 !row !cell !cell Some text in row 2, column2 !endtable # Try a nested table !table 2 Text in first table !row Row 2, column 1 !cell Row 2, column 2 start !table 2 Text in second table !row Text in second table !endtable Row 2, column 2 end !row hello world !endtable # Try some multi-line cells !table 2 !row !cell This is a paragraph with a few lines. !cell This is: * a list * with two entries. And another paragraph. !row !cell simple cell !cell And another multi-line cell with lots and lots and lots of text. The quick brown fox jumped over the slow green frog. !endtable sdf-2.001/t/macro/cell.t010064400042570001753000000000300647265372200145740ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/default.sdf010064400042570001753000000010150622022557200156030ustar00iancmtr00000400000236# This file tests the default macro # test numbers !default num1 !default num2 42 Variable num1 is [[num1]]. Variable num2 is [[num2]]. # test strings !default str1 "My favorite station" !default str2 "Hello world" Variable str1 is [[str1]]. Variable str2 is [[str2]]. # test expressions !default num3 42 * 2 / 3 !default str3 'AA-' . &Var("str1") . '-ZZ' Variable num3 is [[num3]]. Variable str3 is [[str3]]. # test re-definition !default num2 24 !default str2 str3 Variable num2 is [[num2]]. Variable str2 is [[str2]]. sdf-2.001/t/macro/row.sdf010064400042570001753000000001710626727515000150000ustar00iancmtr00000400000236# This file tests the row macro # Try an unexpected row !row # Try another unexpected row !table 1 !row !endtable !row sdf-2.001/t/macro/default.t010064400042570001753000000000300647265372200153010ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/endif.t010064400042570001753000000000300647265372200147420ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/endif.sdf010064400042570001753000000004300622022557200152440ustar00iancmtr00000400000236# This file tests the endif if # Test an unexpected endif (should generate an error) !endif Some text. # Test an if will no matching endif (should generate an error) !if sdf Some text inside if xyz. !if sdf This is some text with several lines in it. And a few more. !endif sdf-2.001/t/macro/init.sdf010064400042570001753000000003440622022557200151260ustar00iancmtr00000400000236!init OPT_STYLE="memo" # This file tests the init macro The new document style is [[OPT_STYLE]]. # This should produce a warning as OPT_STYLE is now readonly !define OPT_STYLE "fax" The final document style is [[OPT_STYLE]]. sdf-2.001/t/macro/export.sdf010064400042570001753000000004570622022557200155110ustar00iancmtr00000400000236# This file tests the export macro # define some variables !define num1 42 !define str1 "My favorite station" !define str2 "hello world" # export some of them !export num1 !export str2 # mark an undefined variable for export !export num2 # now define it (which should export it too) !define num2 77 sdf-2.001/t/macro/slide.sdf010064400042570001753000000005120622022557200152600ustar00iancmtr00000400000236# This file tests the slide_up and slide_down macros !macro sometext H2: Heading 2 H3: Heading 3 !endmacro !sometext # Try sliding down one level H1: Before !slide_down !sometext !slide_up H1: After !sometext # Try sliding down two levels H1: Before !slide_down !slide_down !sometext !slide_up !slide_up H1: After !sometext sdf-2.001/t/macro/on_phras.t010064400042570001753000000000300647265372400154700ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/catalog.sdf010064400042570001753000000004760632311440600156000ustar00iancmtr00000400000236# This file tests the catalog macro # Declare some objects !class things 'THING'; 'Name'; 'Jump' !block things; data Name Jump ABC j1 DEF j2 !endblock # Output a catalog of them !catalog things ''; columns="THING:Name" # Now try a mask ... Testing masking ... !catalog things 'A.*'; columns="THING:Name" sdf-2.001/t/macro/execute.sdf010064400042570001753000000002170622022557200156240ustar00iancmtr00000400000236# This file tests the include macro # Try a command which should give the same result under Unix and DOS !execute "echo execute.sdf"; example sdf-2.001/t/macro/init.t010064400042570001753000000000300647265372400146220ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/define.sdf010064400042570001753000000005640622022557200154210ustar00iancmtr00000400000236# This file tests the define macro # test numbers !define num1 !define num2 42 Variable num1 is [[num1]]. Variable num2 is [[num2]]. # test strings !define str1 "My favorite station" Variable str1 is [[str1]]. # test expressions (and re-definition) !define num2 42 * 2 / 3 !define str2 'AA-' . &Var("str1") . '-ZZ' Variable num2 is [[num2]]. Variable str2 is [[str2]]. sdf-2.001/t/macro/endtable.t010064400042570001753000000000300647265372200154330ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/macro/endmacro.t010064400042570001753000000000300647265372200154450ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/004075500042570001753000000000000672243775200136675ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/004075500042570001753000000000000672243775000152535ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/sdf.out010064400042570001753000000016520637716147400165640ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text before. N[orig_style='N']Some sdf LU2[orig_style='LU2']text. N[orig_style='N']Some middle text. N[orig_style='N']Some more sdf text. E[orig_style='E'] An example paragraph N[bold=1;orig_style='N';size='12pt';sp_before=4]Life is too short to: LU1[bold=1;orig_style='LU1';size='12pt';sp_before=4]drink bad wine LU1[bold=1;orig_style='LU1';size='12pt';sp_before=4]argue over silly things LU1[bold=1;orig_style='LU1';size='12pt';sp_before=4]not use SDF. N[bold=1;orig_style='N';size='12pt';sp_before=4]Don't you agree? N[orig_style='N']Middle. N[bad_apple=1;changed=1;orig_style='N']Life is also too short to: LU1[bad_apple=1;changed=1;orig_style='LU1']argue over good wine. N[orig_style='N';sp_before=6]Hello N[orig_style='N';sp_before=5]world N[orig_style='N';sp_before=9]goodbye N[orig_style='N';sp_before=20]world N[orig_style='N';sp_before=6]Goodbye! N[orig_style='N']Some text after. sdf-2.001/t/filter/checked/script.log010064400042570001753000000000000622022557000172310ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/about.log010064400042570001753000000000000622022557200170410ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/appendix.out010064400042570001753000000010410637716142000175770ustar00iancmtr00000400000236__tuning[] __endtuning[] A1[orig_style='H1']Heading 1 inside an appendix block A2[orig_style='H2']Purpose N[orig_style='N']This manual provides an overview of ... N[orig_style='N']Directions for ... are also provided. A2[orig_style='H2']Scope N[orig_style='N']This manual contains: LF1[orig_style='LF1']a summary of ... LN1[orig_style='LN1']an overview of ... N[orig_style='N']The following documents may also be of interest: LU1[orig_style='LU1']abc LU1[orig_style='LU1']xyz H2[orig_style='H2']See Also N[orig_style='N']The person next to you. sdf-2.001/t/filter/checked/front.out010064400042570001753000000004020637716144600171270ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text before. N[orig_style='N']Some sdf LU2[orig_style='LU2']text. N[orig_style='N']Some middle text. N[orig_style='N']Some more sdf text. E[orig_style='E'] An example paragraph N[orig_style='N']Some text after. sdf-2.001/t/filter/checked/comment.out010064400042570001753000000001360637716142400174410ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text before. N[orig_style='N']Some text after. sdf-2.001/t/filter/checked/plain.out010064400042570001753000000010350637716146400171050ustar00iancmtr00000400000236__tuning[] __endtuning[] P1[orig_style='H1']Heading 1 inside a plain block P2[orig_style='H2']Purpose N[orig_style='N']This manual provides an overview of ... N[orig_style='N']Directions for ... are also provided. P2[orig_style='H2']Scope N[orig_style='N']This manual contains: LF1[orig_style='LF1']a summary of ... LN1[orig_style='LN1']an overview of ... N[orig_style='N']The following documents may also be of interest: LU1[orig_style='LU1']abc LU1[orig_style='LU1']xyz H2[orig_style='H2']See Also N[orig_style='N']The person next to you. sdf-2.001/t/filter/checked/example.out010064400042570001753000000016210637716144200174320ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text before. E[orig_style='E']# E[orig_style='E']# A header E[orig_style='E']# E[orig_style='E'] Some example E[orig_style='E'] text. E[orig_style='E'] Back to indent of 2. N[orig_style='N']Some middle text. E[orig_style='E'] Some E[orig_style='E'] {{1[]example}} text. E[orig_style='E'] Some [\[more]\] E[orig_style='E'] {\{example}\} text. E[orig_style='E'] Yet another block of E[orig_style='E']{{1[]example}} text. E[orig_style='E']123456789a 23456789b 23456789c 23456789d 23456789e 23456789f 23456789g 23456789h E[orig_style='E']123456789A 23456789B 23456789C 23456789D 23456789E 23456789F 23456789G 23456789H E80[orig_style='E80']123456789a 23456789b 23456789c 23456789d 23456789e 23456789f 23456789g 23456789h E80[orig_style='E80']123456789A 23456789B 23456789C 23456789D 23456789E 23456789F 23456789G 23456789H N[orig_style='N']Some text after. sdf-2.001/t/filter/checked/table.out010064400042570001753000000313700645642273400170740ustar00iancmtr00000400000236__tuning[] __endtuning[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Age}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Bill __cell[cols=1;rows=1] N[orig_style='N']64 __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Mary __cell[cols=1;rows=1] N[orig_style='N']53 __endtable[] __table[format='0%-100%,1*';style='grid']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Age}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Bill __cell[cols=1;rows=1] N[orig_style='N']64 __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Mary __cell[cols=1;rows=1] N[orig_style='N']53 __endtable[] __table[format='40%,20%';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Age}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Bill Bloggs __cell[cols=1;rows=1] N[orig_style='N']64 __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Mary Jones __cell[cols=1;rows=1] N[orig_style='N']53 __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]User}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Email}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{2[]Tim}} __cell[cols=1;rows=1] N[orig_style='N']{{EMAIL[jump='mailto:tjh']tjh}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{2[]Chris}} __cell[cols=1;rows=1] N[orig_style='N']{{EMAIL[jump='mailto:cjm']cjm}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']{{2[]Ian}} __cell[cols=1;rows=1] N[orig_style='N']{{EMAIL[jump='mailto:ianc']ianc}} __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]User}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Email}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Tim __cell[cols=1;rows=1] N[orig_style='N']tjh __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Chris __cell[cols=1;rows=1] N[orig_style='N']cjm __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Ian __cell[cols=1;rows=1] N[orig_style='N']ianc __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Favorite Drink}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Bob __cell[cols=1;rows=1] N[orig_style='N']red wine __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Paul __cell[cols=1;rows=1] N[orig_style='N']anything __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Favorite_Drink}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Bob __cell[cols=1;rows=1] N[orig_style='N']red wine __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Paul __cell[cols=1;rows=1] N[orig_style='N']anything __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Favorite Drink}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Family: __cell[cols=1;rows=1] N[orig_style='N'] __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Bob __cell[cols=1;rows=1] N[orig_style='N']red wine __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Robyn __cell[cols=1;rows=1] N[orig_style='N']white wine __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Friends: __cell[cols=1;rows=1] N[orig_style='N'] __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Paul __cell[cols=1;rows=1] N[orig_style='N']anything __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Favorite Drink}} __row[]Group __cell[cols=1;rows=1] N[orig_style='N']{{2[]Family:}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Bob __cell[cols=1;rows=1] N[orig_style='N']red wine __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Robyn __cell[cols=1;rows=1] N[orig_style='N']white wine __row[]Group __cell[cols=1;rows=1] N[orig_style='N']{{2[]Friends:}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Paul __cell[cols=1;rows=1] N[orig_style='N']anything __endtable[] __table[format='1*';style='columns']1 __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Just a body row __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Add another. __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Term}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Definition}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']OMT __cell[cols=1;rows=1] N[orig_style='N']Object Modelling Technique - an object modelling method developed by Rumbaugh __row[]Body __cell[cols=1;rows=1] N[orig_style='N']VGA __cell[cols=1;rows=1] N[orig_style='N']A PC graphics card standard which defines certain sets of screen resolutions __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Port __cell[cols=1;rows=1] N[orig_style='N']Take your pick from: LU1[orig_style='LU1']an alcoholic drink LU1[orig_style='LU1']a resting place for ships LU1[orig_style='LU1']etc. __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]one}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]two}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']-l is the log __cell[cols=1;rows=1] __import[fullname='foo.ps']foo.ps LU2[orig_style='LU2']o is the output extension. E[orig_style='E'] example __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Value}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']1 __cell[cols=1;rows=1] N[orig_style='N']a __row[]Body __cell[cols=1;rows=1] N[changed=1;orig_style='N']2 __cell[cols=1;rows=1] N[changed=1;orig_style='N']b __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Value}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']1 __cell[cols=1;rows=1] N[orig_style='N']a __row[]Body __cell[cols=1;rows=1] N[changed=1;orig_style='N']2 __cell[cols=1;rows=1] N[changed=1;orig_style='N']b __row[]Body __cell[cols=1;rows=1] N[orig_style='N']3 __cell[cols=1;rows=1] N[orig_style='N']c __endtable[] __table[format='0%-100%,0%-100%,1*';style='columns']3 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]C++}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]C}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]B}} __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]a}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]b}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]c}} __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]85}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]75}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]73?}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']q __cell[cols=1;rows=1] N[orig_style='N']w __cell[cols=1;rows=1] N[orig_style='N']e __row[]Footing __cell[cols=1;rows=1] N[orig_style='N']{{2[]r}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]s}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]t}} __endtable[] __table[format='0%-100%,0%-100%,1*';style='columns']3 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Name}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Jump}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Rubbish}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']product1 __cell[cols=1;rows=1] N[orig_style='N']url1 __cell[cols=1;rows=1] N[orig_style='N']x __row[]Body __cell[cols=1;rows=1] N[orig_style='N']product2 __cell[cols=1;rows=1] N[orig_style='N']url2 __cell[cols=1;rows=1] N[orig_style='N']y __row[]Body __cell[cols=1;rows=1] N[orig_style='N']product3 __cell[cols=1;rows=1] N[orig_style='N']url3 __cell[cols=1;rows=1] N[orig_style='N']z __endtable[] __table[format='0%-100%,0%-100%,0%-100%,0%-100%,0%-100%,1*';style='columns']6 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Big}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Small}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Big}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Small}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Big}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Small}} __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]Letter}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]One}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Letter}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]One}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Letter}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]One}} __row[]Group __cell[cols=1;rows=1] N[orig_style='N']{{2[]Vowels:}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']A __cell[cols=1;rows=1] N[orig_style='N']a __cell[cols=1;rows=1] N[orig_style='N']E __cell[cols=1;rows=1] N[orig_style='N']e __cell[cols=1;rows=1] N[orig_style='N']I __cell[cols=1;rows=1] N[orig_style='N']i __row[]Body __cell[cols=1;rows=1] N[orig_style='N']O __cell[cols=1;rows=1] N[orig_style='N']o __cell[cols=1;rows=1] N[orig_style='N']U __cell[cols=1;rows=1] N[orig_style='N']u __row[]Group __cell[cols=1;rows=1] N[orig_style='N']{{2[]Others:}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']B __cell[cols=1;rows=1] N[orig_style='N']b __cell[cols=1;rows=1] N[orig_style='N']C __cell[cols=1;rows=1] N[orig_style='N']c __cell[cols=1;rows=1] N[orig_style='N']D __cell[cols=1;rows=1] N[orig_style='N']d __row[]Body __cell[cols=1;rows=1] N[orig_style='N']F __cell[cols=1;rows=1] N[orig_style='N']f __cell[cols=1;rows=1] N[orig_style='N']G __cell[cols=1;rows=1] N[orig_style='N']g __cell[cols=1;rows=1] N[orig_style='N']H __cell[cols=1;rows=1] N[orig_style='N']h __row[]Footing __cell[cols=1;rows=1] N[orig_style='N']{{2[]Upper}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Lower}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Upper}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Lower}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Upper}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]Lower}} __endtable[] __table[format='0%-100%,0%-100%,1*';style='columns']3 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]A}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]B}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]C}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Hello world __cell[cols=1;rows=1] N[orig_style='N']A2 __cell[cols=1;rows=1] N[orig_style='N'] __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Hi __cell[cols=1;rows=1] N[orig_style='N']How are __cell[cols=1;rows=1] N[orig_style='N']you\ __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Q __cell[cols=1;rows=1] N[orig_style='N']W __cell[cols=1;rows=1] N[orig_style='N']E:R __row[]Body __cell[cols=1;rows=1] N[orig_style='N']S\\X __cell[cols=1;rows=1] N[orig_style='N']Y\\\Z __cell[cols=1;rows=1] N[orig_style='N'] __endtable[] __table[format='0%-100%,0%-100%,0%-100%,1*';style='columns']4 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]one}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]two}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]three}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]four}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']line1-1 __cell[cols=1;rows=1] N[orig_style='N']two __cell[cols=1;rows=1] N[orig_style='N']three __cell[cols=1;rows=1] N[orig_style='N']large four E[orig_style='E']example format four __row[]Body __cell[cols=1;rows=1] N[orig_style='N']line2-1 __cell[cols=1;rows=1] N[orig_style='N']large two (2) E[orig_style='E']example format for two __cell[cols=1;rows=1] N[orig_style='N']three __cell[cols=1;rows=1] N[orig_style='N']four __row[]Body __cell[cols=1;rows=1] N[orig_style='N']line3-1 __cell[cols=1;rows=1] N[orig_style='N']large two again E[orig_style='E']example format 2+ __cell[cols=1;rows=1] N[orig_style='N']large three too E[orig_style='E']col3 example format __cell[cols=1;rows=1] N[orig_style='N']normal four __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]A}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]C}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']1 __cell[cols=1;rows=1] N[orig_style='N']3 __row[]Body __cell[cols=1;rows=1] N[orig_style='N']5 __cell[cols=1;rows=1] N[orig_style='N']7 __endtable[] __table[format='0%-100%,0%-100%,1*';style='columns']3 __row[]Heading __cell[cols=1;rows=1] N[orig_style='N']{{2[]A}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]B}} __cell[cols=1;rows=1] N[orig_style='N']{{2[]D}} __row[]Body __cell[cols=1;rows=1] N[orig_style='N']1 __cell[cols=1;rows=1] N[orig_style='N']2 __cell[cols=1;rows=1] N[orig_style='N']4 __row[]Body __cell[cols=1;rows=1] N[orig_style='N']5 __cell[cols=1;rows=1] N[orig_style='N']6 __cell[cols=1;rows=1] N[orig_style='N']8 __endtable[] yle='N']Bob __cell[cols=1;rows=1] N[orig_style='N']red wine __row[]Body __cell[cols=1;rows=1] N[orig_style='N']Paul __cell[cols=1;rows=1] N[orig_style='N']anything __endtable[] __table[format='0%-100%,1*';style='columns']2 __row[]Heading __cell[cols=1;rows=1] N[orsdf-2.001/t/filter/checked/parastyl.out010064400042570001753000000010240637716145600176400ustar00iancmtr00000400000236__tuning[] __endtuning[] MY1[orig_style='MY1']My level 1 paragraph MY2[orig_style='MY2']My level 2 paragraph MY3[orig_style='MY3']My level 3 paragraph MY1[orig_style='MY1']My level 1 paragraph MY2[orig_style='MY2'] My level 2 paragraph MY3[orig_style='MY3']My level 3 paragraph MY1[orig_style='MY1']My level 1 paragraph MY2[orig_style='MY2'] My level 2 paragraph MY3[orig_style='MY3']My level 3 paragraph MY1[orig_style='MY1']My level 1 paragraph MY2[orig_style='MY2'] My level 2 paragraph MY3[orig_style='MY3']My level 3 paragraph sdf-2.001/t/filter/checked/end.log010064400042570001753000000000000622022557000164730ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/script.out010064400042570001753000000001220636603441000172660ustar00iancmtr00000400000236variable xyz is 42. variable abc is My favorite station. __tuning[] __endtuning[] sdf-2.001/t/filter/checked/about.out010064400042570001753000000010670637716141000171100ustar00iancmtr00000400000236__tuning[] __endtuning[] P2[component='prechapter';orig_style='H1']About This Manual P3[notoc=1;orig_style='H2']Purpose N[orig_style='N']This manual provides an overview of ... N[orig_style='N']Directions for ... are also provided. P3[notoc=1;orig_style='H2']Scope N[orig_style='N']This manual contains: LF1[orig_style='LF1']a summary of ... LN1[orig_style='LN1']an overview of ... N[orig_style='N']The following documents may also be of interest: LU1[orig_style='LU1']abc LU1[orig_style='LU1']xyz H2[orig_style='H2']See Also N[orig_style='N']The person next to you. sdf-2.001/t/filter/checked/inline.log010064400042570001753000000000000622022557000172030ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/define.log010064400042570001753000000001760622022557000171750ustar00iancmtr00000400000236define.sdf warning, para. on 11: variable 'my_xyz' not defined define.sdf warning, para. on 11: variable 'my_abc' not defined sdf-2.001/t/filter/checked/address.log010064400042570001753000000000000622022557200173540ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/default.log010064400042570001753000000002000622022557000173530ustar00iancmtr00000400000236default.sdf warning, para. on 13: variable 'my_xyz' not defined default.sdf warning, para. on 13: variable 'my_abc' not defined sdf-2.001/t/filter/checked/sdf.log010064400042570001753000000002140622022557000165100ustar00iancmtr00000400000236sdf.sdf warning, block on 33: unknown paragraph attribute 'bad_apple' sdf.sdf warning, block on 33: unknown paragraph attribute 'bad_apple' sdf-2.001/t/filter/checked/end.out010064400042570001753000000003140637716143600165460ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text before. N[orig_style='N']Some middle text. N[orig_style='N']Some text after. N[orig_style='N']Some text inside. N[orig_style='N']Some more text inside. sdf-2.001/t/filter/checked/appendix.log010064400042570001753000000000000622022557200175370ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/front.log010064400042570001753000000000000622022557200170570ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/comment.log010064400042570001753000000000000622022557000173670ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/plain.log010064400042570001753000000000000622022557200170320ustar00iancmtr00000400000236sdf-2.001/t/filter/checked/example.log010064400042570001753000000000760622022557000173750ustar00iancmtr00000400000236example.sdf warning, block on 18: variable 'more' not defined sdf-2.001/t/filter/checked/table.log010064400042570001753000000005640637722305200170410ustar00iancmtr00000400000236table.sdf warning, block on 97: unable to find image 'foo.ps' LAST 3,2 CELL[0,0]=Name LAST 3,2 CELL[0,1]=Jump LAST 3,2 CELL[0,2]=Rubbish LAST 3,2 CELL[1,0]=product1 LAST 3,2 CELL[1,1]=url1 LAST 3,2 CELL[1,2]=x LAST 3,2 CELL[2,0]=product2 LAST 3,2 CELL[2,1]=url2 LAST 3,2 CELL[2,2]=y LAST 3,2 CELL[3,0]=product3 LAST 3,2 CELL[3,1]=url3 LAST 3,2 CELL[3,2]=z AT END OF TABLE sdf-2.001/t/filter/checked/parastyl.log010064400042570001753000000004040622022557200175760ustar00iancmtr00000400000236parastyl.sdf warning, macro on 11: unknown paragraph style 'MY1' parastyl.sdf warning, macro on 11: unknown paragraph style 'MY2' parastyl.sdf warning, macro on 11: unknown paragraph style 'MY3' parastyl.sdf warning, macro on 21: unknown paragraph style 'MY3' sdf-2.001/t/filter/checked/inline.out010064400042570001753000000004020637716145200172520ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text before. __inline[target='raw']Some inline __inline[target='raw']text. N[orig_style='N']Some middle text. __inline[target='raw']Some more __inline[target='raw']inline text. N[orig_style='N']Some text after. sdf-2.001/t/filter/checked/define.out010064400042570001753000000010570637716143200172330ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Variable xyz is 42. Variable abc is My favorite station. N[orig_style='N']Variable my_xyz is . Variable my_abc is . N[orig_style='N']Variable xyz is 42. Variable abc is My favorite station. N[orig_style='N']Variable my_xyz is 23. Variable my_abc is Alpha Beta Gamma. __object[Name='xyz';value=17]Variable __object[Name='abc';value='My favorite 3 letters']Variable N[orig_style='N']Variable xyz is 17. Variable abc is My favorite 3 letters. N[orig_style='N']Variable my_xyz is 23. Variable my_abc is Alpha Beta Gamma. sdf-2.001/t/filter/checked/address.out010064400042570001753000000003050637716141400174210ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Some text. Addr[orig_style='Addr']Bill Bloggs Addr[orig_style='Addr']43 Smith Lane Addr[orig_style='Addr']Brisbane Q 4001 N[orig_style='N']Some more text. sdf-2.001/t/filter/checked/default.out010064400042570001753000000010530637716143000174170ustar00iancmtr00000400000236__tuning[] __endtuning[] N[orig_style='N']Variable xyz is 77. Variable abc is My favorite station. N[orig_style='N']Variable my_xyz is . Variable my_abc is . N[orig_style='N']Variable xyz is 77. Variable abc is My favorite station. N[orig_style='N']Variable my_xyz is 23. Variable my_abc is Alpha Beta Gamma. __object[Name='xyz';value=77]Variable __object[Name='abc';value='My favorite station']Variable N[orig_style='N']Variable xyz is 77. Variable abc is My favorite station. N[orig_style='N']Variable my_xyz is 23. Variable my_abc is Alpha Beta Gamma. sdf-2.001/t/filter/appendix.sdf010064400042570001753000000005670622022557200161660ustar00iancmtr00000400000236# This file tests the appendix filter !block appendix H1: Heading 1 inside an appendix block H2: Purpose This manual provides an overview of ... Directions for ... are also provided. H2: Scope This manual contains: ^ a summary of ... + an overview of ... The following documents may also be of interest: * abc * xyz !endblock H2: See Also The person next to you. sdf-2.001/t/filter/end.sdf010064400042570001753000000002560622022557200151170ustar00iancmtr00000400000236# This file tests the end filter Some text before. !block end Some text inside. !endblock Some middle text. !block end Some more text inside. !endblock Some text after. sdf-2.001/t/filter/front.sdf010064400042570001753000000003110622022557000154670ustar00iancmtr00000400000236# This file tests the front filter Some text before. !block front Some sdf - text. !endblock Some middle text. !block front Some more sdf text. E: An example paragraph !endblock Some text after. sdf-2.001/t/filter/plain.sdf010064400042570001753000000005550622022557000154540ustar00iancmtr00000400000236# This file tests the plain filter !block plain H1: Heading 1 inside a plain block H2: Purpose This manual provides an overview of ... Directions for ... are also provided. H2: Scope This manual contains: ^ a summary of ... + an overview of ... The following documents may also be of interest: * abc * xyz !endblock H2: See Also The person next to you. sdf-2.001/t/filter/example.t010064400042570001753000000000300647265372200154740ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/inline.sdf010064400042570001753000000003230622022557200156220ustar00iancmtr00000400000236# This file tests the inline filter Some text before. !block inline; target='raw' Some inline text. !endblock Some middle text. !block inline; target='raw' Some more inline text. !endblock Some text after. sdf-2.001/t/filter/define.sdf010064400042570001753000000012530622022557000155770ustar00iancmtr00000400000236# This file tests the define filter !block define Name Value xyz 42 abc "My favorite station" !endblock Variable xyz is [[xyz]]. Variable abc is [[abc]]. Variable my_xyz is [[my_xyz]]. Variable my_abc is [[my_abc]]. # Test the family parameter !block define; family="my" Name Value xyz 23 abc "Alpha Beta Gamma" !endblock Variable xyz is [[xyz]]. Variable abc is [[abc]]. Variable my_xyz is [[my_xyz]]. Variable my_abc is [[my_abc]]. # Test exporting !block define; export Name Value xyz 17 abc "My favorite 3 letters" !endblock Variable xyz is [[xyz]]. Variable abc is [[abc]]. Variable my_xyz is [[my_xyz]]. Variable my_abc is [[my_abc]]. sdf-2.001/t/filter/parastyl.sdf010064400042570001753000000013230627761471000162140ustar00iancmtr00000400000236# This file tests the parastyles filter # Setup a test section !macro MYTEXT MY1: My level 1 paragraph MY2: My level 2 paragraph MY3: My level 3 paragraph !endmacro # Test section before styles are declared !MYTEXT # Declare some styles !block parastyles Name Category MY1 MY2 example !endblock # Test section after definition but before declaration !MYTEXT # Define some styles !block parastyles Name To Attributes MY2 H2 MY3 P3 notoc !endblock # Test section after definition !MYTEXT # Redefine some styles !block parastyles Name To Attributes MY2 P2 nopb MY3 MY2 !endblock # Test section after redefinition !MYTEXT sdf-2.001/t/filter/table.sdf010064400042570001753000000067600645642270600154570ustar00iancmtr00000400000236# This file tests the table filter # Test a simple table !block table Name Age Bill 64 Mary 53 !endblock # Test the style parameter !block table; style="grid" Name Age Bill 64 Mary 53 !endblock # Test the format parameter !block table; format=42 Name Age Bill Bloggs 64 Mary Jones 53 !endblock # Test the tags parameter !block table; tags="2,EMAIL" User:Email Tim:tjh Chris:cjm Ian:ianc !endblock # Test the parseline parameter !block table; parseline="User:Email" Tim:tjh Chris:cjm Ian:ianc !endblock # Test the niceheadings parameter !block table Name Favorite_Drink Bob red wine Paul anything !endblock !block table; niceheadings=0 Name Favorite_Drink Bob red wine Paul anything !endblock # Test the groups parameter !block table Name Favorite_Drink Family: Bob red wine Robyn white wine Friends: Paul anything !endblock !block table; groups Name Favorite_Drink Family: Bob red wine Robyn white wine Friends: Paul anything !endblock # Test the noheadings parameter !block table; noheadings Dummy_Heading Just a body row Add another. !endblock # Test multi-line cells !block table Term Definition OMT << Object Modelling Technique - an object modelling method developed by Rumbaugh >> VGA << A PC graphics card standard which defines certain sets of screen resolutions >> Port << Take your pick from: * an alcoholic drink * a resting place for ships * etc. >> !endblock # Try nested macros !block table one:two -l is the log:<< !import "foo.ps" -o is the output extension. E: example >> !endblock # Try macros around rows !block table Name Value 1 a !block sdf; changed 2 b !endblock !if all 3 c !endif !endblock # And conditional macros, in particular !define all !block table Name Value 1 a !block sdf; changed 2 b !endblock !if all 3 c !endif !endblock # Test multi-line headings and footings !block table; headings=3; footings A B C C++ C B a b c 85 75 73? q w e r s t !endblock # Test oncell processing !block script sub dump { print STDERR "LAST $last_row,$last_col\n"; print STDERR "CELL[$row,$col]=$cell\n"; if ( ($row == $last_row) && ($col == $last_col) ) { print STDERR "AT END OF TABLE\n"; } } !endblock !block table; oncell='&dump()'; Name:Jump:Rubbish product1:url1:x product2:url2:y product3:url3:z !endblock # Test the wrap attribute !block table; wrap=3; groups; footings; headings=2 A B Big Small Letter One Vowels: A a E e I i O o U u Others: B b C c D d F f G g H h Upper Lower !endblock # Test continuation lines !block table A:B:C Hello \ world:A2 Hi:How are:you\\ Q:W:E:R S\\\ X:Y\\\\ Z !endblock # Test non-last multi-line cells !block table one:two:three:four line1-1:two:three:<< large four E:example format four >> line2-1:<< large two (2) E:example format for two >>:three:four line3-1:<< large two again E:example format 2+ >>:<< large three too E:col3 example format >>:normal four !endblock # Test the select attribute !block table; select='A,C' A B C D 1 2 3 4 5 6 7 8 !endblock # Test the delete attribute !block table; delete='C' A B C D 1 2 3 4 5 6 7 8 !endblock sdf-2.001/t/filter/address.t010064400042570001753000000000300647265372000154640ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/parastyl.t010064400042570001753000000000300647265372200157000ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/inline.t010064400042570001753000000000300647265372200153170ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/default.t010064400042570001753000000000300647265372200154650ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/sdf.sdf010064400042570001753000000012330622022557200151210ustar00iancmtr00000400000236# This file tests the sdf filter Some text before. !block sdf Some sdf - text. !endblock Some middle text. !block sdf Some more sdf text. E: An example paragraph !endblock # Test arbitary parameters !block sdf; size='12pt'; bold; sp_before=4 Life is too short to: * drink bad wine * argue over silly things * not use SDF. Don't you agree? !endblock Middle. # Test an unknown attribute !block sdf; bad_apple; changed Life is also too short to: * argue over good wine. !endblock # Test nesting and overriding !block sdf; sp_before=6 Hello [sp_before=5]world !block sdf; sp_before=9 goodbye [sp_before=20]world !endblock Goodbye! !endblock Some text after. sdf-2.001/t/filter/about.sdf010064400042570001753000000005400622022557200154570ustar00iancmtr00000400000236# This file tests the about filter !block about H1: About This Manual H2: Purpose This manual provides an overview of ... Directions for ... are also provided. H2: Scope This manual contains: ^ a summary of ... + an overview of ... The following documents may also be of interest: * abc * xyz !endblock H2: See Also The person next to you. sdf-2.001/t/filter/address.sdf010064400042570001753000000002050622022557200157700ustar00iancmtr00000400000236# This file tests the address filter Some text. !block address Bill Bloggs 43 Smith Lane Brisbane Q 4001 !endblock Some more text. sdf-2.001/t/filter/default.sdf010064400042570001753000000012770622022557000157770ustar00iancmtr00000400000236# This file tests the default filter !define xyz 77 !block default Name Value xyz 42 abc "My favorite station" !endblock Variable xyz is [[xyz]]. Variable abc is [[abc]]. Variable my_xyz is [[my_xyz]]. Variable my_abc is [[my_abc]]. # Test the family parameter !block default; family="my" Name Value xyz 23 abc "Alpha Beta Gamma" !endblock Variable xyz is [[xyz]]. Variable abc is [[abc]]. Variable my_xyz is [[my_xyz]]. Variable my_abc is [[my_abc]]. # Test exporting !block default; export Name Value xyz 17 abc "My favorite 3 letters" !endblock Variable xyz is [[xyz]]. Variable abc is [[abc]]. Variable my_xyz is [[my_xyz]]. Variable my_abc is [[my_abc]]. sdf-2.001/t/filter/script.t010064400042570001753000000000300647265372200153450ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/appendix.t010064400042570001753000000000300647265372200156510ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/define.t010064400042570001753000000000300647265372200152730ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/front.t010064400042570001753000000000300647265372200151710ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/comment.t010064400042570001753000000000300647265372200155030ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/sdf.t010064400042570001753000000000300647265372200146150ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/end.t010064400042570001753000000000300647265372200146070ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/comment.sdf010064400042570001753000000001660622022557000160110ustar00iancmtr00000400000236# This file tests the comment filter Some text before. !block comment Some text inside. !endblock Some text after. sdf-2.001/t/filter/script.sdf010064400042570001753000000003250630325452200156510ustar00iancmtr00000400000236# This file tests the script filter !block define Name Value xyz 42 abc "My favorite station" !endblock !block script for $igc ('xyz', 'abc') { print "variable $igc is $var{$igc}.\n"; } !endblock sdf-2.001/t/filter/example.sdf010064400042570001753000000016670622022557200160130ustar00iancmtr00000400000236# This file tests the example filter Some text before. # Test a simple example !block example # # A header # Some example text. Back to indent of 2. !endblock Some middle text. # Test normal (non-pure) blocks !block example Some [[more]] {{example}} text. !endblock # Test pure blocks !block example; pure Some [[more]] {{example}} text. !endblock # Test the skipheader parameter !block example; skipheader # $Id$ # A header will an RCS-Id line at the top # Yet another block of {{example}} text. !endblock # Test wide blocks !block example 123456789a 23456789b 23456789c 23456789d 23456789e 23456789f 23456789g 23456789h 123456789A 23456789B 23456789C 23456789D 23456789E 23456789F 23456789G 23456789H !endblock !block example; wide 123456789a 23456789b 23456789c 23456789d 23456789e 23456789f 23456789g 23456789h 123456789A 23456789B 23456789C 23456789D 23456789E 23456789F 23456789G 23456789H !endblock Some text after. sdf-2.001/t/filter/table.t010064400042570001753000000000300647265372200151300ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/about.t010064400042570001753000000000300647265372000151510ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/filter/plain.t010064400042570001753000000000300647265372200151440ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/doatest.clone010075500042570001753000000002040647265371000150570ustar00iancmtr00000400000236#!/bin/sh set -e for sdf in */*.sdf; do cmd="cp doatest.templ `dirname $sdf`/`basename $sdf .sdf`.t" echo do: $cmd ... $cmd done sdf-2.001/t/TEST010075500042570001753000000016540647270244200131030ustar00iancmtr00000400000236#!/usr/local/bin/perl # This script is run Test::Harness on the tests found under the # "t" directory. # First we check if we already are within the "t" directory unless (-d "general") { # try to move into test directory chdir "t" or die "Can't chdir: $!"; # fix all relative library locations foreach (@INC) { $_ = "../$_" unless m,^/,; } } # Pick up the library files from the ../blib directory unshift(@INC, "../../blib/lib", "../../blib/arch"); #print "@INC\n"; use Test::Harness; $Test::Harness::switches = ""; $Test::Harness::verbose = shift if $ARGV[0] =~ /^\d+$/ || $ARGV[0] eq "-v"; #$Test::Harness::verbose = 1; if (@ARGV) { for (@ARGV) { if (-d $_) { push(@tests, <$_/*.t>); } else { $_ .= ".t" unless /\.t$/; push(@tests, $_); } } } else { @tests = (, , ); } #print STDERR join("|", "tests=", @tests, "\n"); runtests @tests; (@INC, "../../blib/lib", "../../blib/arch"); #print "@INC\n"; use Test::Harness; $sdf-2.001/t/html/004075500042570001753000000000000672243774000133435ustar00iancmtr00000400000236sdf-2.001/t/html/lists.sdf010064400042570001753000000007230622022557200151650ustar00iancmtr00000400000236H2: Plain After Ordered ^ 1a . 1b . 1c + 1d H2: Plain after Unordered * 1a . 1b . 1c * 1d H2: Mixed At the Same Level ^ 1a * 1b * 1c + 1d H2: Plain Indent > 1 . 1aaaaaaaaaaaaaaaaaaaaa ... 3aaaaaaaaaaaaaaaaaaaaa .. 2aaaaaaaaaaaaaaaaaaaaa H2: Ordered Indent > 1 ^ 1a ^^^ 3a ^^ 2a ++ 2b + 1b H2: Unordered Indent > 1 * 1a *** 3a ** 2a H2: Ordered With Starting Indent > 1 ^^^ 3a ^^ 2a ++ 2b ^ 1a H2: Mixed With Starting Indent > 1 ... 3a ^^ 2a ++ 2b * 1a sdf-2.001/t/html/lists.t010064400042570001753000000000300647265372200146560ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/html/checked/004075500042570001753000000000000672243774000147315ustar00iancmtr00000400000236sdf-2.001/t/html/checked/lists.html010064400042570001753000000036310622022557200167440ustar00iancmtr00000400000236

Table of Contents

Plain After Ordered

  1. 1a
    1b
    1c
  2. 1d

Plain after Unordered

  • 1a
    1b
    1c
  • 1d

Mixed At the Same Level

  1. 1a
  • 1b
  • 1c
  1. 1d

Plain Indent > 1

    1aaaaaaaaaaaaaaaaaaaaa
        3aaaaaaaaaaaaaaaaaaaaa

      2aaaaaaaaaaaaaaaaaaaaa

Ordered Indent > 1

  1. 1a
      1. 3a
    1. 2a
    2. 2b
  2. 1b

Unordered Indent > 1

  • 1a
      • 3a
    • 2a

Ordered With Starting Indent > 1

      1. 3a
    1. 2a
    2. 2b
  1. 1a

Mixed With Starting Indent > 1

        3a
    1. 2a
    1. 2b
  • 1a

sdf-2.001/t/doatest.templ010064400042570001753000000000300647265275600151030ustar00iancmtr00000400000236require './doatest.pl'; sdf-2.001/t/sdftest.bat010064400042570001753000000036250661473075300145460ustar00iancmtr00000400000236@echo off cd general echo TESTING GENERAL STUFF ... call sdf -2raw -.test expr.sdf call sdf -2raw -.test formats.sdf call sdf -2raw -.test lineno.sdf call sdf -2raw -.test macro.sdf call sdf -2raw -.test para1.sdf call sdf -2raw -.test para2.sdf call sdf -2raw -.test phrase.sdf call sdf -2raw -.test zero.sdf cd ..\macro echo TESTING MACROS ... call sdf -2raw -.test block.sdf call sdf -2raw -.test catalog.sdf call sdf -2raw -.test cell.sdf call sdf -2raw -.test class.sdf call sdf -2raw -.test default.sdf call sdf -2raw -.test define.sdf call sdf -2raw -.test else.sdf call sdf -2raw -.test elsif.sdf call sdf -2raw -.test endblock.sdf call sdf -2raw -.test endif.sdf call sdf -2raw -.test endmacro.sdf call sdf -2raw -.test endtable.sdf call sdf -2raw -.test execute.sdf call sdf -2raw -.test export.sdf call sdf -2raw -.test if.sdf call sdf -2raw -.test include.sdf rem call sdf -2raw -.test inherit.sdf call sdf -2raw -.test init.sdf call sdf -2raw -.test insert.sdf call sdf -2raw -.test line.sdf call sdf -2raw -.test macro.sdf call sdf -2raw -.test on_para.sdf call sdf -2raw -.test on_phras.sdf call sdf -2raw -.test row.sdf call sdf -2raw -.test slide.sdf call sdf -2raw -.test table.sdf call sdf -2raw -.test undef.sdf cd ..\filter echo TESTING FILTERS ... call sdf -2raw -.test about.sdf call sdf -2raw -.test address.sdf call sdf -2raw -.test appendix.sdf call sdf -2raw -.test comment.sdf call sdf -2raw -.test default.sdf call sdf -2raw -.test define.sdf call sdf -2raw -.test end.sdf call sdf -2raw -.test example.sdf call sdf -2raw -.test front.sdf call sdf -2raw -.test inline.sdf call sdf -2raw -.test parastyl.sdf call sdf -2raw -.test plain.sdf call sdf -2raw -.test script.sdf call sdf -2raw -.test sdf.sdf call sdf -2raw -.test table.sdf cd .. echo If any tests failed, the unexpected .out or .log file echo can be found in t\general, t\macro or t\filter. sdf-2.001/t/sdftest010075500042570001753000000020230672214562300137670ustar00iancmtr00000400000236#!/bin/sh # $Id$ # # >>Title:: Execute Regression Tests # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 29-Feb-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # sdf="sdf" #sdf="$1 -I../../blib/lib ../../blib/script/sdf" echo "Using '$sdf' for the tests" cd general echo "TESTING GENERAL STUFF ..." $sdf -2raw -.test *.sdf cd ../macro echo "TESTING MACROS ..." $sdf -2raw -.test *.sdf cd ../filter echo "TESTING FILTERS ..." $sdf -2raw -.test *.sdf cd ../.. echo "SUMMARY:" bad=`/bin/ls t/*/*.out t/*/*.log 2>/dev/null | wc -l` if [ $bad -eq 0 ] then echo "All tests passed." exit 0 else echo "$bad test(s) failed." echo "" echo "The unexpected .out or .log file(s), can be found in" echo "test/general, test/macro and/or test/filter." exit 1 fi sdf-2.001/t/doatest.pl010064400042570001753000000007100647270004400143620ustar00iancmtr00000400000236print "1..2\n"; my $path = $0; $path =~ m|([^/\\]+)\.t$|; my $name = $1; my $file = "$1.sdf"; $path =~ m|^(.*[/\\]+)|; my $dir = $1; ## sdf below should at least output something like that: ## print "not" if -x "$name.log"; ## print "ok 1\n"; ## print "not" if -x "$name.out"; ## print "ok 2\n"; ## could not be done after the require because sdf calls ## exit; chdir $dir; @ARGV = ( '-2raw', '-.test=1', $name); require '../../blib/script/sdf'; 1; sdf-2.001/bin/004075500042570001753000000000000672243775100127065ustar00iancmtr00000400000236sdf-2.001/bin/mif2rtf010075500042570001753000002632150647623217200142070ustar00iancmtr00000400000236#!/usr/local/bin/perl # -*- mode:perl -*- # $Id$ # # mif2rtf - Frame Maker Interchange Format to Microsoft Rich Text Format # # Available from: # ftp.mincom.com:/pub/mtr/sdf/mif2rtf/ # # Original version available from: # ftp.irisa.fr:/pub/FrameMaker/Filters/ # # The original code has been significantly reworked in the area of # hypertext construct handling with the aim of being able to generate # Microsoft Windows Help files from FrameMaker documents # # This program can be used to generate reasonable Microsoft Windows # Help files. # # Any feedback on this code should be initially directed to tjh@mincom.com # # Parts of this program are: # Copyright 1992 by Convex Computer Corporation, Richardson, Texas. # # (see the full COPYRIGHT notice further down in the file for details of # the copyright restrictions that were part of the original version and # hence effect this derivative) # # Tim Hudson # tjh@mincom.com # # # 19-Feb-97 ianc fixed (r) and (c) characters # 02-Feb-97 ianc TOCTEXT/TOCGRAPHIC -> TOC_TITLE/TOC_GRAPHIC # 30-Dec-96 tjh center pictures ... controlled by Align=Center # ..................... in the IMPORT statement under SDF # 18-Nov-96 tjh unfortunately had to change this code for perl5.001 # ..................... so Ian is no longer the last to touch the code # 05-Aug-96 ianc changed TOC detection to use marker 11, not 9 # 30-May-96 tjh "fixed" the 23-May-96 "fix" :-) # 23-May-96 ianc "fixed" jumps to topics within another file # 09-May-96 tjh yet another bug in context stuff fixed + get # ..................... size and font changes toggling correct too # 19-Apr-96 tjh get TOC stuff right when user has specified # ..................... the name of the topic # 16-Apr-96 tjh grab title and toc text from vars # 16-Apr-96 tjh fixed up to handle TOC and HELPTOC as XRefName # ..................... which got introduced in SDF2B3? # 03-Apr-96 tjh more rework for better HLP output (Delphi-style) # 26-Mar-96 tjh Color support added ... plus SDF2 stuff # 25-Mar-96 tjh PgfNumFormat support added (and lots of other changes) # 25-Mar-96 tjh changed things to handle SDF mif input # ..................... better without having to go via FrameMaker # 15-Dec-95 craigw Modified the Hypertext markup sections, convert_table # ..................... & convert_picture # 29-Jul-95 tjh windows help output make useful ... generate # ..................... the right footnotes for all the hypertext stuff # 11-Jun-95 tjh added in the "tjh" stuff to enable better # ..................... handling of documents with hypertext links # ..................... in them as the first step in being able to # ..................... generate RTF for WinHelp purposes # # Tim Hudson - tjh@mincom.com # Craig Willis - craigw@mincom.com # # With bug fixes by: # Ian Clatworthy - ianc@mincom.com # output of # indicates loaded in a MIF statement # output of . indicates processed a MIF statement into RTF for output # HELP FOOTNOTES: # * - build tag # # - context string (jump to with \v id) # $ - topic title [one only] # + - browse sequence [one only] # K - keywords (; separated) # ! - help macro # other - alternate keyword ... see HELP_MULTIKEY for details # variables for controlling some of the current under-development stuff # which will move to a more standard location $pgfnumdebug=0; $tmpdebug=0; $sdfvartrace=0; $quiet=1; $rtfdebug=0; $fullcatalog=1; #------------------------------------------------------------------------------ # NOTES ... to be removed shortly ... perhaps into documentation for # this stuff --tjh #------------------------------------------------------------------------------ # # FrameMaker -> PgfSpBefore, PgfSpAfter are handled specially inside # Tables ... and differently to MSWord et al # # PgfPlacement -> !AnyWhere means start topic # PgfNumFormat -> can be in a Para # PgfNumString -> if not there then use PgfNumFormat information # FTag -> Italic, Bold, Blank => weight, angle # # MORE TJH NOTES: (25-Jan-96) # - duplicate stuff controlled via # - escape [] in context ids # - handle backslashes correctly # - handle curlybraces correctly # - fix convert_marker to turn jump into valid id ... had spaces etc # - added convert_context and changed everything to reference # this as it was messy how I originally did this and I needed # to escape more chars ... \{} # # The following will have to be sorted out too ... reference to paragraph # format names needs thinking about # $heading=($curtag =~ /^h[1]_Heading\b/); # if ( $State{'PgfTag'} eq 'tt_TableTitle' ) { # push(@r, "\n$PgfCatalog{'Style',b0_Body} ... # if ( $curtag eq "dn_DocName" && $DocName eq "" ) { # + references to dn_DocName in a few other places too! # if ( $State{'PgfTag'} eq 'tt_TableTitle' ) { # # TJH NOTES: (20-Jan-96) # - *never* use `date` as it will not work under DOS (see my # usage of ctime() for the "portable" way of doing things) # - don't output title line if there isn't one in the document # - Copyright should only be output if its there (rather than Pty Ltd) # - spacing in TOC was too large ... whitespace should be used # *sparingly* in HELP FILES # - fixed rtf_dimensions to handle whitespace gracefully # - typo for VariableName (was VarialbeName) # - using b0_Body as the style name in TOC is non-portable! # - twip conversion for tabs had too much space for left margin # - paragraph style and tabs for TOC need to be kept so that # we get indented reasonable looking TOC from default stuff # # #------------------------------------------------------------------------------ # HELP INFORMATION ... to be expanded #------------------------------------------------------------------------------ #> If -ftoc=n is used, it will produce a Table of Contents if hypertexting # # USE # -o [out file] Output file # -c [Copyright] Copyright message for WINHELP file # -d turn on debugging # -info TAG GROUP Put all text from TAG paragraphs into info group GROUP # -v Verbose Mode # -m [style] If style = help, use Hypertext, else create only RTF # -win [x,y,width,height] (x,y) co-ordinates, Width & Height on Help Window # Input File (MIF File) # # If -win, (x,y,width,height) must be supplied or an error will occur # # Notes: # Output of keep has been blatted in most cases as this is # not wanted with help? # The usage of -m help will generate a Help Project File (.hpj) based # on the name of the output file. The output file always has an # extension presumed to be ".rtf". The ".hpj" file is a standard file # that can be easily manipulated for specific purposes. A Table of Contents # will be generated if there is marker type of 11 and hypertext is being # generated. # # The following is the original text contained in the version that I started # with as the base for this much improved mif2rtf filter --tjh # # The changes that I have made have only one restriction ... you cannot # pretend that you wrote them and the comment blocks in the source file # must be left intact. # # Note: I have not updated any of the text in the block below ... lots of # the BUGS noted have been fixed. # # Tim Hudson # tjh@mincom.com # #------------------------------------------------------------------------------ # Code marked @@ needs fixing. # Code marked @# is an improvisation # Code marked HEURISTIC is not exact. # # COPYRIGHT # # Copyright 1992 by Convex Computer Corporation, Richardson, Texas. # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permission notice appear in # supporting documentation, and that the name Convex not be # used in advertising or publicity pertaining to distribution of the # software without specific, written prior permission. # # CONVEX DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING # ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL # CONVEX BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR # ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. # # BUGS # # @#Footnote paragraph formats not right # @#should convert page margins (frame BRect->margr etc.) # @#No way to make TOC entries # @#master pages # @# Not all document, section, or table properties are converted. # @#Hard problems: reference page items # Maybe use command line options for those. # @# LineSpacing doesn't translate # # IDEAS # absolute positioned object: frame brect etc. # #------------------------------------------------------------------------------ require 'ctime.pl'; # for date $winhelp=1; # this controls the handling of certain constructs that # are *naughty* in the context of windows help files $fixup_duplicates=0; $hyper_debug=0; $lots_of_whitespace=0; $tjh_xref_debug=0; $use_numformat=1; # switch off if you don't want section numbers in the # output (which is handy for matching the paper document # but may be irritating to some users) local($stmt_call_level); local(%SDFVAR,$USER_WH_topic,$USER_WH_context); local($done_pagebreak); local(%SavedState); local(%doc_defaults); local(%char_defaults); local(%para_defaults); # convert_paragraph() uses delayed_text to pass information that # is added using the auto-paragraph header prefix (PgfNumFormat,PgfNumString) # into convert_paraline() ... such that it stays with the text and # is not left dangling when hypertext things are inserted local($delayed_text); %skiptags = ( "dd_DocDistr",1, "dp_DocProject",1, "dn_DocName",1, "dt_DocType",1, "ds_DocStatus",1, "dc_DocCode",1, "dk_DocSkip",1, "da_DocAction",1, "du_DocAuthor",1, "dw_DocWho",1, # To remove the table of contents stuff ... which # is required to drop the TOC page for Windows Help # file generation --tjh "fh_FrontHeading",1, "h1_HeadingTOC",1, "h2_HeadingTOC",1, "h3_HeadingTOC",1, "h4_HeadingTOC",1, ); $OutputFile=''; $Usage = " $0 -o [out file] Output file -c [Copyright] Copyright message for WINHELP file -d turn on debugging -info TAG GROUP Put all text from TAG paragraphs into info group GROUP -v Verbose Mode -m [style] Determines Output style, help - Hypertext -win [x,y,width,height] (x,y) co-ordinates, Width & Height on Help Window Input File "; ######### # # main # # # %TagGroup maps MIF paragraph tags to RTF info groups # %RTFInfo holds the text of the RTF info groups # so that after &convert_pages(), # $RTFInfo{$TagGroup{pgftag}} contains all text tagged pgftag # # @@ idea: extend this to character tags # local($Debug, %TagGroup ); @ARGV = &parse_args(@ARGV); if ($OutputFile ne '' ) { open (OUTPUT,">$OutputFile") || die "Failed to open $OutputFile"; } #local($Date) = `date`; local($Date) = &ctime(time); &Verbose("Program: $0\nDate : ${Date}Input : @ARGV\nOutput : $OutputFile"); # # %State maps MIF and RTF codes to their current settings # local(%State, %CharacterConversions ); local( $paragraph_count, $browse_seqno); &initialize_state(); &debug( "initialize_state done"); local($Document, # $Document is the RTF code to get from the default # document format to what's in %State # NOTE: some MIF document attrs are RTF Section attrs # ASSUME: MIF document defaults are RTF defaults %Typeface, $Typeface, # %Typeface maps FFamilys to RTF font numbers %Tag, $Tag, # %Tag maps PgfTags to RTF style numbers %PgfCatalog, %FontCatalog, @BodyPage, %TextRect, %TextFlow, %AFrame, %Tbl ); #> Local Variables Used globally internally local( $DocName, $PgfAutoNum, $Xref_TOC); # This is the default in Frame, but not in Word. $Document = "\\widowctrl\\ftnbj\\cvmme\\sprsspbf\\brkfrm\\swpdr\\noextraspl". "\\hypcaps0"; #> CRW Modified from standard RTF file local($PageType, $TextRectID, $ID, $TblID, $XRefName, $VaraibleName); &read_whole_file ('DPageSize', '$Document .= &change_dims($data, "paperw", "paperh")', 'DStartPage', '$Document .= &change_attr("pgnstarts", $data)', 'DPageNumStyle', '$Document .= &select_attr($data, "PageNumStyle", "Arabic", "pgndec", "UCRoman", "pgnucrm", "LCRoman", "pgnlcrm", "UCALpha", "pgnucltr", "LCAlpha", "pgnlcltr")', 'DTwoSides', '$Document .= &change_attr("facingp", 1)', 'DFNoteRestart', '$Document .= &select_attr($data, "FNoteRestart", "PerPage", "ftnrestart")', 'DFNoteStartNum', '$Document .= &change_attr("fntstart", $data)', 'DAutoChBars', '$Document .= &change_attr("revisions", 1)', 'FFamily', '&intern(*Typeface, $data)', 'PgfTag', '&intern(*Tag, $data); ', 'PgfCatalog', '&convert_paragraph_catalog($here)', 'FontCatalog', '&convert_character_catalog($here)', 'PageType', '$PageType = $data', 'Page', ' push(@BodyPage, $here) if $PageType eq "BodyPage"; &debug("$PageType $here"); ', 'TextRectID', '$TextRectID ? &debug("Extra TextRect: $data") : ($TextRectID = $data)', 'TextFlow', '@TextRect{$TextRectID} = $here; &debug("flow", %TextRect); $TextRectID = ""', 'Frame', '$AFrame{&data_search($here, "ID", 1)} = $here', 'TblID', '$TblID = $data', 'Tbl', '$Tbl{$TblID} = $here', 'XRefName', '$XRefName = &convert_string($data)', 'XRefDef', '$Definition{"XRef", $XRefName} = $data; $Definition{"XRefPgfTag", $XRefName} = $State{\'PgfTag\'}; print STDERR "XRef $XRefName ($data) => $State{\'PgfTag\'}\n" if ($tjh_xref_debug); ', 'VariableName', '$VariableName = &convert_string($data)', 'VariableDef', '$Definition{"Variable", $VariableName} = $data' ); if ( $OutputFile ne '' ) { $Output = "OUTPUT"; } else { $Output = "STDOUT"; } print $Output &rtf_begin_doc; print $Output &rtf_font_table(%Typeface); if (0) { print $Output &rtf_color_table(('0 0 0', # These are Frame's colors '0 0 255', '0 255 255', '0 255 0', '255 0 255', '255 255 0', '255 255 255', '0 0 128', '0 128 128', '0 128 0', '128 0 128', '128 0 0', '128 128 0', '128 128 128', '192 192 192')); } else { # # Frame4 Colors are the following ... # Black, White, Red, Green, Blue, Cyan, Magenta, Yellow # print $Output &rtf_color_table(('0 0 0', # Black '255 255 255', # White '255 0 0', # Red '0 255 0', # Green '0 0 255', # Blue '0 255 255', # Cyan '255 0 255', # Magenta '255 255 0' # Yellow )); } print $Output $Document, "\n"; &debug("body pages: ", @BodyPage); local(@Document, $cnt); foreach $page (@BodyPage){ &debug("converting page:\n", &expand_mif_statement($page)); push(@Document, &convert_frame($page)); } if ( !defined($StyleSheet) || $StyleSheet) { print $Output &rtf_style_sheet(%Tag); } print $Output &rtf_info(%RTFInfo); print $Output @Document; print $Output &rtf_end_doc; # when debugging the hypertext stuff it is nice to be able to # output the map table directly ... might have a dinky flag for # doing this too ... if ( $hypertext_sw ) { foreach ( keys(%Context_ID)) { &debug(sprintf("%-30s %010d ; $WH_topic_comments{$_}\n", $WH_context_ids{$_}, $_)); } } print STDERR "\n"; # after all the .....'s if ( $hypertext_sw ne '' ) { local($cnt); close $Output; $ErrFile = $HPJFile = $OutputFile; $ErrFile =~ s/\.\w+$/\.err/; $HPJFile =~ s/\.\w+$/\.hpj/; open (OUTPUT,">$HPJFile") || die "open $HPJFile"; print OUTPUT "[OPTIONS]\n"; if ( scalar(@Bmroot) ) { print OUTPUT "BMROOT="; foreach (@Bmroot) { print $_ eq "$Bmroot[0]" ? "" : ":" ; print $_; } print OUTPUT "\n"; } # pick up the title from the new variable that holds this # information if (defined $Definition{"Variable", "DOC_TITLE"} ) { $DocName = &convert_string($Definition{"Variable", "DOC_TITLE"}); } # print OUTPUT "COMPRESS=ON\n"; print OUTPUT "COMPRESS=OFF\n"; print OUTPUT "COPYRIGHT=$Copyright\n" if ($Copyright ne ""); # print OUTPUT "CITATION=\n"; print OUTPUT "ERRORLOG=$ErrFile\n"; # print OUTPUT "ICON=\n"; print OUTPUT "OLDKEYPHRASE=NO\n"; print OUTPUT "REPORT=ON\n"; print OUTPUT "TITLE=$DocName\n" if ($DocName ne ""); print OUTPUT "WARNING=3\n"; # let individual options be set as variables # that make their way into the options section of the # output file foreach $key (keys %Definition) { ($defn,$var)=split($;,$key,2); #print STDERR "DEFN $defn VAR $var\n"; next unless $defn eq "Variable"; $val=&convert_string($Definition{"Variable",$var}); #print STDERR "VAR $var VALUE $val\n"; if ($var =~ /^HLP_OPTIONS_/) { $name = $var; $name =~ s/^HLP_OPTIONS_//; #print STDERR "OPTION $name = $val\n"; print OUTPUT "$name=$val\n"; } } print OUTPUT "\n[FILES]\n"; print OUTPUT "$OutputFile\n"; print OUTPUT "\n[CONFIG]\n"; # grab HLP_CONFIG as a filename variable that is read in # TODO ... print OUTPUT "BrowseButtons()\n"; print OUTPUT "\n[WINDOWS]\n"; if ($yellow_muck) { print OUTPUT "main=,($xcoordinate,$ycoordinate,$win_width,$win_height)". ",,,(255,255,0)\n"; } else { # leave the window stuff out! #print OUTPUT "main=,($xcoordinate,$ycoordinate,$win_width,$win_height)". ",,,\n"; } print OUTPUT "\n[MAP]\n"; foreach (keys (%WH_context_ids)) { print OUTPUT sprintf("%-30s %10d ; $WH_topic_comments{$_}\n", $WH_context_ids{$_}, $_); } } ##################### END OF MAIN PROGRAM #################################### # ##################### SUBROUTINES START #################################### # # USE : @ARGV = &parse_args(@ARGV); # SETS: $Debug, %TagGroup # sub parse_args{ local(@files, $style, $win_sw); while($_ = shift){ if(/^-c/){ # Copyright option $Copyright = shift; } elsif(/^-d/){ $Debug = 'debug'; } elsif(/^-hd/){ $hyper_debug = '1'; } elsif(/^-info/){ $TagGroup{shift} = shift; } elsif(/^-h[elp]/){ print "\nUsage: $Usage\n"; exit(0); } elsif(/^-m/){ $style = shift; if ( $style =~ /HELP/i ) { $hypertext_sw = 1 }; } elsif(/^-nostyles/){ $StyleSheet = 0; } elsif(/^-o/){ $OutputFile = shift; } elsif(/^-v/){ $vbs_sw = 1; } elsif(/^-win/) { # Windows co-ordinates $win_sw++; ($xcoordinate,$ycoordinate,$win_width, $win_height) = split(/,/, shift,4); } else{ push(@files, $_); } } if ( scalar(@files) == 0 ) { die "No Input file supplied\n"; } if ( $hypertext_sw && $OutputFile eq "" ) { die "Output file is mandatory with help option\n" ; } if ( $win_sw ) { if ( !$xcoordinate || !$ycoordinate || !$win_width|| !$win_height) { die "You need to supply x & y co-ordinates & window height & width\n"; } } else { $xcoordinate = 496; $ycoordinate = 128; $win_width = 512; $win_height = 768; } @files; } # # ########## # Mif Parsing Routines # # I've finally found a perl representation of a mif file that I'm happy with. # It's pretty memory intensive and not real zippy, but that's the nature # of the beast with MIF. # sub read_whole_file{ local(%Callbacks) = @_; # global(@Parts); @Parts = (0); # put one element in it so there's no statement 0. while(&read_mif_statement()) { print STDERR "#\n" unless ($quiet); } } # # Returns an index in @Parts so that # $Parts[$index] is the statement type # and @Parts[$index+1, $index+2, ...] are the parts of the statement. # For compound statement, @Parts[$index, ...] looks like # ('<', token, index1, index2, index3, ...) # where indexN are the substatements # # for each statment, $Callbacks{$token} is evaluated # with $token, $data, and $here set # sub read_mif_statement{ local($_, $type, $token, $data, @parts, $here, $line); # global(@Parts); while(<>){ $line = $.; $type = '<>', $token = $1, $data = $2, last if /^\s*<(\w+)\s+(.*\S)?\s*>/; $type = '<', $token = $1, last if /^\s*<(\w+)/; return 0 if /^\s*>/; $type = '=', $token = $1, $data = &read_mif_inset(), last if /^=(\w+)/; print STDERR "#\n" if (0); } &debug("LINE=$line $_ type=$type token=$token data=$data"); return 0 unless $type; local($callback); if($type eq '<>' || $type eq '='){ $here = $#Parts+1; push (@Parts, $type, $token, $data); eval $callback if $callback = $Callbacks{$token}; die "$@ $callback" if $@; } else{ while ($_ = &read_mif_statement()) { push(@parts, $_); } $here = $#Parts+1; push(@Parts, '<', $token, @parts); eval $callback if $callback = $Callbacks{$token}; die "$@ $callback" if $@; } $Lines{$here} = $line; # for debugging purposes $here; } # # Read until a line starts with "=EndInset" # and return all the lines concatenated # sub read_mif_inset{ local($inset); while(<>){ $inset .= $_; last if /^=EndInset/; } $inset; } sub new_statement{ local($s) = $#Parts + 1; push(@Parts, @_); return $s; } sub type{ $Parts[$_[0]]; } sub token{ $Parts[$_[0]+1]; } sub data{ $Parts[$_[0]+2]; } sub parts{ local($i) = @_; if(&type($_[0]) eq '<'){ local($s) = $i+2; for(; $Parts[$s] > 0; $s++){ } return @Parts[$i+2 .. $s-1]; }else{ return @Parts[$i+2]; #data } } # Dump the context of the MIF statement ... such that it is easier # to figure out information about where an error has occured ... the # original stuff was a little hairy in this area too --tjh # TODO: compare this with expand_mif_statement() sub DUMP_CONTEXT { local($__s) = @_; local($here,$exp); foreach $here (&parts($__s)){ local($type) = &type($here); local($token) = &token($here); local($data) = &data($here); # exp has newline in it! $exp=&expand_mif_statement($here,"EXP: "); print STDERR "[$here]:$type:$token:$data || $exp"; } } sub do_statement{ # global(@Parts); local($__s, %__callbacks) = @_; local($here, $__cb); # one level deeper in the do_statement call stack $stmt_call_level++; foreach $here (&parts($__s)){ local($token) = &token($here); local($data) = &data($here); $stmt_call_level_context{"$stmt_call_level"}=$here; eval $__cb if $__cb = $__callbacks{$token}; warn "Error executing: $__cb \n-->$@" if $@; warn "DEBUG: statement=$__s token=$token data=$data here=$here parts=". &parts($__s) . "line:", $Lines{$here} if (0); if ((&type($here) ne '<>') && !$__cb) { warn "IGNORED: statement=$__s token=$token data=$data here=$here ". "parts=" . &parts($__s) . "line:" , $Lines{$here}; # TJH ADDITION print STDERR "HERE:\n"; &DUMP_CONTEXT($here); print STDERR "STMT:\n"; &DUMP_CONTEXT($__s); # print STDERR "PARENT:\n"; # &DUMP_CONTEXT($stmt_call_level_context{$stmt_call_level-1}); } # TJH took this out # &assert('$token =~ /\w+/'); } # returning from one level down ... $stmt_call_level--; } sub expand_mif_statement{ # global(@Parts); local($i, $leader) = @_; local($_) = &type($i); if($_ eq '<>'){ return (sprintf("%s<%s %s>\n", $leader, @Parts[$i+1, $i+2])); }elsif($_ eq '='){ return (sprintf("=%s\n%s", @Parts[$i+1, $i+2])); }elsif($_ eq '<'){ local(@lines); @lines = (sprintf("%s<%s\n", $leader, &token($i))); foreach (&parts($i)){ #TJH#push (@lines, &expand_mif_statement($_, " $leader")); push (@lines, &expand_mif_statement($_, "$leader ")); } push(@lines, "$leader>\n"); return @lines; } } # # use $tag = &data_search($para, 'PgfTag', 2) # to search 2 levels of the $para statement, # and return the data of the first PgfTag statement found. # sub data_search{ local($s, $t, $levels) = @_; foreach (&parts($s)){ if(&type($_) eq '<'){ if($levels>1){ $s = &data_search($_, $t, $levels-1); return $s if $s ne ''; } }else{ return &data($_) if &token($_) eq $t; } } return ''; } # # use &token_search($compound_statement, "token", 3) # to search the next three levels of hairy_statement for # "token" statements. # sub token_search{ local($s, $t, $levels) = @_; local(@matches, $_); foreach (&parts($s)){ push(@matches, $_) if &token($_) eq $t; push(@matches, &token_search($_, $t, $levels-1)) if &type($_) eq '<' && $levels>1; } return @matches; } # # ######## # %State manipulation # sub change_attr{ local($attr, $val) = @_; &debug("change attr: $attr ($State{$attr}) -> [$val]"); $State{$attr} = $val , return "\\$attr$val " unless $State{$attr} eq $val; ''; } sub change_dims{ local($dims, @attrs) = @_; local($_, $r); foreach (&rtf_dimensions($dims)){ local($attr) = shift(@attrs); last unless $attr; $attr =~ s-/(\d+)-- && ($_ = int($_/$1)); #HACK $r .= &change_attr($attr, $_); } #print STDERR "change_dims $dims->$r\n"; $r; } sub select_attr{ local($key, $s, %attrs) = @_; if($attrs{$key}){ &debug("select attr: '$s=$key' from ", join(",", %attrs)), $State{$s} = $attrs{$key}, return "\\$attrs{$key} " unless $State{$s} eq $attrs{$key}; } $State{$s} = ''; } ############# # # Conversions # sub convert_paragraph_catalog{ local($s) = @_; #global(%State, %PgfCatalog); local($tag); &do_statement($s, 'Pgf', ' $tag = &convert_string(&data_search($here, "PgfTag")); $PgfCatalog{"Statement", $tag} = $here; # for a full catalog we want conversion now! if ($fullcatalog) { &change_style($tag); } ' ); } # convert a freeform string into a "safe" context id for # the purposes of Windows Help sub convert_context { local($s)=@_; $s =~ s/[#, ._\/\-><()?&\[\]\\{}+'`~:]//g; ##print STDERR "FROM: @_ to $s\n"; return $s; } sub convert_character_catalog{ local($s) = @_; #global(%State, %FontCatalog); local($tag); &do_statement($s,'Font', ' $tag = &convert_string(&data_search($here, "FTag")); $FontCatalog{"Statement", $tag} = $here;' ); } # # Returns RTF to change from what's in %State to what's in $s # EXCEPT TABS! use ¤t_tabs() to get them. # sub convert_pgf_format{ local($s) = @_; local($rtf, $_); local($lindent) = &data_search($s, 'PgfLIndent'); local($li); if ($lindent gt ''){ print STDERR "LINDENT: $lindent\n" if ($tmpdebug); ($li) = &rtf_dimensions($lindent); $State{'LIndent'}=$lindent; } else{ ($li) = &rtf_dimensions($State{'LIndent'}); } local($findent) = &data_search($s, 'PgfFIndent'); local($fi); if ($findent gt ''){ ($fi) = &rtf_dimensions($findent); $State{'FIndent'}=$findent; } else{ ($fi) = &rtf_dimensions($State{'FIndent'}); } $rtf .= &change_attr("fi", $fi - $li); $rtf .= &change_attr("li", $li); &debug("findent: $findent fi: $fi lindent: $findent li: $li"); &do_statement ($s, 'PgfNumberFont', '$State{"NumberFont"} = &convert_string($data)', 'PgfNumFormat', '$State{"NumFormat"} = &convert_string($data, $State{"Family"} ne "Symbol");', 'PgfNextTag', '$rtf .= &change_attr("snext", &intern(*Tag, $data))', 'PgfNumTabs', 'undef($State{"TabStops"})', 'TabStop', '0 && &TabStop($here)', 'PgfAlignment', '$rtf .= &select_attr($data, "Alignment", "Left", "ql", "Center", "qc", "Right", "qr", "LeftRight", "qj")', # RTF & MIF are different about tabs and first indents 'PgfRIndent', '$rtf .= &change_dims($data, "ri")', 'PgfTopSeparator', '$rtf .= &change_attr("brdrt", 1) if $data ne "`\'"', #@# 'PgfBotSeparator', '$rtf .= &change_attr("brdrb", 1) if $data ne "`\'"', #@# #TJHNEW# 'PgfPlacement', ' $State{"Placement"} = &convert_string($data); if ($winhelp) { # look at for not Anywhere as TOPIC start trigger if ( $State{"Placement"} ne "Anywhere" ) { $State{"NEWTOPIC"} = 1; } else { $State{"NEWTOPIC"} = 0; } } else { $rtf .= &select_attr($data, "Placement", "ColumnTop", "pagebb", "PageTop", "pagebb", "LPageTop", "pagebb", "RPageTop", "pagebb"); } ', 'PgfSpBefore', '$State{"SpBefore"} = &change_dims($data,"sb")', 'PgfSpAfter', '$State{"SpAfter"} = &change_dims($data,"sa")', #@# withprev ##TJH-WINHELP-no keepn0 'PgfWithNext', ' if (!$winhelp) { $rtf .= &select_attr($data, "WithNext","Yes", "keepn", "No", "keepn0") } ', ##TJH-WINHELP-no keep1 'PgfBlockSize', ' if (!winhelp) { $rtf .= &change_attr("keep", 1) unless $data <2 }', 'PgfLeading', '$rtf .= &change_dims($data, "sl")', 'PgfFont', '$rtf .= &convert_char_format($here)' ); &debug("converted $State{'PgfTag'} -> $rtf"); $rtf; } sub TabStop { local($s) = @_; #@# tab alignment ignored! $State{'TabStops'} .= " " . &data_search($s, 'TSX'); } sub convert_char_format{ local($rtf); &do_statement ($_[0], 'FFamily', '$State{"Family"} = &convert_string($data); $rtf .= &change_attr("f", &intern(*Typeface, $data))', #@# 'FVar', 'warn "IGNORED: Variation $data" unless $data =~ /regular/i', ##TJHNEW## # FTag can also be used to set the font to Italic or Bold or # also to reset both of these back to "normal" 'FTag', ' $str=&convert_string($data); $rtf .= &handle_font_change($str); ', 'FColor', '$rtf .= &select_attr(&convert_string($data),"Color", "Black", "cf0", "White", "cf1", "Red", "cf2", "Green", "cf3", "Blue", "cf4", "Cyan", "cf5", "Magenta", "cf6", "Yellow", "cf7", "", "cf0" )', 'FWeight', '$rtf .= &select_attr(&convert_string($data),"Weight", "Bold", "b", "Regular", "b0")', 'FAngle', '$rtf .= &select_attr(&convert_string($data), "Angle", "Italic", "i", "Oblique", "i2", "Regular", "i0")', 'FSize', '$State{"fs"}=$data; $rtf .= &change_dims($data, "fs/10")', 'FUnderline', '$rtf .= &select_attr($data, "Underline", "Yes", "ul", "No", "ulnone")', 'FStrike', '$rtf .= &select_attr($data, "Strike", "Yes", "strike", "No", "strike0")', 'FSupScript', '$rtf .= &select_attr($data, "SupScript", "Yes", "up6", "No", "up0")', 'FSubScript', '$rtf .= &select_attr($data, "SubScript", "Yes", "dn6", "No", "dn0")', 'FChangeBar', '$rtf .= &select_attr($data, "ChangeBar", "Yes", "revised", "No", "revised0")', 'FOutline', '$rtf .= &select_attr($data, "Outline", "Yes", "outl", "No", "outl0")', 'FShadow', '$rtf .= &select_attr($data, "Shadow", "Yes", "shad", "No", "shad0")', 'FSeparation', '$rtf .= &change_attr("cf", $data)' ); &debug("char format: $rtf"); ### print STDERR "convert_char_format: Weight $State{'Weight'} Angle $State{'Angle'}\n"; $rtf; } ######## sub convert_frame{ local($s) = @_; #@@ local(@BRect) = @BRect; local(@ret); local($align,$oldalign)=0; &debug("convert frame: $s"); &do_statement ($s, 'TextRect', 'push(@ret, &convert_textrect($here))', 'Frame', 'push(@ret, &convert_frame($here))', 'ImportObject', 'push(@ret, &convert_picture($here))', 'BRect', 'push(@ret, &change_dims($data, "posx", "posy", "absw"))', 'AnchorAlign', '$oldalign=$State{"Alignment"}; $align=1; push(@ret, &select_attr($data, "Alignment", "Left", "ql", "Center", "qc", "Right", "qr", "LeftRight", "qj"));', 'FrameType', 'push(@ret, &select_attr($data, "FrameType", "Inline", "posyil", "Top", "posyt", "Bottom", "posyb", "Left", "posxl", "Right", "posxr", "Near", "posxi", "Far", "posxo"))' ); # if we fiddled the alignment then we put it back how # it was as we don't want to affect other things --tjh if ($align) { push(@ret,"\\par\\pard"); $State{"Alignment"}=$oldalign; } @ret; } sub convert_textrect{ local($tr) = @_; local(@ret); local($myparts) = &parts($tr); local($mytoken) = &token($tr); local($mydata) = &data($tr); ## &DUMP_CONTEXT($tr); ##print STDERR "TEXTRECT: $_ : $tr => $myparts $mytoken : $mydata\n"; &do_statement ($tr, 'DashedPattern', ' # do nothing ... print STDERR "GOT DASHED PATTERN\n"; ', 'ID', 'local($_) = $TextRect{$data}; $_ && !$TextFlow{$_}++ ? push(@ret, &convert_flow($_)) : &debug("no flow or repeated flow:$data line: ",$Lines{$_});', ); @ret; } # # this is one alternative... # sub old_convert_textrect{ local($tr) = @_; local($id, @ret); &debug("convert textrect $tr"); for($id = &data_search($tr, 'ID', 1); $id; $id = &data_search($tr, 'TRNext', 1)){ local($s) = $TextRect{$id}; last if $TextRect[$s]++; &debug("TextRectID = $id"); push(@ret, &convert_flow($s)); } @ret; } #> Modified Table conversion to work. #> Assumption: That TblColumnWidth, TblH & TblBody are the main parts #> for conversion only #> Global_Var: Tbl_sw: Used in convert_paragraph for special paragraph handling sub convert_table{ local($s) = @_; local(@r, @cellx); #>Added @cellx for cell dimensions #>Set table switch used in convert_paragraph section $Tbl_sw++; # need to know which row we are on in the table $State{$Tbl_Sw,"ROW"}=0; &do_statement ($s, 'TblColumnWidth', 'push(@cellx, &rtf_dimensions(&data($here)))', 'TblH','push(@r, &convert_rows($here, *cellx, 1))', # handle the title like "normal" text for the moment 'TblTitleContent', 'push(@r, &convert_flow($here), "" ); ', 'TblFormat', '#IGNORED#', 'TblBody','push(@r, &convert_rows($here, *cellx, 0))', ); push(@r, "\\pard"); #> Requires mark to terminate table $Tbl_sw--; #> Set table switch used in convert_paragraph @r; } #> Converts a row for a table #> Sets standard headings for the row and converts cell size into twips, then #> converts cells data #> sub convert_rows{ local($s, *cellx, $row_sw) = @_; local(@r); &do_statement ($s, 'Row', '$State{$Tbl_Sw,"ROW"}++; push(@r, "\n\\\\trowd\\\\trgaph108\\\\trleft-108 "); local($cell, $cell_twips); foreach $cell (@cellx) { $cell_twips = $cell_twips + $cell; push(@r, "\\\\cellx$cell_twips "); } push(@r, "\\\\pard\\\\plain\\\\intbl ",&convert_cells($here), " \\\\pard \\\\intbl \\\\row")' ); @r; } #> Convert cells of a table # sub convert_cells{ local($s) = @_; local(@r); &do_statement ($s, 'Cell', 'push(@r, &convert_cell($here))' ); @r; } #> Convert single cell in table and suffix of cell to terminate cell definition # sub convert_cell{ local($s) = @_; local(@r); #@@ cell formatting! &do_statement ($s, 'CellContent', ' $State{$Tbl_sw,"FirstCellPara"}=1; $State{$Tbl_sw,"FirstTableRow"}=($State{$Tbl_sw,"ROW"}==1); push(@r, &convert_flow($here), "\\\\cell ")' ); @r; } #> Converts a picture into RTF #> Assumptions: That all 'ImportObFileDI' will have a corresponding bitmap. #> Glbal_Var: @Bmroot : A list of paths used for Bitmaps sub convert_picture{ local($s) = @_; local(@r, $color, $unixpath, $dipath, $epsi, $image, $brect); &do_statement ($s, 'Separation', '$color = $data', 'ImportObFile', '$unixpath = $data', 'ImportObFileDI', '$dipath = $data', 'EPSI', '$epsi = $data', 'FrameImage', 'push(@r, "\\\\frameimage\n", $data)', 'BRect', '$brect = $data' ); &debug("picture: color($color) file($unixpath,$dipath) brect($brect)"); if($brect){ local($l, $t, $h, $w) = &rtf_dimensions($brect); unshift(@r, "\\picwgoal$w\\pichgoal$h\n"); } undef($unixpath) if $unixpath =~ /internal inset/; local($path, $filename); if($dipath){ ($path, $filename) = &convert_filename($dipath); #> CRW warn "no path is : $dipath" if ( $filename eq "" ); #> CRW if ( $filename ) { #> CRW if (0) { # center the pictures ... might stuff up a few # things with inline mini-images but that can # be sorted out later --tjh push(@r, "\n\\qc\\{bmc $filename\\}\\par\n" ); } else { push(@r, "\n\\{bmc $filename\\}\n" ); #> CRW } push(@Bmroot, $path) if ( $path ); #> CRW } } else { if($epsi){ $epsi =~ s/.*&%v\s*&//; $epsi =~ s/\n&//g; push(@r, "\\epsi\n", $epsi); } @r = ("\\qc{\\pict\n", @r, "}\\par\n"); # put in a centered paragraph @r = ("{\\cf$color", @r, "}") if $color; } @r; } #> CRW convert_filename : Converts Frame file names into paths , storing #> those paths, to be used in the hpj files sub convert_filename{ local( $Filename) = @_; local( $Directory, $file, @File_Parts, $Path_sw, $Temp_File ); $Filename =~ s/[`']//g; @File_Parts = split( // ) { # Root Directory - Unix ($Directory = $_ ) =~ s/r\\>/\// ; } elsif ( $_ =~ /^c\\>/ ) { # Relative Path name unless 'C' if ($Path_sw) { $file =~ s/^c\\>/\//; $Directory .= $file; } else { $file =~ s/^c\\>//; } $Path_sw = 1; if ( $_ = $File_Parts[$#File_Parts] ) { ($Filename = $_) =~ s/^c\\>//; } else { $Directory .= $file; } } elsif ( $_ =~ /^u\\>/ ) { # Previous directory ie go up $Directory .= "../"; $file =~ s/^u\\>//; if ( $_ = $File_Parts[$#File_Parts] ) { ($Filename = $_) =~ s/^u\\>//; } else { $Directory .= $file; } } } # Should have Directory & Filename #> Convert filename to be a "BMP" always for WinHelp Files if ( $Filename ne "" ) { $Filename =~ s/\.(gif|mif|epsi|eps)$/\.bmp/; } return($Directory, $Filename); } # sub convert_flow{ local($s, $Container) = @_; local(@r, %Notes); &do_statement ($s, 'Notes', '&save_notes($here)', 'Para', 'push(@r, &convert_paragraph($here))' ); @r; } sub save_notes{ local($s) = @_; local($_, $n); foreach (&parts($s)){ $n = &data_search($_, 'ID', 1); # &debug("note: $n is:", &expand_mif_statement($_)); $Notes{$n} = $_; } } #> Convert a block of markers/text that starts with the marker * 'PgfNumberFont', '$State{"NumberFont"} = &convert_string($data); ', 'PgfNumFormat', '$State{"NumFormat"} = &convert_string($data,$State{"Family"} ne "Symbol");', # certainly need to support spacing overrides! 'PgfSpBefore', '$State{"SpBefore"} = &change_dims($data,"sb")', 'PgfSpAfter', '$State{"SpAfter"} = &change_dims($data,"sa")', 'ParaLine', ' @newdata=(); if ($State{$Tbl_sw,"FirstCellPara"}) { $State{"SpBefore"} = &change_dims("0 pt","sb"); $State{"SpAfter"} = &change_dims("0 pt","sa"); } push(@newdata,"$State{SpBefore}","$State{SpAfter}"); # add in NumFormat if there is no NumString setting # and a NumFormat exists ... if ( !$have_numstring && $State{"NumFormat"} ) { $delayed_text=&convert_numformat($State{"NumFormat"}); } push(@newdata,&convert_paraline($here, *pre, *post)); if ($verbose && $pgfnumdebug) { $newdatastring = join("|",@newdata); print STDERR "STATE " . $State{"NumFormat"} . "\n"; print STDERR "STMT $have_numstring $newdatastring\n"; } push(@lines, @newdata, "\n"); ', ); # we have done at least one paragraph so we are no longer # on the first paragraph of a cell ... so clear it now $firstcellpara=$State{$Tbl_sw,"FirstCellPara"}; # we need this below! undef $State{$Tbl_sw,"FirstCellPara"}; &debug("convert_paragraph: ",$State{'PgfTag'}); print STDERR "." unless ($quiet); push(@lines, $HyperGroup), undef($HyperGroup) if $HyperGroup; local($group); #@#lines is arbitrary $RTFInfo{$group} .= join('', @lines)."\\par\n" if $group = $TagGroup{$State{'PgfTag'}}; &debug(%TagGroup); &debug("tag: ", $State{'PgfTag'}, " group: ", $group); #> CRW Added !$Tbl_sw #if ( !$skiptags{$State{PgfTag}} && !$Tbl_sw ) { if ( !$skiptags{$State{PgfTag}} ) { # $Container is, e.g. '\intbl ' (for tables) #> CRW Added Test for tt_TableTitle to generate Autonumber Title # THIS IS OLD CODE ... we now look at the table title stuff # as the user can set that to whatever they like! if (0) { if ( $State{'PgfTag'} eq 'tt_TableTitle' ) { local($Table_Hdr) = "{\\b Table ". ++$PgfAutoNum{'tt_TableTitle'} .": }"; unshift(@lines, "$Table_Hdr"); } } # return(@pre, @fmt, $Container, ¤t_tabs(), # @lines, "\\par", @post, "\n"); # moved the insert of the "\\par" between lines and post # up to the start of the next one ... if (!$SDFVAR{"header"} && ($paragraph_count>1)) { ##print STDERR "inserting par\n"; if ( ! $firstcellpara ) { if ($rtfdebug) { unshift(@pre,"\\par{{ENDPARA}}"); } else { unshift(@pre,"\\par"); } } else { if ($rtfdebug) { unshift(@pre,"{{FIRSTCELL-NOENDPARA}}"); } } } $paragraph_count++; if ($rtfdebug) { return(@pre, @fmt, $Container, ¤t_tabs(), @lines, "{{OLD-PAR}}", @post, "\n"); } else { return(@pre, @fmt, $Container, ¤t_tabs(), @lines, "\\line", @post, "\n"); } } else { # $Container is, e.g. '\intbl ' (for tables) return ( ($Tbl_sw) ? "@fmt@lines" : ""); } } sub current_tabs{ local($rtf, $_); local($li) = &rtf_dimensions($State{'LIndent'}); foreach (&rtf_dimensions($State{'TabStops'})){ $_ -= $li; #@# MIF to RTF mindset $_ = $_ - 720 + 72 if ( $winhelp ); $rtf .= "\\tx$_ "; } $rtf; } sub convert_numstring{ local($string) = @_; local(%State) = %State; # don't clobber font local($numfont) = $State{'NumberFont'}; local($font) = $numfont ? &change_char_style($numfont) : ''; local($form) = $State{'NumFormat'}; $string = &convert_string($string, $State{'Family'} ne 'Symbol'); &debug("numstring($string) [font($numfont): $font form: $form]"); local($tabs) = ¤t_tabs(); return "{\\field{\\fldinst PgfNumFormat $form}{\\fldrslt $font$tabs$string}}"; } # # convert_numformat : handle the FrameMaker PgfNumFormat construct # # [TAG:][TEXT|]* # # TAG is anything ... typically a single letter # EXPR is something like , , # or the above with A for alpha # # From FrameMaker 4 - Using FrameMaker 4-38 # # keep same don't display # reset to zero ... don't display # n=numeric 1,2,3,4,... # r=lower roman i,ii,iii,iv,... # R=upper roman I,II,III,IV,... # a=lower alpha a,b,c,...,aa # A=upper alpha A,B,C,...,AA # sub num_eval{ local($tag,$level,$text,$expr)=@_; local($result,$op,$arg,$type); # keep state local here ... makes moving this to other packages # much easier ... who knows if I've got the following list right # as I cannot recollect much of my Latin classes from so long ago # -- tjh :-) if (!defined $num_to_roman) { @num_to_roman=('0','i','ii','iii','iv','v','vi','vii','viii','ix','x', 'xi','xii','xiii','xiv','xv','xvi','xvii', 'xviii', 'xix','xx' ); } $type=''; $op=''; $arg=''; $type=substr($expr,0,1); if (length($expr)>1) { $op=substr($expr,1,1); $arg=substr($expr,2); $arg = '1' if ($arg eq ''); } # make the tag the combined name and the type so that # things are easier to follow if we have to debug this :-) $tag = "$tag$type"; $result=''; if ($op eq '') { if (!defined($NUM_EVAL{$tag,$level})) { $NUM_EVAL{$tag,$level}=1; } } elsif ($op eq '+') { $NUM_EVAL{$tag,$level}+=$arg; } elsif ($op eq '-') { $NUM_EVAL{$tag,$level}-=$arg; } elsif ($op eq '=') { $NUM_EVAL{$tag,$level}=$arg; } # altering the lowest level value *always* clears # the other dependant values ... # i.e. 1.2 changing the 1->2 means .2->.1 if ($op ne '') { undef $NUM_EVAL{$tag,$level+1}; } # A = alpha, n = numeric if ($type eq 'A') { $result = sprintf("%c",ord('A')+$NUM_EVAL{$tag,$level}-1); } elsif ($type eq 'a') { $result = sprintf("%c",ord('a')+$NUM_EVAL{$tag,$level}-1); } elsif ($type eq 'R') { $result=$NUM_EVAL{$tag,$level}; $result =~ s/(\S+)/\U$1\E/g; } elsif ($type eq 'r') { $result=$num_to_roman[$NUM_EVAL{$tag,$level}]; } else { $result=$NUM_EVAL{$tag,$level}; } if ($pgfnumdebug) { print STDERR "num_eval($tag,$level) $expr :OP=$op ARG=$arg -> $result [$text]\n"; } if ($use_numformat) { return "$text$result"; } else { return "$text"; } } sub convert_numformat{ local($str) = @_; local($format,$tag,$rest,$level); $format=$str; if (substr($format,1,1) eq ':') { $tag=substr($format,0,1); substr($format,0,2)=''; } # throw away ">." if not using the number stuff as # it is probably not what the user wants or expects to see if (!$use_numformat) { $format =~ s/>\./>/g; } $level=0; $format =~ s/([^<]*)(<([^>]*)>)/&num_eval($tag,$level++,$1,$3)/ge; if ($pgfnumdebug) { print STDERR "NUMFORMAT($str) => TAG $tag FORMAT $format\n"; } return $format; } sub change_style{ local($tag) = @_; local($style, $_); if($PgfCatalog{"Style", $tag}){ &set_paragraph_format($tag); $style = $PgfCatalog{"Style", $tag}; }else{ local($pgf_fmt) = $PgfCatalog{'Statement', $tag}; if($pgf_fmt){ &reset_paragraph_format(); &reset_character_format(); $style = &convert_pgf_format($pgf_fmt); $PgfCatalog{"Style", $tag} = $style; ##STYLE## #warn "Catalog entry for '$tag' added as $style"; &save_paragraph_format($tag); }else{ warn "No catalog entry for '$tag'"; } } if ($pgfnumdebug) { print STDERR "CHANGE_STYLE to \"$tag\" NumFormat \"$State{'NumFormat'}\" Placement \"$State{'Placement'}\" NEWTOPIC $State{'NEWTOPIC'}\n"; } $State{'PgfTag'} = $tag; join('', "\\pard\\plain\\s", &intern(*Tag, $tag), " ", $style); } sub change_char_style{ local($tag) = @_; local($style, $_); &reset_character_format(); $State{'FTag'} = $tag; local($s) = $FontCatalog{'Statement', $tag}; $s ? "\\plain" . &convert_char_format($s) : ''; } #> Converts the block of text/markes which start with $HyperGroup is determined from Marker Type 8 #> $Xref_TOC is determined from Marker Type 11 sub convert_paraline{ local($s, *pre, *post) = @_; #@# empty_hyper gets around the: hot-text bug. local(@text, $empty_hyper); #print STDERR "SDFVAR header = " . $SDFVAR{"header"} . "\n"; #print STDERR "SDFVAR window = " . $SDFVAR{"window"} . "\n"; &do_statement ($s, 'DashedPattern', '# do nothing', 'String', 'local(@tmptext)=&convert_string($data,$State{"Family"} ne "Symbol"); # if we have hypertext information then we process it # now we have all the pieces required --tjh if ( $Xref_TOC && $hypertext_sw ) { #> If TOC has been defined $Xref{$Xref_TOC} = "@tmptext"; $XrefTopic{$Xref_TOC} = &convert_context("@tmptext"); if ($tjh_xref_debug) { print STDERR "Xref{$Xref_TOC}=\"$Xref{$Xref_TOC}\"\n"; } } ##print STDERR "Text: " . join(" ",@tmptext) . " Delayed $delayed_text\n"; # force a page break here for the first time we hit a # popup window ... might have to think about how to # separate multiple popup windows too ... if ($SDFVAR{"window"}) { if (!$done_pagebreak) { $done_pagebreak=1; if ($rtfdebug) { push(@text, "\n\\\\page{{WINDOWSTART}}\n"); } else { push(@text, "\n\\\\page\n"); } } } elsif ($SDFVAR{"endwindow"}) { # push another page break? if ($rtfdebug) { push(@text, "\n\\\\page{{WINDOWEND}}\n"); }else { push(@text, "\n\\\\page\n"); } $done_pagebreak=0; } elsif ($SDFVAR{"header"}) { # keep this with the previous paragraph! if ($rtfdebug) { push(@text, "\n\\\\keepn{{HEADERKEEP}}\n"); } else { push(@text, "\n\\\\keepn\n"); } } # if we have saved up some text that goes before the # next output string and it has formatting information # (i.e. font specification) then we must grab that # now and then reset back to current ... ##if ($delayed_text && $State{"NumberFont"} ) if ($delayed_text) { &save_char_format(); $delayed_text = &handle_font_change($State{"NumberFont"}) . $delayed_text . &restore_char_format(); } if ( $HyperGroup && $hypertext_sw ) { ($token,$arg) = $HyperGroup =~ /(\S+) (.*)/; $curtag=$State{PgfTag}; #$heading=($curtag =~ /^h[1]_Heading\b/); #$heading=$State{"PgfPlacement"} ne "Anywhere"; $heading=$State{"NEWTOPIC"} eq "1"; $WH_topic = &convert_context($arg); &hyperdebug("Token=$token Arg=$arg Hyper=$HyperGroup Tmptext=@tmptext"); # handle each hypertext construct ... if ( $token eq "newlink" ) { #>Added enhanced footnote text, check that tmptext is not blank if ( $heading && $tmptext[0] ne "") { #> Footnote - Title $Footnote_txt = "\\\\keepn {\\\\up6 \${\\\\footnote \\\\pard". "\\\\plain{\\\\up6 \$} @tmptext}}\n"; $Footnote_txt .= "{\\\\up6 +{\\\\footnote \\\\pard\\\\plain". "{\\\\up6 +}"; #>Footnote Browse Seqeunce $Footnote_txt = sprintf("$Footnote_txt %04d}}\n",++$browse_seqno); push(@text, "\n"); # page break *before* the topic starts ... push(@text, $paragraph_count>0 ? "\\\\page" : "", "\n"); push(@text, $Footnote_txt); $paragraph_count++; #>New Page after every major header/topic } &rtf_topic_keyword(*WH_topic, *text, $arg); &Generate_ID($WH_topic,*tmptext); # override TOC marker text from the default of the # value of the string to being what was directly # specified --tjh if ( $Xref_TOC && $hypertext_sw ) { $XrefTopic{$Xref_TOC} = "$WH_topic"; } if ( $ExtraHyperGroup ) { ($token,$arg) = $ExtraHyperGroup =~ /(\S+) (.*)/; $WH_topic=&convert_context($arg); &hyperdebug( "Extra Token=$token Arg=$arg"); if ( $token eq "HELPTOC" ) { push(@text,"{\\\\up6 #{\\\\footnote \\\\pard\\\\plain". "{\\\\up6 #} $WH_topic}}\n"); &Generate_ID($WH_topic, *tmptext); } undef ($ExtraHyperGroup); } # allow for delayed text that must stay with # the real string and not be broken by the hypertext # stuff being inserted! push(@text,$delayed_text) if ($delayed_text); $delayed_text=""; push(@text,@tmptext); # Push Actual Header into Document } elsif ( $token eq "gotolink" ) { # allow for delayed text that must stay with # the real string and not be broken by the hypertext # stuff being inserted! push(@text,$delayed_text) if ($delayed_text); $delayed_text=""; if ( $arg =~ /\.fvo:/ ) { #> CRW This is an external link local($file, $link); $arg =~ s/\.fvo/\.hlp/; #>Strip .fvo ext ($file, $link) = split(/:/, $arg); # IGC begin #$file = &convert_context($file); $link = &convert_context($link); # IGC end $WH_topic = "$link\@$file"; } if ($SDFVAR{"popup"}) { push(@text,"{\\\\ul @tmptext}{\\\\v $WH_topic}"); undef $SDFVAR{"popup"}; } else { push(@text,"{\\\\uldb @tmptext}{\\\\v $WH_topic}"); } } elsif ( $token eq "HELPTOC" ) { #> $ Footnote - Title $Footnote_txt = "{\\\\up6 \${\\\\footnote \\\\pard\\\\plain". "{\\\\up6 \$} @tmptext}}\n"; $Footnote_txt .= "{\\\\up6 #{\\\\footnote \\\\pard\\\\plain". "{\\\\up6 #} $WH_topic}}\n";#> # Footnote Context String $Footnote_txt .= "\\\\keepn{\\\\up6 +{\\\\footnote \\\\pard". "\\\\plain{\\\\up6 +}"; #> + Footnote Browse Seqeunce $Footnote_txt = sprintf("$Footnote_txt %04d}}\n",++$browse_seqno); push(@text, "\n"); push(@text, $paragraph_count>0 ? "\\\\page" : "", "\n"); push(@text, $Footnote_txt); &Generate_ID($WH_topic, *tmptext); if ( $ExtraHyperGroup ) { ($token,$arg) = $ExtraHyperGroup =~ /(\S+) (.*)/; $WH_topic=&convert_context($arg); &hyperdebug("Extra Token=$token Arg=$arg"); if ( $token eq "HELPTOC" ) { push(@text,"{\\\\up6 #{\\\\footnote \\\\pard\\\\plain". "{\\\\up6 #} $WH_topic}}\n"); &Generate_ID( $WH_topic, *tmptext); } undef ($ExtraHyperGroup); } # allow for delayed text that must stay with # the real string and not be broken by the hypertext # stuff being inserted! push(@text,$delayed_text) if ($delayed_text); $delayed_text=""; push(@text,@tmptext); #> Assume that gotopage is external document(Table of ContentsId=1) } elsif ( $token eq "gotopage" ) { local($macro); ($WH_topic = $arg) =~ s/\.fvo.*/\.hlp/; #$macro = "{\\\\v \!JC("; #$macro .= "\"$WH_topic\"\,0000000001)}"; # use the JumpContents option and then we do not # get two error windows ... --tjh $macro = "{\\\\v \!JumpContents(\"$WH_topic\")}"; # allow for delayed text that must stay with # the real string and not be broken by the hypertext # stuff being inserted! push(@text,$delayed_text) if ($delayed_text); $delayed_text=""; push(@text, "{\\\\uldb @tmptext}", $macro); #> #> Assume that the gotourl is a URL for WWW } elsif ( $token eq "gotourl" ) { if ($sdfvartrace) { print STDERR ("SDF:gotourl: $tmptext\n"); } # allow for delayed text that must stay with # the real string and not be broken by the hypertext # stuff being inserted! push(@text,$delayed_text) if ($delayed_text); $delayed_text=""; push(@text, "{\\\\b @tmptext}"); #> URL is bolded with text } else { # allow for delayed text that must stay with # the real string and not be broken by the hypertext # stuff being inserted! push(@text,$delayed_text) if ($delayed_text); $delayed_text=""; push(@text, "{{\\\\v \\\\xe $HyperGroup}}"); } # once we use the hypertext stuff in the output it # is totally finished with ... so blow it away! undef ($HyperGroup); # these are cleared on para entry so can be removed # from here soon ... #undef ($USER_WH_context); #undef ($USER_WH_topic); } else { if ( $HyperGroup && !$hypertext_sw ) { push( @tmptext , "{\\\\pard \\\\plain \\\\v\\\\f4\\\\fs20". "{\\\\xe {@tmptext}}}"); undef $HyperGroup; } # any delayed text must go out now as it can be # delayed no longer! push(@text,$delayed_text) if ($delayed_text); $delayed_text=""; push(@text,@tmptext); } # finished with this stuff now ... if ( $Xref_TOC && $hypertext_sw ) { #> If TOC has been defined $Xref_TOC = ""; } $empty_hyper=0;', 'Char', 'push(@text, &convert_character($data))', 'ATbl', 'local(%State) = %State; local(@tbl) = &convert_table($Tbl{$data}); $State{"TblPlacement"} =~ /Top|Left|Right|Near|Far/ ? push(@pre, "{", @tbl, "}") : push(@post, "{", @tbl, "}")', 'AFrame', 'local(%State) = %State; &debug("converting AFrame $data"); local(@af) = &convert_frame($AFrame{$data}); $State{"FrameType"} =~ /Top|Left|Right|Near|Far/ ? push(@pre, "{", @af, "}") : push(@post, "{", @af, "}")', 'FNote', 'push(@text, &convert_footnote($Notes{$data}))', 'XRefEnd', 'push(@text, &convert_xref_end($data))', #@@ there could be a problem with tagged fonts here: # convert_char_format ignores tags. Catalog lookup occurs # in its caller (e.g. convert_character_catalog). # And this is its caller. 'Font', 'push(@text, $HyperGroup), undef($HyperGroup) if $HyperGroup && !$empty_hyper; push(@text, &convert_char_format($here))', 'Marker', 'push(@text, &convert_marker($here)); $empty_hyper=1', 'Variable', 'push(@text, &convert_definition("Variable", &data_search("VariableName", $here)))', 'XRef', 'push(@text, &convert_xref($here))' ); @text; } local($active); sub handle_font_change{ local($str)=@_; local($ret); return '' if ($active); $ret=''; if ($str eq "Bold") { # Bold by itself means Bold with *no* Italics $ret = &select_attr($str,"Weight", $str, "b"); $ret .= &select_attr($str,"Angle", $str, "i0"); } elsif ($str eq "Italic") { # Italics by itself means Italics with *no* Bold $ret = &select_attr($str,"Angle", $str, "i"); $ret .= &select_attr($str,"Weight", $str, "b0"); } elsif ($str eq "" || $str eq "Default" ) { $ret .= &select_attr($str,"Weight", $str, "b0"); $ret .= &select_attr($str,"Angle", $str, "i0"); $ret .= &select_attr($str,"Color", $str, "cf0"); } else { $active=1; # assume that it is a "normal" font catalog entry $stmt=$FontCatalog{'Statement', $str}; if ($stmt) { $State{'FTag'} = $str; $ret = &convert_char_format($stmt); ## Debug stuff ... ##&DUMP_CONTEXT($stmt); #warn "font change \"$str\" maps to $ret\n"; } else { warn "unknown font change ignored \"$str\"\n"; } #$ret=&change_char_style($str); $active=0; } return $ret; } # Change a MIF String datum (without newlines) to a rtf string # sub convert_string{ local($_, $do_hex) = @_; # put backslashes out of band if (0) { s/\\\\/\n\n/g; } else { #s/\\\\/\0\0/g; s/\\\\/\\/g; } # undo MIFisms s/^`//; s/'.*//; s/\\q/'/g; s/\\Q/`/g; s/\\/>/g; # tjh added s/\\ / /g ; s/\\x15 /-/g ; # handle non-breaking hyphen! # convert hex stuff $do_hex ? s/\\x(\w\w) /$FrameCode[hex($1)]/ge : s/\\x(\w\w) /pack('C', hex($1))/ge; # protect RTFisms if (0) { s/\{/\n\{/; s/\}/\n\}/; } else { # TJH get the curlybraces right s/{/\\{/g; s/}/\\}/g; } s/\\t/\\tab /g; #TJH # convert the bullet into something that actually looks right! ###TODO XXXX GET THIS RIGHT!!!### #s/\\bullet/&convert_other("SYMBOL 183 \\\\\\\\f \\"Symbol\\" \\\\\\\\s 10 \\\\\\\\h");/ge; s/\\bullet/\\f99 \\'B7 \\f- /g; # put backslashed back in! --tjh if (0) { } else { s/\0\0/\\\\/g; } $_; } sub convert_character{ local($name) = @_; $CharacterConversions{$name}; } sub convert_footnote{ return ("\\chftn{\\footnote\n", &convert_flow($_[0]), "}"); } sub convert_xref{ local($s) = @_; $XRefSrcText = ""; $XRefSrcFile = ""; if ( $hypertext_sw ) { #> If hypertext add TOC, add TOC at fron of doco $XRefName = &convert_string(&data_search($s, 'XRefName')); $XRefSrcText = &convert_string(&data_search($s, 'XRefSrcText')); # Used for TOC types if ( $XRefName eq 'TOC' || $XRefName eq 'HELPTOC' ) { # also keep track of the paragraph style when the # XRef is seen as we need this for handling multi-level # table of contents for sorting out the indent side # of things --tjh $XrefStyle{$XRefSrcText} = $State{'PgfTag'}; $XrefTabs{$XRefSrcText} = ¤t_tabs(); if ($tjh_xref_debug) { print STDERR "XREF::$XRefSrcText=>$State{'PgfTag'}::" . ¤t_tabs() . "\n"; print STDERR "XRefSrcText: $XRefSrcText $State{'PgfTag'}\n"; } push(@XRefTOC, $XRefSrcText); } } return ""; } sub convert_xref_end{ $XRefSrcText = ""; $XRefSrcFile = ""; return ""; } sub convert_definition{ local($type, $name) = @_; #@# converts Frame variables literally to RTF return &convert_string($Definition{$type, $name}); } sub convert_other{ local($token, $text, $invisible) = @_; local($fldpriv) = $invisible ? '\fldpriv\v' : ''; print STDERR "CONVERT_OTHER: $token $text\n"; return "{\\field$fldpriv{\\fldinst $token}{\\fldrslt $text}}"; } #> Converts the ' string ' where 0 Change the index to a keyword for Help files if ( $hypertext_sw ) { $keyword = "{\\up6 K{\\footnote \\pard\\plain{\\up6 K} $text}}"; if ( $State{'PgfTag'} eq 'dn_DocName' ) { $Keyword_dn_DocName = $keyword; } } return "$keyword{\\v{\\xe $text}}"; #@# text needs to be interpreted } else { # The following does a different job ... not sure what # Craig wanted above ... treat it like a marker of type 8 # ... think about this ... we are working in DOS without # having gone through framemaker ... this could be the issue! $HyperGroup = "gotolink $text"; &debug( "HyperGroup = $HyperGroup"); return ""; } } elsif ($type == 3) { $RTFInfo{'comment'} .= "$text\n"; } elsif ($type == 4) { $RTFInfo{'subject'} .= "$text\n"; } elsif ($type == 5) { #> This is 'Author' type indexes #> Change 'Author' index to a keyword for Help files if ( $hypertext_sw ) { $keyword = "{\\up6 K{\\footnote \\pard\\plain{\\up6 K} $text}}"; } $RTFInfo{'author'} .= "$text\n"; return "$keyword"; #> Return Keyword } elsif($type == 6) { $RTFInfo{'keywords'} .= "$text\n"; #@# glossary, really } elsif($type == 7) { return '{\|}'; #@# equation marker->formula character } elsif($type == 8) { # &Verbose("Marker text=$text"); # save the text for when we have the string the follows # the text and hence can process it ... as we may need # to embed the following string in the output! --tjh # ($token,$arg) = $text =~ /(\S+) (.*)/; # handle the variables that SDF is passing through to # us to indicate the values to use for topic names # and context ids so that we have total control # over things in the HELP output if ( $token eq "sdf" ) { ($var,$value)=split(/=/,$arg); $SDFVAR{$var}=$value; if ($sdfvartrace) { print STDERR ("SDF SET => $var=$value\n"); } if ( $var eq "topic" ) { # use whatever is given as the topic name $USER_WH_topic=$value; if ($sdfvartrace) { print STDERR ("SDF:USER_WH_topic: $USER_WH_topic\n"); } # DO NOT PUT ANYTHING IN HERE ... if the user does not # have this defined as a link then too bad! # make sure we get a hypertext link in here ... # which the user can override if the wish but # we will use the saved value for the topic name # ZZZZ if ( ! $HyperGroup ) { $HyperGroup="newlink $value"; } } elsif ( $var eq "context" ) { # use whatever is given as the context ID $USER_WH_context=$value; if ($sdfvartrace) { print STDERR ("SDF:USER_WH_context: $USER_WH_context\n"); } # DO NOT PUT ANYTHING IN HERE ... if the user does not # have this defined as a link then too bad! # make sure we get a hypertext link in here ... # which the user can override if the wish but # we will use the saved value for the context id # ZZZZ if ( ! $HyperGroup ) { $HyperGroup="newlink $value"; } } elsif ( $var eq "header" ) { # the current paragraph is included in the header # of the non-scrolling region ... so do not close that # off just yet! # ZZZZ if ( ! $HyperGroup ) { $HyperGroup="newlink $value"; } } elsif ( $var eq "window" ) { # the current paragraph is part of a popup window # and hence we need to do special things } elsif ( $var eq "endwindow" ) { # the current paragraph is a marker of the end # of a popup window ... we can toss it! } elsif ( $var eq "popup" ) { # jump off to a popup window ... which we want # to be just link gotolink $HyperGroup="gotolink $value"; } elsif ( $var eq "url" ) { # just like the old gotourl $HyperGroup="gotourl $value"; } else { # Warn the user that there is something that we do not # understand being sent there ... at least for the # moment until we get this working smoothly print STDERR ("Warning: Unknown SDF variable $var=$value\n"); } } else { # otherwise "normal" thing ... $HyperGroup = "$text"; &debug( "HyperGroup = $HyperGroup"); } return ""; } elsif ( $type == 9 ) { return ""; } elsif ( $type == 11 ) { if ( $hypertext_sw && $State{PgfTag} ne 'dn_DocName') { $Xref_TOC = $text; } return ""; } return &convert_other('FrameMarker ' . ($type+1), $text, 1); #@# } # # Output routines # sub debug{ # print STDERR @_, " @$.\n" if ( $Debug ); print STDERR @_, "\n" if ( $Debug ); } sub hyperdebug{ print STDERR @_, "\n" if ( $hyper_debug ); } #> Calls debug sub Verbose{ if ( $vbs_sw ) { if ( $Debug ) { &debug(@_); } else{ $Debug = 1; &debug(@_); $Debug = 0; } } } # # Initialize global variables #> Added 'pb_PageBreak' to SkipTags if Hypertext sub initialize_state{ @FrameCode = ('', '', '', '', '\-', '', '\_', '', '\tab', '\line', "\266", "\247", '', '', '', '', " ", "\240", " ", " ", " ", "\255", '', '', '', '', '', '', '', '', '', '', ' ', '!', '"', '#', "\$", '%', '&', "\'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', "\\", ']', '^', '_', "\`", 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', '', # 0x80 "\304", "\305", "\307", "\311", "\321", "\326", "\334", "\341", # 0x88 "\340", "\342", "\344", "\343", "\345", "\347", "\351", "\350", # 0x90 "\352", "\353", "\355", "\354", "\356", "\357", "\361", "\363", # 0x98 "\362", "\364", "\366", "\365", "\372", "\371", "\373", "\374", # 0xa0 #TJH "**", "\260", "\242", "\243", "\247", "\267", "\266", "\337", "**", "\260", "[CENT]", "[POUND]", "\247", "\\bullet", "\266", "\337", # 0xa8 "(r)", "(c)", "(tm)", "\264", "\250", "", "\306", "\330", # 0xb0 "", "", "", "", "\225", "", "", "", # 0xb8 "", "", "", "\252", "\272", "", "\346", "\370", # 0xc0 "\277", "\241", "\254", "", "f", "", "", "\253", # 0xc8 "\273", "...", "", "\300", "\303", "\325", "OE", "oe", # 0xd0 "\255", "--", "``", "''", "`", "'", "", "", # 0xd8 "\377", "Y", "/", "\244", "<", ">", "fi", "fl", # 0xe0 "***", "\267", ",", ",,", "%.", "\302", "\312", "\301", # 0xe8 "\313", "\310", "\315", "\316", "\317", "\314", "\323", "\324", # 0xf0 "", "\322", "\332", "\333", "\331", "i", "^", "~", # 0xf8 "\256", "\257", ".", "\260", "\270", "''", ","); %CharacterConversions = ('Tab', '\tab ', 'HardSpace', '\~ ', 'SoftHypen', '\_ ', #@# 'DiscHypen', '\- ', # 'Cent', "\242", # from ISO8859-1 # 'Pound', "\243", # 'Yen', "\245", 'Cent', "[CENT]", #TJH# 'Pound', "[POUND]", #TJH# 'Yen', "[YEN]", #TJH# 'EnDash', "\255", 'EmDash', '-', #@# 'Dagger', '**', #@# 'DoubleDagger', '***', #@# # 'Bullet', "\267", 'Bullet', "\\bullet", #TJH# 'HardReturn', '\line ', 'EndOfPara', "\266", 'EndOfFlow', "\247", 'NumberSpace', ' ', #@# 'ThinSpace', ' ', #@# 'EnSpace', ' ', 'EmSpace', ' ' ); %doc_defaults = ('paperw', 12240, 'paperh', 15840, 'margl', 1800, 'margr', 1800, 'margt', 1440, 'margb', 1440, 'facingp', '', 'TwoSides', 'No', 'gutter', 0, 'deftab', 720, 'widowctrl', '', 'hyphhotz', '', 'fntsep', '', 'ftnsepc', '', 'ftncn', '', 'endnotes', 1, 'enddoc', 0, 'ftntj', 0, 'ftnbj', 1, 'ftnstart', 1, 'pgnstart', 1, 'linestart', 1, 'landscape', 0, 'fracwidth', 0, 'nextfile', '', 'template', '', 'makeback', '', 'defformat', '', 'revisions', '', 'margmirror', '', 'revprop', 3, 'revbar', 3); %para_defaults = ('snext', '', 'sbasedon', '', 'pard', '', 's', '', 'ql', '', 'qr', '', 'qj', '', 'qc', '', 'Alignment', 'ql', 'LIndent', '0', 'FIndent', '', 'NumberFont', '', 'fi', 0, 'li', 0, 'ri', 0, 'sb', 0, 'sa', 0, 'sl', '', 'intbl', '', ##TJH-WINHELP-no keepn0 'keep', '', 'keepn', '', 'WithNext', 'keep0', 'sbys', '', 'pagebb', '', 'Placement', 'Anywhere', 'noline', '', 'TabStops', '', 'tx', '', 'tqr', '', 'tqc', '', 'tqdec', '', 'tb', '', 'brdrt', '', 'brdrb', '', 'brdrl', '', 'brdrr', '', 'box', '', 'brdrs', '', 'brdrth', '', 'brdrsh', '', 'brdrdb', '', 'brdrdot', '', 'brdrhair', '', 'brsp', '', 'tldot', 1, 'tlhyph', '', 'tlul', '', 'tlth', '', #TJHNEW# # the following also should always be preserved # across changes ... we need this to do handling of # bulletted lists and other things too! 'NEWTOPIC', '', 'NumberFont', '', 'NumString', '', 'NumFormat', '', 'SpBefore', '', 'SpAfter', '' ); %char_defaults = ('f', '', 'Family', '', 'b', '', 'Weight', 'b0', 'i', '', 'Angle', 'i0', 'strike', '', 'Strike', 'strike0', 'outl', '', 'Outline', 'outl0', 'shad', '', 'Shadow', 'shad0', 'scaps', '', 'caps', '', 'v', '', 'fn', '', 'fs', '24', 'expnd', 0, 'ul', '', 'ulw', '', 'uld', '', 'uldb', '', 'ulnone', '', 'Underline', 'ulnone', 'up', '', 'SupScript', 'up0', 'dn', '', 'SubScript', 'dn0', 'revised', '', 'ChangeBar', 'revised0', 'cf', 0, #TJHNEW# 'Color', 'cf0' ); local($_); @DocumentAttrs = keys(%doc_defaults); foreach (@DocumentAttrs){ push(@DocumentDefaults, $doc_defaults{$_}); } @State{@DocumentAttrs} = @DocumentDefaults; @ParagraphAttrs = keys(%para_defaults); foreach (@ParagraphAttrs){ push(@ParagraphDefaults, $para_defaults{$_}); } @State{@ParagraphAttrs} = @ParagraphDefaults; @CharacterAttrs = keys(%char_defaults); foreach (@CharacterAttrs){ push(@CharacterDefaults, $char_defaults{$_}); } @State{@CharacterAttrs} = @CharacterDefaults; # $SkipTags{'pb_PageBreak'} = 1 if ( $hypertext_sw ); #> Added $paragraph_count = 0; $browse_seqno = 1; } sub reset_paragraph_format{ @State{@ParagraphAttrs} = @ParagraphDefaults; ''; } sub set_paragraph_format{ local($tag) = @_; local($_); &reset_paragraph_format(); &reset_character_format(); grep($State{$_} = $PgfCatalog{$_, $tag}, @ParagraphAttrs, @CharacterAttrs); } sub save_paragraph_format{ local($tag) = @_; local($_); grep($PgfCatalog{$_, $tag} = $State{$_}, @ParagraphAttrs, @CharacterAttrs); } sub reset_character_format{ @State{@CharacterAttrs} = @CharacterDefaults; ''; } sub mini_reset{ # make sure we actually know what things are! if ($State{"Weight"} eq "") { $State{"Weight"} = $char_defaults{"Weight"}; } if ($State{"Angle"} eq "") { $State{"Angle"} = $char_defaults{"Angle"}; } if ($State{"Color"} eq "") { $State{"Color"} = $char_defaults{"Color"}; } } sub save_char_format{ local($ret); &mini_reset(); $SavedState{"Family"}=$State{"Family"}; #print STDERR "Saving fs as " . $State{"fs"} . "\n"; $SavedState{"fs"}=$State{"fs"}; $SavedState{"Weight"}=$State{"Weight"}; $SavedState{"Angle"}=$State{"Angle"}; $SavedState{"Color"}=$State{"Color"}; $ret=''; $ret.="F:$SavedState{'Family'} "; $ret.="S:$SavedState{'fs'} "; $ret.="W:$SavedState{'Weight'} "; $ret.="A:$SavedState{'Angle'} "; $ret.="C:$SavedState{'Color'}"; ##print STDERR "SAVE: $ret\n"; } sub restore_char_format{ local($ret); &mini_reset(); if ($State{"Family"} ne $SavedState{"Family"}) { # $ret .= &change_attr("f", &intern(*Typeface, $SavedState{"Family"})); $ret .= "\\f$SavedState{'f'} " if ($SavedState{"f"}); $State{"Family"}=$SavedState{"Family"}; } if ($State{"fs"} ne $SavedState{"fs"}) { #print STDERR "Restoring fs as " . $State{"fs"} . " was " . $SavedState{"fs"} . "\n"; # $ret .= &change_dims($State{"fs"}, "fs/10"); $ret .= "\\fs$SavedState{'fs'} " if ($SavedState{"fs"}); $State{"fs"}=$SavedState{"fs"}; } if ($State{"Weight"} ne $SavedState{"Weight"}) { $ret .= "\\$SavedState{'Weight'} " if ($SavedState{"Weight"}); $State{"Weight"}=$SavedState{"Weight"}; } if ($State{"Angle"} ne $SavedState{"Angle"}) { $ret .= "\\$SavedState{'Angle'} " if ($SavedState{"Angle"}); $State{"Angle"}=$SavedState{"Angle"}; } if ($State{"Weight"} ne $SavedState{"Weight"}) { $ret .= "\\$SavedState{'Color'} " if ($SavedState{"Color"}); $State{"Color"}=$SavedState{"Color"}; } ##print STDERR "RESTORE: $ret\n"; return ($ret); } ############### # # ############### # # sub rtf_begin_doc{ return "{\\rtf1\\ansi\n"; } sub rtf_end_doc{ return "}\n"; } sub rtf_info{ local(%groups) = @_; local(@r, $_); local($toctext); push(@r, "{\\info\n"); foreach (keys %groups){ push(@r, "{\\$_ ", $groups{$_}, "}\n"); } push(@r, "}\n"); if ( $hypertext_sw ) { #> If the TOC is set, add a header and the table of contents if ( scalar(keys(%Xref)) > 0 && $hypertext_sw ) { if (defined $Definition{"Variable", "DOC_TOC_TITLE"} ) { $toctext=&convert_string($Definition{"Variable", "DOC_TOC_TITLE"}); } else { $toctext="Table of Contents"; } push(@r, "\n$PgfCatalog{'Style',h2_Heading}\\keepn"); # a nice graphic can make all the difference in the world # for doing things ... if (defined $Definition{"Variable", "DOC_TOC_GRAPHIC"} ) { push(@r, "\n\\{bml " . &convert_string($Definition{"Variable", "DOC_TOC_GRAPHIC"}) . "\\}\n" ); } if ($lots_of_whitespace) { push(@r, "\n{\\up6 \${\\footnote \\pard\\plain{\\up6 \$} $toctext}}"); push(@r, "\n{\\up6 +{\\footnote \\pard\\plain{\\up6 +} 0000}}$toctext\\par\\pard"); push(@r, "\n{\\up6 #{\\footnote \\pard\\plain{\\up6 #} TableofContents}}\\par\\pard\\plain"); } else { push(@r, "\n{\\up6 \${\\footnote {\\up6 \$} $toctext}}"); push(@r, "\n{\\up6 +{\\footnote {\\up6 +} 0000}}$toctext\\par\\pard\\plain"); push(@r, "\n{\\up6 #{\\footnote {\\up6 #} TableofContents}}"); } foreach ( sort (keys (%Xref))) { local($sty,$str); if ($lots_of_whitespace) { $sty="b0_Body"; } else { $sty="$XrefStyle{$_}"; } $str="\n$PgfCatalog{'Style',$sty}\\snext-1\\sl-1\\sb-1$XrefTabs{$_}\\tab{\\uldb ". $Xref{$_} ."}{\\v $XrefTopic{$_}}\\par\\pard\\plain\n"; if ($tjh_xref_debug) { print STDERR "TOC added: $Xref{$_}\n"; push(@r,"TOCSTART $Xref{$_}\n"); print STDERR "TOCSTYLE \"$PgfCatalog{'Style',$XrefStyle{$_}}\"\n"; print STDERR "$str\n"; } if (0) { if ($lots_of_whitespace) { push(@r, "\n$PgfCatalog{'Style',b0_Body}" . "{\\uldb " . "$Xref{$_}" . "}" . "{\\v $XrefTopic{$_}}\\par" ); push(@r, "WOW", "$str", "WOW" ); } else { #push(@r, "\n$PgfCatalog{'Style',$XrefStyle{$_}}\\snext-1\\sl-1\\sb-1$XrefTabs{$_}\\tab{\\uldb ". $Xref{$_} ."}{\\v $XrefTopic{$_}}\\par\\pard\\plain"); push(@r, "FOO", "FOO $str BAR-Introduction", "BAR", "asdasd"); } } # work around perl 5.001 "features" push(@r, "$str" ); if ($tjh_xref_debug) { push(@r,"TOCFINISH $Xref{$_}\n"); } } push(@r, "\\par\\plain\n\\page"); } else { push(@r, "+{\\footnote + 0000}\n"); } } return @r; } sub intern{ local(*arr, $_) = @_; s/^\`//; s/\'.*//; $arr{$_} || ($arr{$_} = ++$arr); # $_ = $arr{$_} || ($arr{$_} = ++$arr); # &debug("intern: $_[1] -> $_"); # $_; } # # HEURISTIC: uses \fnil for unrecognized fonts. # recognizes all FrameMaker 2.1 fonts # sub rtf_font_table{ local(%fonts) = @_; local(@r, $have_zero, $n, $family, $_); foreach (keys %fonts){ $family = 'nil'; $n = $fonts{$_}; $have_zero = 1 if ( $n eq "0" ); $family = 'roman' if /serif/ || /times/i || /palatino/i || /bookman/i || /newcenturysch/; $family = 'swiss' if /sans/ || /helvetica/i || /avantgarde/i; $family = 'modern' if /courier/i; $family = 'script' if /cursive/i; $family = 'decor' if /zapfchancery/i; $family = 'tech' if /symbol/i; push(@r, "{\\f$n\\f$family $_;}\n"); } # for RTF help files we *must* have a font 0 entry --tjh # and I happen to like Times Roman push(@r, "{\\f0\\froman Times;}\n"); push(@r, "{\\f99\\ftech Symbol;}\n"); return("{\\fonttbl\n", @r, "}\n"); } sub rtf_style_sheet{ local(%styles) = @_; local(@r); local($n, $style, $_); foreach (keys %styles){ $n = &intern(*Tag, $_); #@# all styles mentioned in the document will appear in the # stylesheet, but only styles used in the document will be defined! $style = $PgfCatalog{'Style', $_}; # TJH - blank styles are illegal ... # MS WORD 2 will reject the RTF file if ( "$style$_" ne "" ) { push(@r, "{\\s$n $style$_;}\n"); } } return("{\\stylesheet\n", @r, "}\n"); } sub rtf_color_table{ local(@colors) = @_; local($red, $green, $blue, $_); foreach (@colors){ ($red, $green, $blue) = split(/\s+/, $_); push(@r, "\\red$red\\green$green\\blue$blue;\n"); } return("{\\colortbl\n", @r, "}\n"); } sub rtf_dimensions{ local($_, $twips) = @_; local(@trect); # # convert all dimensions to twips # didot@@ cicero@@ # while($_){ warn "\@\@Dimensions: (@_) \"$_\"\n" if ($tjhdebug); if( s/\s*(-?\d*(\.\d*)?)\s*//){ $twips = $1 * 1440; }else{ warn "\@\@Bad dimensions: (@_) \"$_\"\n"; return (); } s/"//; s/in//; s/pt// && ($twips = $twips/72); s-cm-- && ($twips = $twips/2.54); s-mm-- && ($twips = $twips/25.4); # TJH # remove leading spaces s/^\s+//; push (@trect, int($twips)); } @trect; } #> rtf_topic_keyword: Will produce a keyword with a topic. #> Params: *keyword, *text, Topic Text #>Process: Check there is not a duplicate keyword, if it is, apply alogrithm #> to create a new keyword #> sub rtf_topic_keyword { local(*WH_topic, *text, @tmptext) = @_; # allow the user to override the automatic stuff if ( defined($USER_WH_topic) ) { $WH_topic=&convert_context($USER_WH_topic); } if ( ! $skiptags{$State{PgfTag}} ) { if ( $Keywords{$WH_topic} ) { if ( $fixup_duplicates ) { warn "\nDuplicate Keyword: $WH_topic"; $WH_topic = "$WH_topic". ++$Keywords{$WH_topic}; warn " replaced with Keyword: $WH_topic TEXT:@tmptext"; } else { # warn "\nHandling Duplicate Keyword: $WH_topic (@tmptext)"; } } push(@text,"{\\up6 #{\\footnote \\pard\\plain{\\up6 #} $WH_topic}}\n"); push(@text,"{\\up6 K{\\footnote \\pard\\plain{\\up6 K} @tmptext}}\n"); #> Print the keywords for Docname on the first available opportunity if ( $Keyword_dn_DocName ne "" ) { push(@text, "$Keyword_dn_DocName\n"); $Keyword_dn_DocName = ""; } $Keywords{$WH_topic} = @tmptext; } } # #> Generate_ID: Generate unique ID numbers with context string #> Parsed: Context String, Text #> sub Generate_ID { local( $WH_context, *tmptext) = @_; local( @characters, $operator, $value); # allow the user to override the automatic stuff if ( defined($USER_WH_context) ) { $value=&convert_context($USER_WH_context); $WH_context=&convert_context(@tmptext); } if ( ! $skiptags{$State{PgfTag}} ) { $operator = 1; @characters = split(//, $WH_context); if ( !defined($USER_WH_context) ) { foreach (@characters) { $value = $value + (ord($_) * $operator); $operator = $operator + 2; } # MOD zero is illegal $value=1 if ($value == 0); $value = 9393931%$value; if ($fixup_duplicates) { while ( $Context_ID{$value} ) { warn "Duplicate Context ID:$value String:$string\n"; $value++; } } } $WH_topic_comments{$value} = "@tmptext"; $WH_context_ids{$value} = $WH_context; } } ############## # # tchrists' assert stuff # sub assert { &panic("ASSERTION BOTCHED: $_[0]",$@) unless eval $_[0]; } sub panic { select(STDERR); print "\npanic: @_"; exit 1 if $] <= 4.003; # caller broken # stack traceback stolen from perl debugger local($i,$_); local($p,$f,$l,$s,$h,$a,@a,@sub); for ($i = 1; ($p,$f,$l,$s,$h,$w) = caller($i); $i++) { @a = @DB'args; for (@a) { if (/^StB\000/ && length($_) == length($_main{'_main'})) { $_ = sprintf("%s",$_); } else { s/'/\\'/g; s/([^\0]*)/'$1'/ unless /^-?[\d.]+$/; s/([\200-\377])/sprintf("M-%c",ord($1)&0177)/eg; s/([\0-\37\177])/sprintf("^%c",ord($1)^64)/eg; } } $w = $w ? '@ = ' : '$ = '; $a = $h ? '(' . join(', ', @a) . ')' : ''; push(@sub, "$w&$s$a from file $f line $l\n"); last if $signal; } for ($i=0; $i <= $#sub; $i++) { last if $signal; print $sub[$i]; } # kill 'TERM', -$Start_Pid; exit 1; } r"}; $ret=''; $ret.="F:$SavedState{'Family'} "; $ret.="S:$SavedState{'fs'} "; $ret.="W:$SavedState{'Weight'} "; $ret.="A:$SavedState{'Angle'} "; $ret.="C:$SavedState{'Color'}"; ##print STDERR "SAVE: $ret\n"; } sub restore_char_format{ local($ret); &mini_reset(); if ($State{"Family"} ne $SavedState{"Family"}) { # $ret .= &change_attr("f", &insdf-2.001/bin/dos/004075500042570001753000000000000672243774000134715ustar00iancmtr00000400000236sdf-2.001/bin/dos/sdf2rtf.bat010064400042570001753000000001140614606737000155220ustar00iancmtr00000400000236@echo off call sdf -o -dmif %1 call mif2rtf -o %1.rtf %1.out del %1.out sdf-2.001/bin/dos/sdf2hlp.bat010064400042570001753000000001320614606735400155140ustar00iancmtr00000400000236@echo off call sdf -o -dmif -thlp %1 call mif2rtf -m help -o %1.rtf %1.out del %1.out sdf-2.001/bin/dos/sdf.bat010064400042570001753000000000670647623412200147300ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/mkpldocs.bat010064400042570001753000000000670647624263000157730ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/sdf2mif.bat010064400042570001753000000000440614606736400155070ustar00iancmtr00000400000236@echo off call sdf -omif -dmif %1 sdf-2.001/bin/dos/pod2sdf.bat010064400042570001753000000000670647624263000155200ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/sdfcli.bat010064400042570001753000000000670647624263200154250ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/mif2rtf.bat010064400042570001753000000000670647623442400155320ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/sdfget.bat010064400042570001753000000000670647623442400154350ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/sdngen.bat010064400042570001753000000000670647624263200154370ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/prn2ps.bat010064400042570001753000000000670647624263000154030ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/sdfbatch.bat010064400042570001753000000000670647624263200157370ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/sdfapi.bat010064400042570001753000000000670647624263200154270ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/dos/poddiff.bat010064400042570001753000000000670647624263000155720ustar00iancmtr00000400000236@echo off perl %sdfbin%%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 sdf-2.001/bin/sdngen010075500042570001753000000214020661420536500141000ustar00iancmtr00000400000236#!/usr/local/bin/perl # $Id$ $VERSION{'PUBLIC'} = '2.000'; $VERSION{''.__FILE__} = '$Revision$'; # # >>Title:: SDF Tuning File Generator # # >>Copyright:: # Copyright (c) 1992-1997, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 18-Jan-97 ianc SDF 2.000 # ----------------------------------------------------------------------- # # >>Purpose:: # {{CMD:sdngen}} extracts SDF template information from a [[FrameMaker]] # template. # # >>Description:: # !SDF_OPT_STD # # The -p option can be used to specify the root paragraph format from # which others are derived. The default paragraph root is {{Body}}. # # The -f option can be used to specify the root font (i.e. phrase) format # from which others are derived. The default font root is {{Emphasis}}. # # The -t option can be used to specify the root table format from # which others are derived. The default table root is {{Format A}}. # # As formats often appear in families (e.g. Heading1, Heading2, # etc.), {{sdngen}} will use the (alphabetically) previous format as # the parent if it makes a better parent (i.e. there are less differences) # than the default one. # # If a template already exists, it can be specified using the -e option. # In this case, {{sdngen}} will get as much information as it can from # that file including: # # * the root format for each type # * the order of formats within a type # * the parent for each format. # # Within each type, formats which are unknown in the existing template # are output after those that are known. # # >>Examples:: # To generate an SDF tuning file file: # # V: sdngen -osdn mytemplate.mif # # This will create a template file called {{FILE:mytemplate.sdn}}. # # >>Limitations:: # require "sdf/app.pl"; require "sdf/parse.pl"; require "sdf/tomif.pl"; ########## Initialisation ########## # define configuration %app_config = ( 'libdir', 'sdf/home', ); # define options push(@app_option, ( #'Name|Spec|Help', 'para_root|STR;Body|default parent for a paragraph format', 'font_root|STR;Emphasis|default parent for a font format', 'tbl_root|STR;Format A|default parent for a table format', 'existing_template|STR|existing template file', )); # handle options &AppInit('file ...', 'generate an SDF template from a Frame one', 'SDF') || &AppExit(); # initialise the lookup tables loaded when a template already exists %objects = (); %parents = (); # if a template already exists, get as many details as we can from it if ($existing_template ne '') { # Open the file unless(open(EXISTING, $existing_template)) { &AppExit("fatal", "unable to open existing template '$existing_template'"); } # Scan the template for useful information while () { next unless /^\s*\!targetobject\s+/; ($type, $name, $parent) = split(/\s*\;\s*/, $'); $type =~ s/^\s*["']//; $type =~ s/["']\s*$//; $name =~ s/^\s*["']//; $name =~ s/["']\s*$//; $parent =~ s/^\s*["']//; $parent =~ s/["']\s*$//; # Save the information $parents{$type,$name} = $parent; if ($objects{$type} eq '') { $objects{$type} = $name; $para_root = $name if $type eq 'Para'; $font_root = $name if $type eq 'Phrase'; $tbl_root = $name if $type eq 'Table'; } else { $objects{$type} .= "\000$name"; } } close(EXISTING); } ########## Support routines ########## sub ConvertCatalogToSdf { local($type, $root, *catalog, *known_objects, *known_parents, *my_attr_list) = @_; # local(); local(@names, @known_names, %known, @ordered_names); local(@attr_list); local(%root_attrs); local($name, $parent, %attrs, %parent_attrs); local($prev, %prev_attrs); local(%prev_diff, %root_diff, %this_diff); local($prev_diff_cnt, $root_diff_cnt); local($obj_cnt, $attr_cnt, $diff_cnt, $diff_avg); # Check that the catalog is not empty @names = sort keys %catalog; $obj_cnt = scalar(@names); unless ($obj_cnt) { &AppMsg("object", "NO $type formats found"); return; } # Check that the root object exists if (!defined($catalog{$root})) { &AppMsg("warning", "root $type '$root' not found (using '$names[0]' instead)"); $root = shift(@names); } # Get the attributes of the root object %root_attrs = &_MifAttrSplit($catalog{$root}); # Output the root print "# Define the root '$type' format\n"; &OutputTargetObject($type, $root, '', *root_attrs); # Decide on the attribute list to use @attr_list = @my_attr_list ? @my_attr_list : sort keys %root_attrs; # If there are known objects, output them first @known_names = split(/\000/, $known_objects{$type}); if (@known_names) { %known = (); grep($known{$_}++, @known_names); @ordered_names = @known_names; for $name (@names) { push(@ordered_names, $name) unless $known{$name}; } } else { @ordered_names = @names; } # Analyse and output the non-root formats print "\n# Define the other '$type' formats\n"; %prev_attrs = (); $prev = ''; $diff_cnt = 0; for $name (@ordered_names) { # Skip the root next if $name eq $root; # If the list includes names from an existing template, # the object might not exist in the catalog, so skip it next if $catalog{$name} eq ''; # Get the attributes %attrs = &_MifAttrSplit($catalog{$name}); # Get the parent and the attribute differences $parent = $known_parents{$type,$name}; if ($parent ne '') { %parent_attrs = &_MifAttrSplit($catalog{$parent}); %this_diff = &DiffAttrs(*attrs, *parent_attrs, *attr_list); } else { # Decide on the best parent %root_diff = &DiffAttrs(*attrs, *root_attrs, *attr_list); %prev_diff = &DiffAttrs(*attrs, *prev_attrs, *attr_list); $root_diff_cnt = scalar(keys %root_diff); $prev_diff_cnt = scalar(keys %prev_diff); if ($root_diff_cnt < $prev_diff_cnt) { $parent = $root; %this_diff = %root_diff; } else { $parent = $prev; %this_diff = %prev_diff; } } # Output the object &OutputTargetObject($type, $name, $parent, *this_diff); # Collect some stats $diff_cnt += scalar(keys %this_diff); } continue { # Save away the previous attributes and name %prev_attrs = %attrs; $prev = $name; } # Output some basic stats $attr_cnt = scalar(@attr_list); $diff_avg = sprintf("%.1f", $diff_cnt/($obj_cnt - 1)); &AppMsg("object", "$obj_cnt $type formats, $attr_cnt attrs each," . " average difference is $diff_avg"); } sub OutputTargetObject { local($type, $name, $parent, *attrs) = @_; # local(); local($attr, $value); # Print the macro header $parent = " \"$parent\"" if $parent ne ''; print "!targetobject \"$type\"; \"$name\";$parent"; # Print the attributes, if any for $attr (sort keys %attrs) { $value = &FormatValue($attrs{$attr}); print "; \\\n $attr=$value"; } print "\n\n"; } sub FormatValue { local($value) = @_; local($result); # Integers and enumerated values are fine as is # Values with " are enclosed in '', otherwise # the value is enclosed in "". if ($value =~ /^\d+$/ || $value =~ /^[A-Z][a-z]+$/) { return $value; } elsif ($value =~ /["\\]/) { return "'$value'"; } else { return '"' . $value . '"'; } } sub DiffAttrs { local(*nv1, *nv2, *name_list) = @_; local(%diff); local($name); # Check the empty set first return %nv1 unless %nv2; # Find the differences %diff = (); for $name (@name_list) { $diff{$name} = $nv1{$name} unless $nv1{$name} eq $nv2{$name}; } # Return result return %diff; } ########## Processing ########## sub argProcess { local($ARGV) = @_; # local(); # Fetch the template unless (&_MifFetchTemplate($ARGV)) { &AppMsg("abort", "unable to fetch MIF template '$ARGV'"); return; } # Convert the MIF catalogs into an SDF template &ConvertCatalogToSdf('Para', $para_root, *_mif_tpl_paras, *objects, *parents, *MIF_PARA_ATTRS); &ConvertCatalogToSdf('Phrase', $font_root, *_mif_tpl_fonts, *objects, *parents, *MIF_FONT_ATTRS); &ConvertCatalogToSdf('Table', $tbl_root, *_mif_tpl_tbls, *objects, *parents); } &AppProcess('argProcess'); &AppExit(); sdf-2.001/bin/sdfcli010075500042570001753000000112760661420536500140760ustar00iancmtr00000400000236#!/usr/local/bin/perl # $Id$ $VERSION{'PUBLIC'} = '2.000'; $VERSION{''.__FILE__} = '$Revision$'; # # >>Title:: Command Line Interface Utility # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 29-Feb-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # # >>Purpose:: # {{CMD:sdfcli}} extracts command line interface (CLI) information from # applications and formats it into [[SDF]]. # # >>Description:: # !SDF_OPT_STD # # {{CMD:sdfcli}} executes each argument with a -h flag and converts # the resultant output to nicely formatted [[SDF]]. An argument of "-" # specifies that the help should be read from standard input. # # Formatting is done as follows: # # ^ lines are tagged as {{Example}} paragraphs, with the # first line formatted to wrap option usage specifications nicely # + if a line is found that starts with 'options:', it is replaced # with a {{Body}} paragraph saying "The options are:", and the # following lines are formatted as a table of codes and descriptions # + if a line is found that starts with 'aliases:', it is replaced # with a {{Body}} paragraph saying "The aliases are:", and the # following lines are formatted as a table of names and descriptions # + each option code in the table is formatted as a hypertext # jump to a tag called {{cmd_opt}} where: # # - {{cmd}} is the command name # - {{opt}} is the option code # # The -w option specifies at what column to wrap option specifications. # The default is 50 - this is the best for output imported into the # [[Mincom]] templates. # # >>Limitations:: # The table formats used are hard coded. # # >>Resources:: # # >>Implementation:: # require "sdf/app.pl"; ########## Initialisation ########## # define configuration %app_config = ( 'libdir', 'sdf/home', ); # define options push(@app_option, ( #'Name|Spec|Help', 'wrap|INT;50|column at which to wrap option specifications', )); # handle options &AppInit('utility ...', "format a utility's command line interface into SDF", 'SDF') || &AppExit(); ########## Processing ########## sub argProcess { local($ARGV) = @_; # local(); local(@help, $line, $spec, $length, @option_specs); local($code, $desc); local($base); # Get the help for this utility, unless given already in STDIN if ($ARGV eq "-") { @help = ; } else { unless (open(HELP, "$ARGV -h|")) { &AppMsg("abort", "failed to execute '$ARGV'"); return; } @help = ; close(HELP); } # Nicely wrap option specifications on the first line @option_specs = split(/\] /, shift(@help)); $spec = shift(@option_specs); print "E:$spec"; $length = length($spec); while ($spec = shift(@option_specs)) { if ($length + length($spec) < $wrap) { print "] $spec"; $length += length($spec) + 2; } else { print "]\nE: $spec"; $length = length($spec) + 9; } } # Get the command name $base = (&NameSplit($ARGV))[1]; # Format the rest while ($line = shift(@help)) { if ($line =~ /^options:/) { print "\nThe options are:\n\n"; print "!block table; format=28\n"; print "Option:Description\n"; while ($_ = shift(@help)) { if (/^aliases:/) { unshift(@help, $_); last; } elsif (/^\s*$/) { print $_; } else { # strip the long option name & format ($code, $desc) = /^-(\w), --\w+\s+(.*)$/; print "{{N[jump='#${base}_$code']-$code}}:$desc\n"; } } print "!endblock\n"; } elsif ($line =~ /^aliases:/) { print "\nThe aliases are:\n\n"; print "!block table; format=28\n"; print "Alias:Description\n"; while ($_ = shift(@help)) { if (/^options:/) { unshift(@help, $_); last; } elsif (/^\s*$/) { print $_; } else { ($code, $desc) = /^\+(\w+)\s+(.*)$/; print "$code:$desc\n"; } } print "!endblock\n"; } else { print "E:$line"; } } } &AppProcess('argProcess'); &AppExit(); sdf-2.001/bin/sdfapi010075500042570001753000000120420661420536500140700ustar00iancmtr00000400000236#!/usr/local/bin/perl # $Id$ $VERSION{'PUBLIC'} = '2.000'; $VERSION{''.__FILE__} = '$Revision$'; # # >>Title:: API Extraction Utility # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 29-Feb-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # # >>Purpose:: # {{CMD:sdfapi}} extracts {{Application Programming Interface}} information # from ([[Perl]]) source code. # # >>Description:: # !SDF_OPT_STD # # The format of the output can be controlled using the -f option. # Supported formats are {{std}} and {{concise}}. The default is {{std}}. # {{std}} format is: # # E:require "abc.pl"; # E: # E:$myvar = ... # E: # E:$result = # E:&myfunc($myparams); # # {{concise}} format has fewer blank lines and uses 1 line per symbol. # # A comma-separated list of symbol types to output can be specified # using the -s option. Supported symbol types are: # # * {{sub}} - subroutines # * {{var}} - variables # # The default is to extract all symbols. # # The -p option is used to extract only a subset of the symbols. # If not supplied, the pattern is symbols beginning with a letter. # If supplied without an option, the pattern defaults to all symbols. # If perl libraries use the coding convention that symbols beginning # with underscore are private, then -p_ can be used to extract the # private symbols. # # The -j option can be used to request SDF-style hypertext jumps # be added for each symbol. The jump target is {{lib_sym}} where: # # * {{lib}} is the library name # * {{sym}} is the symbol name. # # >>Limitations:: # The only language currently supported is [[Perl]]. # # It would be useful to extract messages from the scripts too. # This would require a new utility called {{sdfmsg}} say, # which searched through the source (including libraries) for # {{Y:AppMsg}} and {{Y:AppExit}} calls. # # Internally, it may be better to implement formats via routines. # This would give better control over output. e.g. it would be up to # the routine to decide if it wanted to output the 'require' header. # # >>Resources:: # # >>Implementation:: # require "sdf/app.pl"; require "sdf/apiperl.pl"; ########## Initialisation ########## # Table of formatting tags # (update %PERLIF_RULE if you change this) @PERLIF_FMT = ('std', 'concise'); # Tables of formatting rules. Each format needs 3 rules: # # * var - variable format # * proc - routine with no result (i.e. procedure) # * func - routine with result (i.e. function). # %PERLIF_RULE = ( "std.var", '"${prefix}$name = ...\n\n"', "std.proc", '"${prefix}$name($params);\n\n"', "std.func", '"$result =\n${prefix}$name($params);\n\n"', "concise.var", '"${prefix}$name = ...\n"', "concise.proc", '"${prefix}$name($params);\n"', "concise.func", '"$result = ${prefix}$name($params);\n"', ); # define configuration %app_config = ( 'libdir', 'sdf/home', ); # define options push(@app_option, ( #'Name|Spec|Help', 'fmt_tag|STR-@PERLIF_FMT;std|output format tag', 'pattern|STR;^[A-Za-z];|only symbols matching pattern', 'sym_type|STRLIST-("sub","var")|only symbols of these types', 'jumps|BOOL|add SDF-style hypertext jumps from each symbol', )); # handle options &AppInit('file ...', 'extract the API from a (perl) library', 'SDF') || &AppExit(); ########## Processing ########## sub argProcess { local($perl_file) = @_; # local(); # Fetch File ($ok_perl, @perl) = &PerlFetch($perl_file); unless ($ok_perl) { &AppMsg('abort', "error fetching perl file '$perl_file'"); return; } # Get perl symbols @symbol = &PerlSymbols(*perl, $pattern, @sym_type); # Find longest strings (optionally used in routine formatting) $max_name = 0; $max_result = 0; $max_params = 0; for $symbol (@symbol) { ($sym_type, $name, $result, $params) = split(/:/, $symbol); next unless $sym_type eq 'sub'; $len = length($name); $max_name = $len if $len > $max_name; $len = length($result); $max_result = $len if $len > $max_result; $len = length($params); $max_params = $len if $len > $max_params; } # Output the header unless a subset requested if (scalar(@sym_type) == 0) { ($dir, $base, $ext) = &NameSplit($perl_file); printf "require \"%s\";\n\n", &NameJoin('', $base, $ext); } # Output symbols for $symbol (@symbol) { ($sym_type, $name, $result, $params) = split(/:/, $symbol); if ($sym_type eq 'sub') { $sym_type = $result ? 'func' : 'proc'; $prefix = '&'; } else { $name =~ s/^(.)//; $prefix = $1; } $action = $PERLIF_RULE{"$fmt_tag.$sym_type"}; if ($jumps) { $action =~ s/\$name/{{N[jump='#\${base}_\$name']\$name}}/; } print eval $action; } } &AppProcess('argProcess'); &AppExit(); sdf-2.001/bin/sdfget010075500042570001753000000230310671643537500141070ustar00iancmtr00000400000236#!/usr/local/bin/perl # $Id$ $VERSION{'PUBLIC'} = '2.000'; $VERSION{''.__FILE__} = '$Revision$'; # # >>Title:: Documentation Extraction Utility # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 29-Feb-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # # >>Purpose:: # {{CMD:sdfget}} extracts documentation embedded in source code. # # >>Description:: # !SDF_OPT_STD # # The -f option can be used to specify a filename to use when # formatting the output. This is useful when the text is coming from # the standard input stream. # # The {{get-rule}} nominates the formatting of the embedded # documentation to be extracted. All currently defined get-rules # assume the documentation is in comment blocks in one of the # following formats: # # V: >>section_title1:: # V: text of section 1, line 1 # V: text of section 1, line .. # V: # V: >>section_title2:: # V: text of section 2, line 1 # V: text of section 2, line .. # V: >>END:: # V: # V: >>section_title3:: text of section 3 # # The first form is most commonly used. In this format, the text # in a section extends until the end of the current "comment block" # or the start of the next section, whichever comes first. The # second form (i.e. explicitly specifying where the section ends) is # useful if you wish to add some normal comments (i.e. non-documentation) # which you do not want extracted. If the text is short, the # third form can be used. Regardless of the format, if a section # is found which is already defined, the text of the section is # concatenated onto the existing text. This permits the documentation # for each entity to be specified immediately above where it is # defined in the source code. # # The -g option specifies the {{get-rule}} to use. # The available get-rules differ on the prefix expected at the front # of each line as shown below. # # !block table # Rule Prefix # perl # # cpp // # c * or /* # fortran c (with 5 preceding spaces) # eiffel -- # bat rem # !endblock # # Within C code, a trailing space is required after the characters above. # For other languages, a trailing space is optional. # Within FORTRAN code, the "c" character must be preceded by exactly # 5 spaces. For other languages, zero or more whitespace characters are # permitted before the characters above. # # For example, embedded documentation within C code looks like: # # V: /* >>Purpose:: # V: * This library provides a high level interface # V: * to commonly used network services. # V: */ # # If the -g option is not specified, # {{perl}} is the default get-rule. If the -g option is specified # without a parameter, the extension in lowercase of the filename # (or the {{formatting filename}} if the text is coming from standard input) # is used to guess the get_rule as shown below. # # !block table # Rule Extensions # cpp cpp, c++, cc, hpp, hpp, h, java, idl # c c # fortran fortran, for, f77, f # eiffel eiffel, ada # bat bat, cmd # !endblock # # A report filename can be specified using the -r option. # If the name doesn't include an extension, sdg is assumed. # Reports provide a mechanism for: # # * selectively extracting sections, and # * rudimentary reformatting (e.g. to [[SDF]]) # # If no report is specified, all sections are output in the # following format: # # V: section_title1 # V: section_text1 # V: # V: section_title2 # V: section_text2 # # If -r is specified on its own, {{FILE:default.sdg}} is assumed. # This report selects the set of sections (within the [[SDF]] # documentation standards) which form the user documentation and # formats them into [[SDF]]. # Details on the report format are specified below. # Reports are searched for in the current directory, # then in the {{stdlib}} directory within SDF's library directory. # # The -s option can be used to specify the scope of the documentation # to be extracted. (This is an experimental feature and may change # so most users should avoid using it.) # # The -i option outputs only those lines which the get-rule did # not match. This option is useful for extracting non-documentation # from a file to give just the code. # # Note: The -r option is ignored if -i is specified. # # The -v option enables verbose mode. This is useful for seeing # which rule is being used for each file. # # >>Examples:: # # To extract the user documentation from a [[SDF]] application # written in C++ ({{CMD:xyz}}, say) and save it into {{FILE:xyz.sdf}}: # # V: sdfget -gcpp -r -osdf xyz.cpp # # >>Resources:: # # >>Limitations:: # It would be nicer if the get-rule was always guessed from the # filename extension but changing the default from perl could # break existing scripts. Therefore, get-rule guessing must be # explicitly enabled by specifging the -g option without a # parameter. # # >>Implementation:: # require "sdf/app.pl"; require "sdf/dict.pl"; require "sdf/sdfget.pl"; ########## Initialisation ########## # # >>_Description:: # {{Y:_SDFGET_RULES}} is the lookup table used to guess the get_rule. # The key is the (lowercase) filename extension and the # value is the get_rule to use. If a get_rule isn't specified and # the filename extension isn't in this table, the get_rule is assumed # to be 'perl'. # %_SDFGET_RULES = ( 'cpp', 'cpp', 'c++', 'cpp', 'cc', 'cpp', 'hpp', 'cpp', 'h', 'cpp', 'java', 'cpp', 'idl', 'cpp', 'c', 'c', 'fortran', 'fortran', 'for', 'fortran', 'f77', 'fortran', 'f', 'fortran', 'eiffel', 'eiffel', 'ada', 'eiffel', 'bat', 'bat', 'cmd', 'bat', ); # # >>_Description:: # {{@_GET_RULES}} contains a table of {{get-rule}} definitions. # Each rule is defined by the fields in the table below. # # !block table # Field Description # Name rule name # Begin regular expression matching the start of a key # Sep regular expression matching the end of the key # End regular expression matching the end of a description # Prefix regular expression matching the start of each line # Desc description # !endblock # @_GET_RULES = &TableParse ( 'Name Begin Sep End Prefix Desc', 'perl >> ::\s* >>END:: \s*#[ ]? Perl/Shell source code', 'cpp >> ::\s* >>END:: \s*\/\/[ ]? C++ source code', 'c >> ::\s* >>END:: \s*\/?\*[ ] C source code', 'fortran >> ::\s* >>END:: [ ]{5}c[ ]? FORTRAN source code', 'eiffel >> ::\s* >>END:: \s*\-\-[ ]? Eiffel/Ada source code', 'table >> ::\s* >>END:: \s*\/\*[ ]? Mincom TP table files', 'bat >> ::\s* >>END:: \s*rem[ ]? batch source code', ); # Index into the rules table - we don't mind duplicates @_get_rules_dupl = (); %_GET_RULES_INDEX = &TableIndex(*_GET_RULES, *_get_rules_dupl, 'Name'); @_RULE_IDS = keys %_GET_RULES_INDEX; push(@_RULE_IDS, '-'); # valid scope values @_SDFGET_SCOPE = ('PUBLIC','PROTECTED','PRIVATE'); # define configuration %app_config = ( 'libdir', 'sdf/home', ); # define options push(@app_option, ( #'Name|Spec|Help', 'formatting_filename|STR|filename to use when formatting the output', 'get_rule|STR-@_RULE_IDS;perl;-|rule to use to get documentation', 'rpt_file|STR;;default.sdg|report file', 'scope|STR-@_SDFGET_SCOPE;PUBLIC|scope of documentation to be extracted', 'inverse|BOOL|only output lines not extracted', 'verbose|INT;;1|verbose mode', )); # handle options &AppInit('file ...', 'extract documentation embedded in source code', 'SDF') || &AppExit(); # Initialise trace levels $app_trace_level{"user"} = $verbose if $verbose > $app_trace_level{"user"}; # If supplied, fetch the report file. @report = (); if ($rpt_file) { local($rpt, $rpt_dir); my $rpt_ext = (&NameSplit($rpt_file))[2]; $rpt_file = &NameJoin('', $rpt_file, 'sdg') if $rpt_ext eq ''; $rpt_dir = "$app_lib_dir/stdlib"; unless ($rpt = &NameFind($rpt_file, ".", $rpt_dir)) { &AppExit('fatal', "cannot find report-file '$rpt_file'"); } ($all_ok, @report) = &TableFetch($rpt); $all_ok || &AppExit('fatal', "error opening report-file '$rpt': $!"); } ########## Processing ########## sub argProcess { local($ARGV) = @_; # local(); local($success, $buflistref); local($level) = 0; # Get the file extension my $filename = $ARGV eq '-' ? $formatting_filename : $ARGV; my $ext = (&'NameSplit($filename))[2]; # Use the current file extension to guess the rule, if necessary my $rule = $get_rule; if ($rule eq '-') { $rule = $_SDFGET_RULES{"\L$ext"} || 'perl'; &AppTrace("user", 1, "derived get_rule for filename '$ARGV' is '$rule'"); } # Get the rule parameters my %rule = &TableLookup(*_GET_RULES, *_GET_RULES_INDEX, $rule); # Fetch the data ($success, $buflistref) = &DictFetch($ARGV, $rule{"Begin"}, $rule{"Sep"}, $rule{"End"}, $rule{"Prefix"}); return 1 unless $success; # Print report if ($inverse) { print grep(! /^$rule{"Prefix"}$/, @dict_rest); } else { # Patch $ARGV to the formatting filename if requested $ARGV = $formatting_filename if $formatting_filename ne ''; &DictPrint(STDOUT, 0, 'main', $buflistref, @report); } } &AppProcess('argProcess'); &AppExit(); sdf-2.001/bin/prn2ps010075500042570001753000000044760661420555300140610ustar00iancmtr00000400000236#!/usr/local/bin/perl # $Id$ $VERSION{'PUBLIC'} = '2.000'; $VERSION{''.__FILE__} = '$Revision$'; # # >>Title:: PostScript Conversion Utility # # >>Copyright:: # Copyright (c) 1992-1997, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 18-Jul-97 ianc SDF 2.000 # ----------------------------------------------------------------------- # # >>Purpose:: # {{CMD:prn2ps}} converts Windows PostScript to Unix PostScript. # The input to this program is typically generated by printing # to a PostScript printer connected to the FILE: logical device. # The output can be converted to Encapsulated PostScript using # GhostScript's {{CMD:p2epsi}} program. # # >>Description:: # !SDF_OPT_STD # # For each input file, the output is generated by: # # * deleting the {{PageSize}} information # * deleting the control-D at the end of the file. # # >>Limitations:: # If {{CMD:ps2epsi}} doesn't like the output, you may need to # use another printer driver to generate the input. # On Windows NT 4.0, the {{Canon PS-IPU Color Laser Copier v52.3}} # driver works most of the time. # # >>Examples:: # To generate an Encapsulated PostScript file from Windows PostScript: # # > prn2ps -ops myfig.prn # > ps2epsi myfig.ps # # >>Implementation:: # require "sdf/app.pl"; ########## Initialisation ########## # define configuration %app_config = ( 'libdir', 'sdf/home', ); # define options #push(@app_option, ( # #'Name|Spec|Help', #)); # handle options &AppInit('prn_file ...', "convert Windows PostScript to Unix PostScript", 'SDF') || &AppExit(); ########## Processing ########## sub argProcess { my($ARGV) = @_; # my(); local($_); # Open the input unless (open(FILE, $ARGV)) { &AppMsg("abort", "failed to open '$ARGV'"); return; } # Generate the output my $end = ''; while () { if ($end) { $end = '' if /^\Q$end/; next; } elsif (index($_, '%%BeginFeature: *PageSize') == 0) { $end = '%%EndFeature'; next; } next if /^\004/; # Ignore the terminating ^D print; } close(FILE); } &AppProcess('argProcess'); &AppExit(); sdf-2.001/bin/Makefile.PL010064400042570001753000000002570647263711000146520ustar00iancmtr00000400000236 use ExtUtils::MakeMaker; WriteMakefile( NAME => 'SDF::bin', EXE_FILES => [ qw( fm2ps mif2rtf pod2sdf poddiff prn2ps sdf sdfapi sdfbatch sdfcli sdfget sdngen ) ], ); sdf-2.001/bin/mkpldocs010075500042570001753000000012440647623231200144360ustar00iancmtr00000400000236#!/usr/local/bin/perl use File::Find; # Check the usage unless (@ARGV) { print "usage: mkplhtml all\n"; print " or mkplhtml dir1 ...\n"; exit 1; } # Traverse the directories my @dirs = $ARGV[0] eq 'all' ? ('ext', 'lib', 'pod', 'vms', 'utils') : @ARGV; find(\&wanted, @dirs); # Build the catalog print "building the catalog...\n"; system("sdf -2html catalog"); # Convert each .pm and .pod file sub wanted { if (/\.(pm|pod)$/ || $File::Find::dir eq 'utils' && /\.PL$/) { my $depth = scalar(split(/\//, $File::Find::dir)); print "$File::Find::name (depth: $depth)\n"; system("sdf -2html -cperl -DPERL_DIR_DEPTH=$depth $_"); } } sdf-2.001/bin/pod2sdf010075500042570001753000000017540647623231200141710ustar00iancmtr00000400000236#!/usr/local/bin/perl use Pod::Sdf; use strict; # Get the options, if any my %param = (); if ($ARGV[0] eq '-m') { $param{'main'} = 1; shift; } # Check the usage unless (scalar(@ARGV) == 1) { print "usage: pod2sdf [-m] infile > outfile\n"; exit 1; } # Load the pod into an array my $infile = shift; open(INFILE, $infile) || die "unable to open '$infile': $!\n"; my @pod = ; chop(@pod); # Convert it to SDF and output it my @sdf = pod2sdf(\@pod, \%param); print join("\n", @sdf), "\n"; 1; __END__ =head1 NAME pod2sdf - converts POD to SDF markup =head1 SYNOPSIS pod2sdf [-m] infile > outfile =head1 DESCRIPTION B should be used when one wants to use SDF instead of POD as the base documentation format. B does this convertion on the fly for C<*.pod, *.pl, *.pm> files for you. So B is only needed when one wants to make extensive use of the powerful features of SDF and marking them with C<=begin sdf> and C<=end sdf> gets inconvenient. =cut sdf-2.001/bin/fm2ps010055500042570001753000000223730661420536500136570ustar00iancmtr00000400000236#!/usr/local/bin/perl # $Id$ $VERSION{'PUBLIC'} = '2.000'; $VERSION{''.__FILE__} = '$Revision$'; # # >>Title:: Batch Processing Utility # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 29-Feb-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # # >>Purpose:: # {{CMD:sdfbatch}} is a preprocessor for {{CMD:fmbatch}}, # [[FrameMaker]]'s command-line driven batch processing utility. # # >>Description:: # Given a set of [[FrameMaker]] documents, {{CMD:sdfbatch}} can be used to: # # * change the formatting of the documents (ala {{Use Formats From}}) # * update the documents (i.e. cross-references, etc.) # * print the documents # * save the documents in a nominated file format # # !SDF_OPT_HELP # # To change formatting, use the -f option to specify the file # to import the formats from. The -F option can be used to # specify what formats are imported. The argument to the -F # option is a set of the characters in the table below. # # !block table; format=28 # Character Meaning # p Paragraph formats # f Font formats # l Page layouts # c Cross references # v Variables # r Reference page contents # t Table formats # x Conditional text # k Color # m math # B Preserve manual page breaks # O Preserve other formatting overrides # !endblock # # By default, all formats are imported. # # To update documents, use the -u option. # # To print documents, use the -p option. If a parameter is not provided, # the file will be printed to the default printer. To print to a # [[PostScript]] file, specify the "file" keyword as the parameter. # Alternatively, the parameter is the name of a {{print settings}} file. # # When generating a [[PostScript]] file, the paper size can be specified # using the -P option. The default value is {{global}}. The paper size # name is actually mapped to a {{print settings}} file called # {{paper_size}}.{{fmver}} in the {{FILE:stdlib}} library directory. # {{fmver}} is typically either fm4 or fm5, depending on which version # of FrameMaker you are using. # # To save documents, use the -s option. By default, this saves each file. # To change the extension, supply an argument to the -s option. # # To specify a different format, use the -S option. Possible # values are: # # * m - MIF # * a - line-oriented ASCII # * t - paragraph-oriented ASCII # * d - Frame document # * l - View-Only Frame document # * - - file's current format [default] # # Take care with the file extension - any existing files will be # replaced without warning. # # The -n option causes the generated {{CMD:fmbatch}} file to be output. # i.e. fmbatch is not called. This option is useful for debugging. # # The -t option enables the user to tune the time-out used when # waiting for the print driver to generate a PostScript file. # The default value is 300 seconds (i.e. 5 minutes). # # A combination of the f, u, p and s options can be supplied if more # that one operation is required per file. For example, you may # wish to import formats and then save the resultant file. For # each file, the operations are always done in the following order: # # ^ formatting # + updating # + printing # + saving # # Note: Not all of the values documented for the -F and -S options # may be supported in Frame versions before 4.0 and additional # values may be supported in future versions. As such, the # values supplied to these options are simply embedded in the # generated {{CMD:sdfbatch}} file. i.e. no checking is done on the value. # This behaviour is considered a feature. # # >>Examples:: # # To format and print a set of files: # # V: sdfbatch -fmyfmts.doc -p *.doc # # To convert mif files to binary files: # # V: sdfbatch -sdoc -Sd *.mif # # To copy Frame variables from a file to a set of files: # # V: sdfbatch -fvariable.mif -Fv -s *.doc # # >>Limitations:: # # >>Resources:: # # >>Implementation:: # require "sdf/app.pl"; ########## Initialisation ########## # define configuration %app_config = ( 'inifile', 'sdfbatch.ini', 'libdir', 'sdf/home', ); # define options @app_option = @app_option_core; push(@app_option, ( #'Name|Spec|Help', 'fmt_file|STR|formats file', 'fmt_what;F|STR|formats to import', 'update_doc|BOOL|update documents', 'print_doc|STR;;-|print documents', 'paper_size;P|STR;global|paper size name', 'save_ext|STR;;-|save extension', 'save_fmt;S|STR;-|save file format', 'no_action|BOOL|output the batch file (instead of calling fmbatch)', 'timeout|INT;300|timeout for printer driver to generate ps', )); # setup default values for: # * the path of the Frame executables # * the fmbatch command to use # * the FrameMaker extension to use # * the temporary file #$fmhome = $ENV{'FMHOME'} ? $ENV{'FMHOME'} : "/usr/frame"; $fmbatch = "fmbatch -i"; $fmext = "fm5"; $tmp_file = "/tmp/sdfbatch$$"; # ini-file handler sub iniProcess { local($fname, *data) = @_; # local(); local($section, %values); for $section (sort keys %data) { if ($section eq 'Frame') { %values = &AppSectionValues($data{$section}); $fmbatch = $values{'fm_batch'} if $values{'fm_batch'} ne ''; $fmext = $values{'fm_ext'} if $values{'fm_ext'} ne ''; delete $data{$section}; } else { delete $data{$section}; } } } # handle options &AppInit('frame_file ...', 'generate fmbatch input file', 'SDF', 'iniProcess') || &AppExit(); # set up print settings file, if any if ($print_doc && $print_doc ne '-') { if ($print_doc eq 'file') { $prt_file = "$app_lib_dir/stdlib/$paper_size.$fmext"; } else { $prt_file = $print_doc; } } # This is the set of filenames collected during argument processing @doc_files = (); ########## Argument Processing ########## sub argProcess { local($doc_file) = @_; # local(); push(@doc_files, $doc_file); push(@batch, "Open \"$doc_file\""); if ($fmt_file) { push(@batch, "UseFormatsFrom $fmt_what \"$doc_file\" \"$fmt_file\""); } if ($update_doc) { push(@batch, "Update \"$doc_file\""); } if ($print_doc) { if ($prt_file) { push(@batch, "Print \"$doc_file\" \"$prt_file\""); } else { push(@batch, "Print \"$doc_file\""); } } if ($save_ext) { if ($save_ext eq '-' && $save_fmt eq '-') { push(@batch, "Save \"$doc_file\""); } elsif ($save_ext eq '-') { $new_file = $doc_file; push(@batch, "SaveAs $save_fmt \"$doc_file\" \"$new_file\""); } else { $new_file = &NameSubExt($doc_file, $save_ext); push(@batch, "SaveAs $save_fmt \"$doc_file\" \"$new_file\""); } } push(@batch, "Quit \"$doc_file\""); # return result return 0; } ########## Main Program ########## # Build the batch file @batch = (); push(@batch, "Open \"$fmt_file\"") if $fmt_file; push(@batch, "Open \"$prt_file\"") if $prt_file; &AppProcess('argProcess'); push(@batch, "Quit \"$fmt_file\"") if $fmt_file; push(@batch, "Quit \"$prt_file\"") if $prt_file; # If requested, output the batch file if ($no_action) { printf "%s\n", join("\n", @batch); } # Otherwise, pass it to fmbatch for execution else { # call fmbatch unless (open(FMBATCH, "|$fmbatch > $tmp_file")) { &AppExit("fatal", "failed to pipe data to fmbatch"); } printf FMBATCH "%s\n", join("\n", @batch); # clean up close(FMBATCH); if ($? || $debug) { unless (open(TMPFILE, $tmp_file)) { &AppExit("app_warning", "unable to open tmp file '$tmp_file'"); } else { print ; close(TMPFILE); } } unlink($tmp_file); # Rename the ps files, if necessary if ($print_doc eq 'file' && $fmext ne 'fm4') { for $doc_file (@doc_files) { &RenamePS($doc_file); } } } # Exit the program &AppExit(); ########## Support Routines ########## # Signam handler for alarms $timed_out = 0; sub handle_alarms { $timed_out = 1; } # Rename a PostScript file from the form xx.out.ps to the form xx.ps. # {{base_ext}} is the orginal filename without the ps (e.g. xx.out). sub RenamePS { local($base_ext) = @_; # local(); local($base, $ext); local($old_name, $new_name); # Get the filenames if ($base_ext =~ /\.(\w+)$/) { $base = $`; $ext = $1; } else { $base = $base_ext; $ext = ''; } $old_name = "$base_ext.ps"; $new_name = "$base.ps"; # Setup the alarm handler for RenamePS timeouts $timed_out = 0; $SIG{'ALRM'} = 'handle_alarms'; alarm($timeout); # Wait until the print driver has finished, if necessary unless (-f $old_name) { print STDERR "waiting for '$old_name' to finish printing\n"; until (-f $old_name) { last if $timed_out; sleep(1); print STDERR "."; } print STDERR "\n"; } # Rename the file, if possible if ($timed_out) { &AppMsg("app_warning", "'$old_name' not found after $timeout seconds"); } else { rename($old_name, $new_name) || &AppMsg("app_warning", "unable to rename '$old_name' to '$new_name':$!"); } } sdf-2.001/bin/sdfbatch010075500042570001753000000223730661420536500144100ustar00iancmtr00000400000236#!/usr/local/bin/perl # $Id$ $VERSION{'PUBLIC'} = '2.000'; $VERSION{''.__FILE__} = '$Revision$'; # # >>Title:: Batch Processing Utility # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 29-Feb-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # # >>Purpose:: # {{CMD:sdfbatch}} is a preprocessor for {{CMD:fmbatch}}, # [[FrameMaker]]'s command-line driven batch processing utility. # # >>Description:: # Given a set of [[FrameMaker]] documents, {{CMD:sdfbatch}} can be used to: # # * change the formatting of the documents (ala {{Use Formats From}}) # * update the documents (i.e. cross-references, etc.) # * print the documents # * save the documents in a nominated file format # # !SDF_OPT_HELP # # To change formatting, use the -f option to specify the file # to import the formats from. The -F option can be used to # specify what formats are imported. The argument to the -F # option is a set of the characters in the table below. # # !block table; format=28 # Character Meaning # p Paragraph formats # f Font formats # l Page layouts # c Cross references # v Variables # r Reference page contents # t Table formats # x Conditional text # k Color # m math # B Preserve manual page breaks # O Preserve other formatting overrides # !endblock # # By default, all formats are imported. # # To update documents, use the -u option. # # To print documents, use the -p option. If a parameter is not provided, # the file will be printed to the default printer. To print to a # [[PostScript]] file, specify the "file" keyword as the parameter. # Alternatively, the parameter is the name of a {{print settings}} file. # # When generating a [[PostScript]] file, the paper size can be specified # using the -P option. The default value is {{global}}. The paper size # name is actually mapped to a {{print settings}} file called # {{paper_size}}.{{fmver}} in the {{FILE:stdlib}} library directory. # {{fmver}} is typically either fm4 or fm5, depending on which version # of FrameMaker you are using. # # To save documents, use the -s option. By default, this saves each file. # To change the extension, supply an argument to the -s option. # # To specify a different format, use the -S option. Possible # values are: # # * m - MIF # * a - line-oriented ASCII # * t - paragraph-oriented ASCII # * d - Frame document # * l - View-Only Frame document # * - - file's current format [default] # # Take care with the file extension - any existing files will be # replaced without warning. # # The -n option causes the generated {{CMD:fmbatch}} file to be output. # i.e. fmbatch is not called. This option is useful for debugging. # # The -t option enables the user to tune the time-out used when # waiting for the print driver to generate a PostScript file. # The default value is 300 seconds (i.e. 5 minutes). # # A combination of the f, u, p and s options can be supplied if more # that one operation is required per file. For example, you may # wish to import formats and then save the resultant file. For # each file, the operations are always done in the following order: # # ^ formatting # + updating # + printing # + saving # # Note: Not all of the values documented for the -F and -S options # may be supported in Frame versions before 4.0 and additional # values may be supported in future versions. As such, the # values supplied to these options are simply embedded in the # generated {{CMD:sdfbatch}} file. i.e. no checking is done on the value. # This behaviour is considered a feature. # # >>Examples:: # # To format and print a set of files: # # V: sdfbatch -fmyfmts.doc -p *.doc # # To convert mif files to binary files: # # V: sdfbatch -sdoc -Sd *.mif # # To copy Frame variables from a file to a set of files: # # V: sdfbatch -fvariable.mif -Fv -s *.doc # # >>Limitations:: # # >>Resources:: # # >>Implementation:: # require "sdf/app.pl"; ########## Initialisation ########## # define configuration %app_config = ( 'inifile', 'sdfbatch.ini', 'libdir', 'sdf/home', ); # define options @app_option = @app_option_core; push(@app_option, ( #'Name|Spec|Help', 'fmt_file|STR|formats file', 'fmt_what;F|STR|formats to import', 'update_doc|BOOL|update documents', 'print_doc|STR;;-|print documents', 'paper_size;P|STR;global|paper size name', 'save_ext|STR;;-|save extension', 'save_fmt;S|STR;-|save file format', 'no_action|BOOL|output the batch file (instead of calling fmbatch)', 'timeout|INT;300|timeout for printer driver to generate ps', )); # setup default values for: # * the path of the Frame executables # * the fmbatch command to use # * the FrameMaker extension to use # * the temporary file #$fmhome = $ENV{'FMHOME'} ? $ENV{'FMHOME'} : "/usr/frame"; $fmbatch = "fmbatch -i"; $fmext = "fm5"; $tmp_file = "/tmp/sdfbatch$$"; # ini-file handler sub iniProcess { local($fname, *data) = @_; # local(); local($section, %values); for $section (sort keys %data) { if ($section eq 'Frame') { %values = &AppSectionValues($data{$section}); $fmbatch = $values{'fm_batch'} if $values{'fm_batch'} ne ''; $fmext = $values{'fm_ext'} if $values{'fm_ext'} ne ''; delete $data{$section}; } else { delete $data{$section}; } } } # handle options &AppInit('frame_file ...', 'generate fmbatch input file', 'SDF', 'iniProcess') || &AppExit(); # set up print settings file, if any if ($print_doc && $print_doc ne '-') { if ($print_doc eq 'file') { $prt_file = "$app_lib_dir/stdlib/$paper_size.$fmext"; } else { $prt_file = $print_doc; } } # This is the set of filenames collected during argument processing @doc_files = (); ########## Argument Processing ########## sub argProcess { local($doc_file) = @_; # local(); push(@doc_files, $doc_file); push(@batch, "Open \"$doc_file\""); if ($fmt_file) { push(@batch, "UseFormatsFrom $fmt_what \"$doc_file\" \"$fmt_file\""); } if ($update_doc) { push(@batch, "Update \"$doc_file\""); } if ($print_doc) { if ($prt_file) { push(@batch, "Print \"$doc_file\" \"$prt_file\""); } else { push(@batch, "Print \"$doc_file\""); } } if ($save_ext) { if ($save_ext eq '-' && $save_fmt eq '-') { push(@batch, "Save \"$doc_file\""); } elsif ($save_ext eq '-') { $new_file = $doc_file; push(@batch, "SaveAs $save_fmt \"$doc_file\" \"$new_file\""); } else { $new_file = &NameSubExt($doc_file, $save_ext); push(@batch, "SaveAs $save_fmt \"$doc_file\" \"$new_file\""); } } push(@batch, "Quit \"$doc_file\""); # return result return 0; } ########## Main Program ########## # Build the batch file @batch = (); push(@batch, "Open \"$fmt_file\"") if $fmt_file; push(@batch, "Open \"$prt_file\"") if $prt_file; &AppProcess('argProcess'); push(@batch, "Quit \"$fmt_file\"") if $fmt_file; push(@batch, "Quit \"$prt_file\"") if $prt_file; # If requested, output the batch file if ($no_action) { printf "%s\n", join("\n", @batch); } # Otherwise, pass it to fmbatch for execution else { # call fmbatch unless (open(FMBATCH, "|$fmbatch > $tmp_file")) { &AppExit("fatal", "failed to pipe data to fmbatch"); } printf FMBATCH "%s\n", join("\n", @batch); # clean up close(FMBATCH); if ($? || $debug) { unless (open(TMPFILE, $tmp_file)) { &AppExit("app_warning", "unable to open tmp file '$tmp_file'"); } else { print ; close(TMPFILE); } } unlink($tmp_file); # Rename the ps files, if necessary if ($print_doc eq 'file' && $fmext ne 'fm4') { for $doc_file (@doc_files) { &RenamePS($doc_file); } } } # Exit the program &AppExit(); ########## Support Routines ########## # Signam handler for alarms $timed_out = 0; sub handle_alarms { $timed_out = 1; } # Rename a PostScript file from the form xx.out.ps to the form xx.ps. # {{base_ext}} is the orginal filename without the ps (e.g. xx.out). sub RenamePS { local($base_ext) = @_; # local(); local($base, $ext); local($old_name, $new_name); # Get the filenames if ($base_ext =~ /\.(\w+)$/) { $base = $`; $ext = $1; } else { $base = $base_ext; $ext = ''; } $old_name = "$base_ext.ps"; $new_name = "$base.ps"; # Setup the alarm handler for RenamePS timeouts $timed_out = 0; $SIG{'ALRM'} = 'handle_alarms'; alarm($timeout); # Wait until the print driver has finished, if necessary unless (-f $old_name) { print STDERR "waiting for '$old_name' to finish printing\n"; until (-f $old_name) { last if $timed_out; sleep(1); print STDERR "."; } print STDERR "\n"; } # Rename the file, if possible if ($timed_out) { &AppMsg("app_warning", "'$old_name' not found after $timeout seconds"); } else { rename($old_name, $new_name) || &AppMsg("app_warning", "unable to rename '$old_name' to '$new_name':$!"); } } sdf-2.001/bin/sdf010075500042570001753000000520200672214532300133730ustar00iancmtr00000400000236#!/usr/local/bin/perl # $Id$ $VERSION{'PUBLIC'} = '2.001'; $VERSION{''.__FILE__} = '$Revision$'; # # >>Title:: SDF Conversion Utility # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 29-Feb-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # # >>Purpose:: # {{CMD:sdf}} converts [[SDF]] files to other document formats. # # >>Description:: # !SDF_OPT_STD # # The -2 option is a convenient way of specifying the alias (collection # of options) which generates the output you want. e.g. # # V: sdf -2html abc # # is equivalent to: # # V: sdf +sdf2html abc # # The -D option is used to define variables. These are typically # used for controlling conditional text and substituting text which # changes. The format used is: # # V: -Dvariable1=value1,variable2=value2 # # A flag is a shorthand way of specifying variables in the DOC family. # i.e. -ftoc=3 is equivalent to -DDOC_TOC=3. # The format of the -f option is: # # V: -fflag1=value1,flag2=value2 # # If a variable or flag is specified without a value, 1 is assumed. # # To generate [[HTML]] topics, the command is: # # V: sdf -2topics abc # # By default, this will create sub-topics for each heading already in a # separate file. It will also {{autosplit}} level 1 headings into sub-topics. # The -n option can be used to control which level headings are split at: # # * 1 autosplits on level 1 headings (the default) # * 2 autosplits on level 2 headings # * 3 autosplits on level 3 headings # * 0 disables autosplitting. # # Include files are searched for in the current directory, # then in the directories given by the -I option, # then in the default library directory. # # By default, {{CMD:sdf}} is configured to {{prefilter}} files with # certain extensions. For example: # # V: sdf mytable.tbl # # is equivalent to executing {{CMD:sdf}} on a file which only contains: # # V: !include "mytable.pl"; table # # The -p option can be used to explicitly prefilter files or to # override the default prefilter used. If a parameter is not provided, # the prefilter is assumed to be {{table}}. # # The -a option can be used to specify parameters for the prefilter. # For example: # # V: sdf -aformat='15,75,10' mytable.tbl # # The -P option prefilters the input files as programming languages. # The parameter is the language to use. If none is provided, the # extension is assumed to be the language name. For example: # # V: sdf -P myapp.c # # is equivalent to executing {{CMD:sdf}} on a file which only contains: # # V: !include "myapp.c"; example; wide; lang='c' # # The -N option adds line numbers at the frequency given. # The default frequency is 1. i.e. every line. # # The -g option prefilters the input files by executing {{CMD:sdfget}} # using the default report (default.sdg). To change the report used, # specify the report name as the parameter. # If the report name doesn't include an extension, sdg is assumed. # # Note: {{CMD:sdfget}} searches for reports in the current directory, # then in the {{stdlib}} directory within SDF's library directory. # # The -r option runs the nominated SDR report on each input before formatting. # In other words, SDR reports provide a mechanism for: # # * analysing the SDF just before it would be formatted, and # * replacing that SDF with the output of the report (also SDF) # so that the final output is a nicely formatted report. # # For example, the {{sdf_dir}} report generates a directory (tree) of # the components (files) included in an SDF document. # Reports are stored in {{sdr}} files and are searched for using the # usual rules. # # The -L option can be used to specify a {{locale}}. # The default locale name is specified in F. # Locale naming follows POSIX conventions (i.e. language_country), so # the locale name for American english is {{en_us}}. # The information for each locale is stored in the F directory, # so you'll need to have to look in there to see what locales are # available. (As the default locale can be set in F, this # isn't as ugly as it first sounds.) # # Note: At the moment, a locale file simply contains a list of language # specific strings. Ultimately, it should be extended to # support localisation of date and time formats. # # The -k option is used to specify a {{look}}. # The default look library is specified in {{FILE:sdf.ini}}. # # The -s option can be used to specify a document {{style}}. # Typical values are: # # * {{document}} - a technical document # * {{memo}} - a memo # * {{fax}} - a facsimile # * {{minutes}} - minutes of a meeting. # # The -S option is used to specify the page size. # Values supported include: # # !block table # Name Width Height Comment # global 21.0cm 11.0in will fit on either A4 or letter # A3 29.7cm 42.0cm # A4 21.0cm 29.7cm # A5 14.8cm 21.0cm # B4 25.7cm 36.4cm # B5 17.6cm 25.0cm # letter 8.5in 11.0in # legal 8.5in 14.0in # tabloid 11.0in 17.0in # !endblock # # Additional page sizes can be configured in {{FILE:sdf.ini}}. # To specify a rotated version of a named page size, append an {{R}}. # For example, A4R implies a width of 29.7cm and a height of 21cm. # A custom page size can also be specified using the format: # # V: {{width}}x{{height}} # # where {{width}} and {{height}} are the respective sizes in points. # # The -c option is used to specify a configuration library. # # A list of modules to use can be specified via the -u option. # # The initial heading level to start on can be specified via # the -H option. This is useful if you want to preview how a # topic will be displayed without regenerating the complete document. # If a topic begins with a level 1 heading (e.g. H1) and you wish to # format it as a document (i.e. the level 1 text becomes the DOC_NAME # for {{MAC:build_title}}), use the -H option with a value of 0. # # The look of headings can also be adjusted. By default, H-style # headings are numbered, A-style headings are lettered and P-style # headings are plain. To force a particular style for all headings, # the -K option can be used. Sensible parameter values are H, A and P # although other values may work depending on what paragraph styles # are configured at your site. # # The -d option is used to specify the format driver. # Values supported include: # # * {{expand}} - format as expanded text (the default) # * {{mif}} - Maker Interchange Format # * {{pod}} - Plain Old Documentation (as used by [[Perl]]). # # Additional drivers can be configured in {{FILE:sdf.ini}}. # # The -y option can to used to specify a post-filter. # # The -z option can be used to specify a list of post-processing # actions you want to execute on each output file after it is # generated. The actions supported include: # # * {{ps}} - generate PostScript # * {{doc}} - generate a Frame (binary) file # * {{fvo}} - generate a Frame View-Only file # * {{txt}} - generate a text file # * {{rtf}} - generate an RTF file # * {{clean}} - delete the output file (must be last). # # Additional actions can be configured in {{FILE:sdf.ini}}. # By convention, the generated files are given the same names # as the action keywords. # # The -t option is used to specify the logical target format. # If none is specified, the default is the first post processing # action, if any. Otherwise, the default is the format driver name. # # The -v option enables verbose mode. This is useful for debugging # problems related to post processing. In particular, post processing # actions containing the pattern {{clean}} are skipped in verbose mode. # You can also switch off the post processing messages by using a # verbose value of -1. Values higher than 1 switch on additional # trace messages as follows: # # . 2 - show how names of files and libraries are resolved # . 3 - show the directories searched for libraries # . 4 - show the directories searched for modules # . 5 - show the directories searched for normal files. # # The -T option can be used to switch on # debug tracing. The parameter is a comma-separated list of name-value # pairs where each name is a {{tracing group}} and each value is the # level of tracing for that group. To get the trace output provided # by the -v option, one can use the {{user}} group like this: # # > sdf -Tuser=2 ... # # This is slightly different from the -v option in that intermediate # files are not implicitly kept. Additional tracing groups will be # added over time (probably one per output driver). # # The -w option is used to specify the width for text-based outputs. # # The -z, -D, -f and -I options are list options. i.e. multiple values # can be separated by commas and/or the options can be supplied # multiple times. # # >>Examples:: # # Convert {{FILE:mydoc.sdf}} to a technical document in mif format, # output is {{FILE:mydoc.mif}}: # # V: sdf -2mif mydoc.sdf # # Convert {{FILE:mydoc.sdf}} to online documentation in {{PRD:FrameViewer}} # format, output is {{FILE:mydoc.fvo}}: # # V: sdf -2fvo mydoc.sdf # # Convert {{FILE:mydoc.sdf}} to online documentation in HTML, # output is {{FILE:mydoc.html}}: # # V: sdf -2html mydoc.sdf # # The following command will build the reference documentation # for a SDF module in HTML: # # V: sdf -2html abc.sdm # # >>Limitations:: # Many of the default post processing (-z) actions only works on [[Unix]] as # [[FrameMaker]] for [[Windows]] does not support batch conversion. # # Topics mode has several limitations: # * only documents in the current directory can be converted # * all sub-topics must also be in the current directory. # # >>Resources:: # # >>Implementation:: # require "sdf/app.pl"; require "sdf/parse.pl"; ########## Initialisation ########## # define configuration %app_config = ( 'inifile', 'sdf.ini', 'libdir', 'sdf/home', ); # Table of format mappings %format_mappings = (); # routine for handling the 2 option sub MyToAlias { local($arg) = @_; my $alias = $format_mappings{$arg} || $arg; &AppMsg("app", "formatting using '$alias'") if $verbose; unshift(@ARGV, "+sdf2$alias"); } # define options push(@app_option, ( #'Name|Spec|Help', 'format;2|ROUTINE-MyToAlias;|the output format you want', 'variable;D|STRHASH|define variables', 'split_level;n|INT|heading level to autosplit into topics', 'flag|STRHASH|define flags (i.e. DOC_* variables)', 'include_path;I|STRLIST|search path for include files, templates, etc.', 'prefilter|STR;;table|pre-filter input file from each argument', 'parameters;a|STR|parameters for the pre-filter', 'plang;P|STR;;-|pre-filter as a programming language', 'line_numbers;N|INT;;1|number lines in pretty-printed source code', 'get_report|STR;;default|pre-filter using sdfget with the report specified', 'report|STR|report to run on the SDF to transform it before formatting', 'locale;L|STR|locale', 'look;k|STR|look library', 'style|STR|style of document', 'page_size;S|STR|page size for paper documents', 'config|STR|configuration library', 'uses|STRLIST|modules to use', 'head_level;H|INT|initial heading level', 'head_look;K|STR|heading look (H, A or P)', 'driver|STR;expand|format driver - default is expand', 'post_filter;y|STR|filter to post-filter the output with', 'post_process;z|STRLIST|list of post processing actions to do', 'target|STR|logical target format', 'verbose|INT;;1|verbose mode', 'trace_levels;T|STRHASH|debugging trace levels', 'width|INT|width for text-based outputs', 'library_path;Y|STRLIST|search path for libraries', )); # configuration tables %prefilter_for = (); %post_processing = (); %predefined_vars = (); # ini-file handler sub iniProcess { local($fname, *data) = @_; # local(); local($section, @pagesizes, @prefilters, @drivers, @conversions); for $section (sort keys %data) { if ($section eq 'Frame') { %values = &AppSectionValues($data{$section}); $sdf_fmext = $values{'fm_ext'}; delete $data{$section}; } elsif ($section eq 'PageSizes') { @pagesizes = &TableParse(split(/\n/, $data{$section})); &SdfLoadPageSizes(@pagesizes); delete $data{$section}; } elsif ($section eq 'PreFilters') { @prefilters = &TableParse(split(/\n/, $data{$section})); &LoadPreFilters(@prefilters); delete $data{$section}; } elsif ($section eq 'Drivers') { @drivers = &TableParse(split(/\n/, $data{$section})); &SdfLoadDrivers(@drivers); delete $data{$section}; } elsif ($section eq 'PostProcessing') { %post_processing = &AppSectionValues($data{$section}); delete $data{$section}; } elsif ($section eq 'Variables') { %predefined_vars = &AppSectionValues($data{$section}); delete $data{$section}; } elsif ($section eq 'FormatMappings') { %format_mappings = &AppSectionValues($data{$section}); delete $data{$section}; } elsif ($section eq 'Conversions') { @conversions = &TableParse(split(/\n/, $data{$section})); &NameLoadConversionRules(*conversions, $verbose); delete $data{$section}; } } } # Prefilter validation rules @_PREFILTER_RULES = &TableParse( 'Field Category', 'Name key', 'Aliases optional', ); # This routine loads the prefilters sub LoadPreFilters { local(@data) = @_; # local(); local(@fld, $rec, %value); local($name, $alias); # Validate the table &TableValidate(*data, *_PREFILTER_RULES); # Process the prefilter table @fld = &TableFields(shift(@data)); for $rec (@data) { %value = &TableRecSplit(*fld, $rec); $name = $value{'Name'}; $prefilter_for{$name} = $name; for $alias (split(/,/, $value{'Aliases'})) { $prefilter_for{$alias} = $name; } } } # handle options &AppInit('sdf_file ...', 'convert an sdf file to another format', 'SDF', 'iniProcess') || &AppExit(); # Initialise the tracing levels %app_trace_level = %trace_levels; $app_trace_level{"user"} = $verbose if $verbose > $app_trace_level{"user"}; # Initialise the SDF module to use the correct search paths @sdf_include_path = @include_path; @sdf_library_path = @library_path; $sdf_lib = $app_lib_dir; # Check the page size is defined or in the form width"x"height if ($page_size ne '') { unless ($sdf_pagesize{$page_size} || $page_size =~ /^[\d\.]+x[\d\.]+$/) { &AppExit("fatal", "page size '$page_size' not supported."); } } # Check the format driver is defined unless ($sdf_driver{$driver}) { &AppExit("fatal", "format driver '$driver' not supported."); } # Check the post processing actions are configured and define the # matching variables for $action (@post_process) { unless ($post_processing{$action}) { &AppExit("fatal", "post-processing '$action' not supported."); } $name = $action; $name =~ tr/a-z/A-Z/; $variable{"OPT_PP_$name"} = 1; } # Assign a default logical target, if necessary if ($target eq '') { $target = @post_process ? $post_process[0] : $driver; } # Make the predefined variables for $var (keys %predefined_vars) { $variable{$var} = $predefined_vars{$var}; } # Map flags to variables while (($flag, $value) = each %flag) { $flag =~ tr/a-z/A-Z/; $flag = "DOC_$flag"; $variable{$flag} = $value unless defined $variable{$flag}; } # When pretty-printing programming languages, 'listing' is the style used $style = 'listing' if $plang ne ''; # Map the key configuration options to variables $variable{'OPT_LOCALE'} = ($locale eq '.' ? '' : $locale) if $locale ne ''; $variable{'OPT_LOOK'} = ($look eq '.' ? '' : $look) if $look ne ''; $variable{'OPT_STYLE'} = ($style eq '.' ? '' : $style) if $style ne ''; $variable{'OPT_CONFIG'} = $config; $variable{'OPT_DRIVER'} = $driver; $variable{'OPT_TARGET'} = $target; $variable{'OPT_EXT'} = $out_ext; $variable{'OPT_NUMBER'} = $line_numbers; $variable{'OPT_REPORT'} = $report; $variable{'OPT_SPLIT_LEVEL'} = $split_level; $variable{'OPT_HEAD_LEVEL'} = $head_level; $variable{'OPT_HEAD_LOOK'} = $head_look; $variable{'OPT_PAGE_SIZE'} = $page_size if $page_size ne ''; $variable{'OPT_WIDTH'} = $width if $width ne ''; # Map other interesting things to variables. Note that we let the # user override these things on the command line if they want to. $variable{'SDF_VERSION'} = $app_product_version unless $variable{'SDF_VERSION'}; $variable{'SDF_HOME'} = $app_lib_dir unless $variable{'SDF_HOME'}; # When regression testing, make sure that version changes don't cause problems if ($variable{'SDF_TEST'}) { $variable{'SDF_VERSION'} = 'x.y'; } # When testing, '.' can be used to clear the look and/or style $look = '' if $look eq '.'; $style = '' if $style eq '.'; ########## Argument Processing ########## sub argProcess { local($ARGV) = @_; local($main_arg_err); local($msg_cursor, %msg_counts); local($new, @new); # If no output is nominated but post-processing is requested, # just do the post processing on the input files return 0 if @post_process && $out_ext eq ''; # Get the current message cursor $msg_cursor = &AppMsgNextIndex(); # Generate result @new = &GenerateDocument($ARGV); # Check for problems %msg_counts = &AppMsgCounts($msg_cursor); if ($msg_counts{'error'} || $msg_counts{'abort'} || $msg_counts{'fatal'} ) { return 1; } # Output result for $new (@new) { print "$new\n"; } return 0; } # This routine generates a document sub GenerateDocument { local($ARGV) = @_; local(@new); local($file_ext); local($filter, $module); local($lang); local($input_str); local($ok_sdf, @sdf_data); $file_ext = (&NameSplit($ARGV))[2]; # Handle programming language and sdfget pre-filtering if ($plang ne '') { $lang = $plang eq '-' ? $file_ext : $plang; $prefilter = "example; wide; pure; lang='$lang'"; } elsif ($get_report ne '') { $prefilter = "get; report='$get_report'"; } # Generate the SDF file if we're pre-filtering the input $filter = $prefilter ne '' ? $prefilter : $prefilter_for{$file_ext}; if ($filter ne '') { # When prefiltering pod, assume the main parameter if ($filter eq 'pod') { $filter .= "; main"; } $filter .= "; $parameters" if $parameters ne ''; @sdf_data = ( "!_bof_ '$ARGV'", "!include '$ARGV'; $filter", "!_eof_"); } # If we haven't built the SDF by now, fetch it from the file else { ($ok_sdf, @sdf_data) = &SdfFetch($ARGV); unless ($ok_sdf) { &AppMsg('abort', "error fetching sdf file '$ARGV'"); return (); } } # Generate and return the required format @new = &SdfConvert(*sdf_data, $driver, *uses, %variable); # Post filter the output, if requested if ($post_filter ne '') { &AppMsg("object", "'$post_filter' post filtering...") if $verbose >= 0; require "sdf/post_$post_filter.pl"; $fn = $post_filter . "_PostFilter"; @new = eval {&$fn(*new)}; &AppMsg('failed', $@) if $@; } # Return result return @new; } # This is called AFTER output streams have been closed for each argument sub argPostProcess { local($ARGV, $main_arg_err) = @_; # local(); local($action); # If an error occurred in the main processing routine or there # is nothing to do, just return return if $main_arg_err || scalar(@post_process) == 0; # Ensure the necessary variables are exported to the 'user' package # Note: If post-processing is the only thing requested, the output # extension is taken from the input filename $SDF_USER'short = (&NameSplit($ARGV))[1]; $SDF_USER'long = &NameJoin($out_dir, $SDF_USER'short, ''); $SDF_USER'out_ext = $out_ext eq '' ? (&NameSplit($ARGV))[2] : $out_ext; $SDF_USER'width = $SDF_USER'var{'OPT_WIDTH'}; $SDF_USER'title = $SDF_USER'var{'DOC_TITLE'}; $SDF_USER'title =~ s/['\\]/\\$&/g; $SDF_USER'project = $SDF_USER'var{'DOC_PROJECT'}; $SDF_USER'project =~ s/['\\]/\\$&/g; $SDF_USER'product = $SDF_USER'var{'DOC_PRODUCT'}; $SDF_USER'product =~ s/['\\]/\\$&/g; $SDF_USER'section = $SDF_USER'var{'DOC_SECTION'} || 1; # Do the post processing for $action (@post_process) { if (!defined($post_processing{$action})) { &AppExit("failed", "unknown special command '$action'"); } else { next if $verbose && $action =~ /clean/; &AppMsg("object", "'$action' post processing...") if $verbose >= 0; package SDF_USER; eval $'post_processing{$'action}; if ($@) { &'AppMsg('abort', "error in '$action' post processing: $@"); } } } } # switch back to the main package package main; ########## Main Program ########## &AppProcess('argProcess', 'argPostProcess', 'sdf'); &AppExit(); ses|STRLIST|modules to use', 'head_level;H|INT|initial heading level', 'head_look;K|STR|heading look (H, A or P)', 'driver|STR;expand|format driver - default is expand', 'post_filter;y|STR|filter to post-filter the output with', 'post_process;z|STRLIST|list of post processing actions to do', 'target|STR|logical target format', 'verbose|INT;;1|verbose mode', 'trace_levels;T|STRHASH|debugging trace levels', 'width|INT|width for text-based outputs', 'librsdf-2.001/bin/poddiff010075500042570001753000000016200647623231200142330ustar00iancmtr00000400000236#!/usr/local/bin/perl use Pod::Diff; use strict; my $USAGE = "usage: poddiff file1 file2\n" . " or poddiff file1 ... dir\n"; # Check the usage if (scalar(@ARGV) < 2) { print $USAGE; exit 1; } # Handle the directory case elsif (-d $ARGV[$#ARGV]) { my $dir = pop(@ARGV); my $file1; my $file2; my @diff; for $file1 (@ARGV) { $file2 = "$dir/$file1"; @diff = pod_diff_files($file1, $file2); print "$file1: " . scalar(@diff) . " paragraphs differ\n"; if (@diff) { print join("\n", @diff), "\n"; } } } # Handle the simple case elsif (scalar(@ARGV) == 2) { my @diff = POD::Diff::pod_diff_files(@ARGV); if (@diff) { print scalar(@diff) . " paragraphs differ\n"; print join("\n", @diff), "\n"; } } else { print $USAGE; exit 1; } # Print some statistics pod_diff_print_stats(\*STDOUT); sdf-2.001/doc/004075500042570001753000000000000672243774600127075ustar00iancmtr00000400000236sdf-2.001/doc/ref/004075500042570001753000000000000672243775200134605ustar00iancmtr00000400000236sdf-2.001/doc/ref/mdefault.html010064400042570001753000000035250672242533500161430ustar00iancmtr00000400000236 SDF 2.001: SDF Reference: default Macro

6.8. default Macro


Interface

The general syntax is:

  !default name [value]

The arguments are:

Name Type Default Rule
name symbol    
value string 1  

See Understanding Macro Interfaces, if necessary.


Description

The default macro sets a variable if it does not already have a value.


Examples

sdf-2.001/doc/ref/mclear.html010064400042570001753000000040140672242533000155720ustar00iancmtr00000400000236 SDF 2.001: SDF Reference: clear Macro

6.6. clear Macro


Interface

The general syntax is:

  !clear [type]

The arguments are:

Name Type Default Rule
type string All <Left|Right|All>

See Understanding Macro Interfaces, if necessary.


Description

The clear macro resets text wrapping around a figure.


Examples

!import "mylogo"; align="right"
Some text.
!clear

Limitations & Future Directions

html is the only target which currently supports wrapping text around figures.

sdf-2.001/doc/ref/macros/004075500042570001753000000000000672243775200147445ustar00iancmtr00000400000236sdf-2.001/doc/ref/macros/mperlapi.sdf010064400042570001753000000011370622022216000172240ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: perlapi Macro H2: Interface !macro_interface "perlapi" H2: Description The {{perlapi}} macro extracts the API of a Perl 4 library which follows SDF's coding conventions. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mclear.sdf010064400042570001753000000013220622022216200166540ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: clear Macro H2: Interface !macro_interface "clear" H2: Description The {{clear}} macro resets text wrapping around a figure. H2: Examples !block example !import "mylogo"; align="right" Some text. !clear !endblock H2: Limitations & Future Directions {{html}} is the only target which currently supports wrapping text around figures. sdf-2.001/doc/ref/macros/mend_top.sdf010064400042570001753000000011320622022216000172130ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: end_topic Macro H2: Interface !macro_interface "end_topic" H2: Description This macro marks the end of a topic. H2: Examples H2: Limitations & Future Directions Hopefully, this macro will disappear real soon now. sdf-2.001/doc/ref/macros/mmacro.sdf010064400042570001753000000010720622022216000166670ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: macro Macro H2: Interface !macro_interface "macro" H2: Description The {{macro}} macro marks the beginning of a user-defined macro. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mgetdoc.sdf010064400042570001753000000011430622022216000170320ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: getdoc Macro H2: Interface !macro_interface "getdoc" H2: Description The {{getdoc}} macro extracts embedded documentation from source code using the {{CMD:sdfget}} command. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mexport.sdf010064400042570001753000000013360622022216000171120ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: export Macro H2: Interface !macro_interface "export" H2: Description The {{export}} macro ensures that the target documentation system receives the value of the nominated variable each time it changes. If the variable is currently defined, the target system is immediately notified of its value. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/msubsect.sdf010064400042570001753000000016530635011350400172500ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 30-Aug-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: subsections Macro H2: Interface !macro_interface "subsections" H2: Description The {{subsections}} macro specifies the subsections in a topic. H2: Examples Typical usage is: E: H1: MyApp E: !subsections "Purpose,Usage,Description,Examples" In this case, the {{MAC:subsections}} macro changes the {{id}} generated for the headings listed to: E: MyApp - {{heading}} For HTML, it will also generate a line of jumps to the headings. H2: Limitations & Future Directions {{html}} is currently the only target for which a jump line is generated. sdf-2.001/doc/ref/macros/mblock.sdf010064400042570001753000000011510622022216000166560ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: block Macro H2: Interface !macro_interface "block" H2: Description The {{block}} macro marks the beginning of a "block" of text. The block is ended by the {{MAC:endblock}} macro. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mgetcli.sdf010064400042570001753000000011530622022216000170350ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: getcli Macro H2: Interface !macro_interface "getcli" H2: Description The {{getcli}} macro extracts the command-line interface for a script following SDF's command-line conventions. H2: Examples #H2: Limitations & Future Directions under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: getcli Macro H2: Interface !macro_interface "getcli" H2: Description The {{getcli}} macro extracts the command-line interface sdf-2.001/doc/ref/macros/mbuild_t.sdf010064400042570001753000000011300622022216000172030ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: build_title Macro H2: Interface !macro_interface "build_title" H2: Description The {{build_title}} macro create a title page or section for documents and papers. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mdefine.sdf010064400042570001753000000010540622022216000170200ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: define Macro H2: Interface !macro_interface "define" H2: Description The {{define}} macro sets a variable to a value. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/minit.sdf010064400042570001753000000011670622022216000165360ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: init Macro H2: Interface !macro_interface "init" H2: Description The {{init}} macro is used on the top line of a document to initialise variables before the configuration libraries are loaded. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mcontinu.sdf010064400042570001753000000025770635674110000172720ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 12-Feb-97 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: continued Macro H2: Interface !macro_interface "continued"; "id" H2: Description The {{continued}} macro continues a heading from a previous page, provided the target format is page-based, i.e. nothing is output for html or hlp formats. The first parameter is the heading style to repeat. The second parameter is the suffix to append the text from the repeated heading. The default suffix is ", E<2{>N:ContinuedE<2}>". H2: Examples A typical example is: !block example H2: Solving world peace H3: Procedure The steps are given below. ... !continued 'H2' !continued 'H3'; ' {{N:(Continued)}}' Some more procedure text. !endblock In the example above, the macros effectively produce: !block verbatim H2[notoc;noid;continued] Solving world peace, {{Continued}} H3[notoc;noid;continued] Procedure {{(N:Continued)}} !endblock Note: This macro does not cause a new page. Typically, a rule (i.e. event processing) is used to trigger new pages at the necessary paragraph styles. #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mclass.sdf010064400042570001753000000010520622022216000166710ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: class Macro H2: Interface !macro_interface "class" H2: Description The {{class}} macro declares a class of objects. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mdefault.sdf010064400042570001753000000011100622022216000172030ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: default Macro H2: Interface !macro_interface "default" H2: Description The {{default}} macro sets a variable if it does not already have a value. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mslide_d.sdf010064400042570001753000000011060622022216000171670ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: slide_down Macro H2: Interface !macro_interface "slide_down" H2: Description The {{slide_down}} macro moves subsequent headings down one level. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mimport.sdf010064400042570001753000000016620635016543600171250ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: import Macro H2: Interface !macro_interface "import" H2: Description The {{import}} macro imports a figure. If the filename is not given an extension, the extension is found using the search rules below. !block table When_generating The_search_order_is PostScript epsi, eps, wmf, mif, gif HTML jpeg, jpg, png, gif Windows Help bmp !endblock The {{title}} argument can be used to add a figure title. See {{Figures}} within the {{DOC:SDF User Guide}} for further details. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mon.sdf010064400042570001753000000017560632212052000162130ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: on Macro H2: Interface !macro_interface "on"; "id" H2: Description The {{on}} macro specifies a rule to execute on certain events. # Topics mode doesn't currently handle cross-document section jumps # so we need to explicitly specify the jump. :-( !if $var{'HTML_TOPICS_MODE'} || $var{'HTML_SUBTOPICS_MODE'} See {{A[jump=$var{'SDF_ROOT'}.'user/in_event.html'] Event Processing}} in the {{DOC:SDF User Guide}} for further details. !else See {{SECT[doc='SDF User Guide'] Event Processing}} in the {{DOC:SDF User Guide}} for further details. !endif H2: Examples To be completed ... #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/minsert.sdf010064400042570001753000000021740645304104600171100ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: insert Macro H2: Interface !macro_interface "insert" H2: Description The {{insert}} macro is used to insert the output of {{macro}} into an SDF document. {{missing}} determines the action if the macro isn't found: * {{ok}} - do nothing * {{warning}} - report a warning * {{error}} - report an error. Note: In early versions of SDF, this macro was used to call user-defined macros. In SDF 2.000 or later, user-defined macros can be called using the same syntax as built-in macros. H2: Examples !block example; lang='sdf' # Insert the text of macro XXX if it's defined !insert 'XXX' # Insert the text of macro XXX; output an error if it's not defined !insert 'XXX'; 'error' # Same as the previous example !XXX !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mif.sdf010064400042570001753000000010670622022216000161700ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: if Macro H2: Interface !macro_interface "if" H2: Description The {{if}} macro marks the beginning of a conditional text section. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/moff.sdf010064400042570001753000000017170632212052000163460ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: off Macro H2: Interface !macro_interface "off" H2: Description The {{off}} macro disables an event. # Topics mode doesn't currently handle cross-document section jumps # so we need to explicitly specify the jump. :-( !if $var{'HTML_TOPICS_MODE'} || $var{'HTML_SUBTOPICS_MODE'} See {{A[jump=$var{'SDF_ROOT'}.'user/in_event.html'] Event Processing}} in the {{DOC:SDF User Guide}} for further details. !else See {{SECT[doc='SDF User Guide'] Event Processing}} in the {{DOC:SDF User Guide}} for further details. !endif H2: Examples To be completed ... #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mslide_u.sdf010064400042570001753000000010760622022216000172160ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: slide_up Macro H2: Interface !macro_interface "slide_up" H2: Description The {{slide_up}} macro moves subsequent headings up one level. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mendif.sdf010064400042570001753000000010720622022216000166530ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: endif Macro H2: Interface !macro_interface "endif" H2: Description The {{endif}} macro marks the end of a conditional text section. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/muse.sdf010064400042570001753000000010410622022216000163560ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: use Macro H2: Interface !macro_interface "use" H2: Description The {{use}} macro loads a (library) module. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mendbloc.sdf010064400042570001753000000011530622022216000171740ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: endblock Macro H2: Interface !macro_interface "endblock" H2: Description The {{endblock}} macro marks the end of a "block" of text. The block is started by the {{MAC:block}} macro. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mcatalog.sdf010064400042570001753000000027760645640727400172420ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: catalog Macro H2: Interface !macro_interface "catalog" H2: Description The {{catalog}} macro build a catalog from objects already loaded. The {{class}} parameter specifies the class name. As it is defined as a symbol rather than a string type, the name is given without quotes and it is space-separated from the following parameter. The {{mask}} parameter can be used to filter the objects as shown below: !block table Mask Description empty string no filtering - display all objects cited display just the cited objects abc.* display the objects with (short) names matching the pattern, \ i.e. names beginning with abc xyz:abc display the objects where attribute {{xyz}} matches the \ pattern, i.e. {{xyz}} is exactly equal to {{abc}} !endblock Remaining parameters are passed through to the class filter. H2: Examples Display some interesting attributes of {{CLASS:references}} with a Status of 'Review': !block example !catalog references 'Status:Review'; compact; \ columns="PDF,2:Reference,DOC:Document,Version" !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mexecute.sdf010064400042570001753000000012470622022216000172340ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: execute Macro H2: Interface !macro_interface "execute" H2: Description The {{execute}} macro executes the nominated command and includes the output within the document. A filter may optionally be applied to the output before it is included. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/melse.sdf010064400042570001753000000010650622022216000165200ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: else Macro H2: Interface !macro_interface "else" H2: Description The {{else}} macro delimits sections within conditional text. H2: Examples #H2: Limitations & Future Directions an Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: else Macro H2: Interface !macro_interface "else" H2: Description The {{else}} macro delimits sections within conditional text.sdf-2.001/doc/ref/macros/melseif.sdf010064400042570001753000000011640622022216000170370ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: elseif Macro H2: Interface !macro_interface "elseif" H2: Description The {{elseif}} macro delimits sections within conditional text. It is identical in operation to the {{MAC:elsif}} macro. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/moutput.sdf010064400042570001753000000016370622022216200171370ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: output Macro H2: Interface !macro_interface "output" H2: Description The {{output}} macro dynamically changes the output file being used. It can be used in the following ways: ^ output "filename" + output ">filename" + output "-" The first form changes the output file to be filename. The second form appends the output onto the filename given. The third form closes the (current) output file, if any. H2: Examples To be completed... H2: Limitations & Future Directions {{html}} is the only target which currently supports this macro. sdf-2.001/doc/ref/macros/mscript.sdf010064400042570001753000000010650622022216000170740ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: script Macro H2: Interface !macro_interface "script" H2: Description The {{script}} macro executes a single line of Perl code. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mjumps.sdf010064400042570001753000000013720661461775300167560ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1998, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 25-Oct-98 ianc SDF 2.000beta1 # ----------------------------------------------------------------------- # H1: jumps Macro H2: Interface !macro_interface "jumps" H2: Description The {{jumps}} macro generates lines of jumps to headings. H2: Examples Typical usage is: E: !jumps "Purpose,Usage,,Description,Examples" This will create two jump lines: the first has {{Purpose}} and {{Usage}}; the second has {{Description}} and {{Examples}}. #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mline.sdf010064400042570001753000000011260622022216000165150ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: line Macro H2: Interface !macro_interface "line" H2: Description The line macro can be used to change the line number output within error and warning messages. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/minherit.sdf010064400042570001753000000012420622022216000172270ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: inherit Macro H2: Interface !macro_interface "inherit" H2: Description The {{inherit}} macro is used to inherit configuration information from a library. Typically, a library inherits from another library and then adds some new things. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mendmacr.sdf010064400042570001753000000010750622022216000172020ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: endmacro Macro H2: Interface !macro_interface "endmacro" H2: Description The {{endmacro}} macro marks the end of a user-defined macro. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mundef.sdf010064400042570001753000000010430622022216000166650ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: undef Macro H2: Interface !macro_interface "undef" H2: Description The {{undef}} macro undefines a variable. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/melsif.sdf010064400042570001753000000011620622022216000166700ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: elsif Macro H2: Interface !macro_interface "elsif" H2: Description The {{elsif}} macro delimits sections within conditional text. It is identical in operation to the {{MAC:elseif}} macro. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mmessage.sdf010064400042570001753000000011040622022216000172060ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: message Macro H2: Interface !macro_interface "message" H2: Description The {{message}} macro can be used to output messages during execution. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mgetcode.sdf010064400042570001753000000011060622022216000171760ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: getcode Macro H2: Interface !macro_interface "getcode" H2: Description The {{getcode}} macro extracts the "non-documentation" from source code. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/minclude.sdf010064400042570001753000000011110622022216000172030ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: include Macro H2: Interface !macro_interface "include" H2: Description The {{include}} macro is used to include another file into an SDF document. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/macros/mrestric.sdf010064400042570001753000000017160647527130400172660ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: restrict Macro H2: Interface !macro_interface "restrict" H2: Description The {{restrict}} macro declares a restricted family of variables. If a variable begins with a restricted prefix, then it must be declared via the {{FILT:define}} filter. This feature aims to catch errors caused by authors using a bad variable name. For example, if an author types E: !define DOC_NAMe "My Document" but meant to type E: !define DOC_NAME "My Document" then an error will be raised as DOC_NAMe is an unknown variable within the DOC family. H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/fcomment.html010064400042570001753000000030530672242517200161450ustar00iancmtr00000400000236 SDF 2.001: SDF Reference: comment Filter

5.9. comment Filter


Interface

The general syntax is:

  !block comment[; parameters]
  ...
  !endblock

See Understanding Filter Interfaces, if necessary.


Description

The comment filter is used to temporarily ignore a block of text.


Examples

!block comment
Ignore me
!endblock
sdf-2.001/doc/ref/fabout.html010064400042570001753000000045030672242515300156150ustar00iancmtr00000400000236 SDF 2.001: SDF Reference: about Filter

5.2. about Filter


Interface

The general syntax is:

  !block about
  ...
  !endblock

See Understanding Filter Interfaces, if necessary.


Description

The about filter is used when including a topic as an "about" section within a document. Typically, this implies:

  • the headings are converted to plain headings and slid down one level
  • the headings (except those initially at level 1) are removed from the table of contents.

Examples

A typical book might look like this:

!init OPT_STYLE="manual"

!define DOC_NAME "A Sample Book"
!build_title

!include "myabout.sdf"; about
!include "chapter1.sdf"
!include "chapter2.sdf"
!include "chapter3.sdf"
!include "appendx1.sdf"; appendix

A typical about topic looks like this:

H1: About this manual

H2: Purpose

This manual provides information on ...

H2: Scope

This manual contains information on ...
sdf-2.001/doc/ref/mgetcli.html010064400042570001753000000027500672242536300157660ustar00iancmtr00000400000236 SDF 2.001: SDF Reference: getcli Macro

6.19. getcli Macro


Interface

The general syntax is:

  !getcli

See Understanding Macro Interfaces, if necessary.


Description

The getcli macro extracts the command-line interface for a script following SDF's command-line conventions.


Examples

sdf-2.001/doc/ref/filters/004075500042570001753000000000000672243774700151345ustar00iancmtr00000400000236sdf-2.001/doc/ref/filters/fsection.sdf010064400042570001753000000017060645236431400174320ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: sections Filter H2: Interface !filter_interface "sections" H2: Description The {{sections}} filter is used to create section jumps for html and hlp outputs: for these formats, the text of each paragraph (excluding punctuation) is assumed to be the title of a section within this document. For other outputs, the text is unchanged. H2: Examples !block example; lang='sdf' There are lots of new things in this version including: !block sections . Topics mode . HTML headers and footers !endblock Further details are given below. !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fappendi.sdf010064400042570001753000000016340645234334400174060ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: appendix Filter H2: Interface !filter_interface "appendix" H2: Description The {{appendix}} filter is used when including a topic as an "appendix" section within a document, i.e. normal headings are converted to appendix headings. H2: Examples A typical book might look like this: !block example; lang='sdf' !init OPT_STYLE="manual" !define DOC_NAME "A Sample Book" !build_title !include "chapter1.sdf" !include "chapter2.sdf" !include "chapter3.sdf" !include "appendx1.sdf"; appendix !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fquote.sdf010064400042570001753000000013150622022216200171020ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: quote Filter H2: Interface !filter_interface "quote" H2: Description The {{quote}} filter is used to format a quotation. This typically implies: * for [[PostScript]], the text is italics and indented from both margins * for [[HTML]], the text is given an appropriate style. #H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fget.sdf010075500042570001753000000011530672210610600165350ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1999, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 24-May-99 ianc SDF 2.001 # ----------------------------------------------------------------------- # H1: get Filter H2: Interface !filter_interface "get" H2: Description The {{get}} filter is used to extract embedded documentation. The parameters map to the options for {{CMD:sdfget}}. #H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/flangdef.sdf010064400042570001753000000013600632212045200173470ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: langdefs Filter H2: Interface !filter_interface "langdefs" H2: Description The {{langdefs}} filter is used to configure programming language properties used by SDF's pretty-printing support. The contents is one or more {{CMD:vgrind}} definitions. H2: Examples See {{FILE:langdefs.sdm}} within SDF's {{FILE:stdlib}} directory. #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fend.sdf010064400042570001753000000017270645234404000165310ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: end Filter H2: Interface !filter_interface "end" H2: Description The {{end}} filter is used to add a section of SDF onto the end of the document. This is particularly useful in configuration files when you want to: * load a "exit" configuration module * provide defaults for variables not provided by authors within a document. When several sections are added to the end using this macro, the sections are processed in a first-in-last-out order. H2: Examples !block example; lang='sdf' !block end Line: N[align=Center] END OF DOCUMENT !endblock !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/ftopics.sdf010064400042570001753000000032140645236352000172610ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: topics Filter H2: Interface !filter_interface "topics" H2: Description The {{topics}} filter is used to include a set of sub-topics into a document. For [[PostScript]], this implies that the heading levels on topics included as sub-topics are adjusted accordingly. For [[HTML]] and Windows help files, this implies that hypertext jumps are inserted to the topics. This filter expects a table of data in {{FMT:TBL}} format. The only field typically provided is {{Topic}} - the name of the file containing the topic, excluding the {{.sdf}} extension. The other fields are used by SDF internally during the generation of HTML topics. The {{intro}} parameter can be used to specify SDF text to be output before the hypertext jumps. This text is not output for formats where the topics are simply included, e.g. PostScript. The {{noslide}} parameter stops the heading levels of the topics being slid down. The {{data}} parameter is used to specify that the table is topics data and no output should be generated. This parameter is used by SDF internally during the generation of HTML topics. H2: Examples !block example; lang='sdf' The subroutines are documented below. !block topics; intro='H2: Subroutines' Topic mysub1 mysub2 !endblock !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fnote.sdf010064400042570001753000000021370635016607000167260ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: note Filter H2: Interface !filter_interface "note" H2: Description The {{note}} filter is used to specify a note. The {{label}} parameter can be used to specify a label. The default label is "Note:". H2: Examples !block example !block note; label='Example:' And some text inside a multi-line note !endblock !endblock The result is: !block note; label='Example:' And some text inside a multi-line note !endblock If you want the label to have a line to itself, leave the first line blank like this: !block example !block note And some more text inside another multi-line note !endblock !endblock The result is: !block note And some more text inside another multi-line note !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fbox.sdf010064400042570001753000000016070635016671000165530ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: box Filter H2: Interface !filter_interface "box" H2: Description The {{box}} filter is used to box a region of text. The {{lines}} parameter can be used to treat each line as a line within a paragraph - without this, the contents is treated as normal SDF. The other parameters have the same meanings as they do for the {{FILT:table}} filter. #H2: Examples H2: Limitations & Future Directions Some of the output drivers (e.g. the MIF driver) do not support nested tables, so tables within the box may be ignored. sdf-2.001/doc/ref/filters/fpod.sdf010064400042570001753000000021170645235004000165340ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1997, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 24-May-97 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: pod Filter H2: Interface !filter_interface "pod" H2: Description The {{pod}} filter is used to nest POD text within an SDF document. The {{main}} parameter is used to specify that the first paragraph after "=head1 NAME" is the document name. This parameter is used internally by the {{CMD:sdf}} program when it needs to convert a POD document to another format. H2: Examples Some examples are: !block example; lang='sdf' # Insert some pod !block pod A normal POD paragraph. And some verbatim text. !endblock # Get pod from a file !include "perlre.pod"; pod # Get pod from standard output !execute "getpod 'hello.c'"; pod !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fdatestr.sdf010064400042570001753000000023310661402010700174140ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1998, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 23-Oct-98 ianc SDF 2.001 # ----------------------------------------------------------------------- # H1: datestrings Filter H2: Interface !filter_interface "datestrings" H2: Description The {{datestrings}} filter can be used to change the strings used within a date. The fields within the table are: * {{Symbol}} - the matching symbol name (without the $) from the {{SUBR:FormatTime}} subroutine * {{Values}} - a Perl string containing a whitespace-separated list of values. H2: Examples !block verbatim !block datestrings Symbol Values month "January February March April May June July August September October November December" smonth "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" weekday "Monday Tuesday Wednesday Thursday Friday Saturday Sunday" sweekday "Mon Tue Wed Thu Fri Sat Sun" ampm "am pm" AMPM "AM PM" !endblock !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fsdf.sdf010064400042570001753000000015350622022216000165230ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: sdf Filter H2: Interface !filter_interface "sdf" H2: Description The {{sdf}} filter can be used to apply an arbitrary set of paragraph and/or phrase attributes to a section of text. H2: Examples To add change bars to a section of text, the sdf filter can be used in combination with the {{changed}} attribute as follows: !block example; lang='sdf' !block sdf; changed This text has been changed. And so has this. !endblock !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/faddress.sdf010064400042570001753000000015300622022216200173710ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: address Filter H2: Interface !filter_interface "address" H2: Description The {{address}} filter is used to format an address. This typically implies: * for [[PostScript]], the paragraphs have no space between them * for [[HTML]], the paragraphs are given ADDRESS tags. H2: Examples A typical letter starts like this: !block example; lang='sdf' !block address Mr I.M. Lucky 13 Horseshoe Drive Brisbane Q 4001 !endblock !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fverbati.sdf010064400042570001753000000026630645231733000174210ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: verbatim Filter H2: Interface !filter_interface "verbatim" H2: Description The {{verbatim}} filter is used to specify a section of fixed-width text. Unlike the {{FILT:verbatim}} filter, embedded SDF symbols (like E<2{>) are treated like normal text. The {{skipheader}} parameter is useful when an external file is being included as an example, but you do not want the header comment in the example. The {{lang}} parameter, if any, is used to determine the commenting conventions. If no language is specified, comments are assumed to start with a # and be terminated by the end of line. The {{wide}} parameter can be used to ensure that at least 80 characters are output on a line before it is wrapped. The {{listitem}} parameter can be used to specify that this block of text is part of a list. The value is the logical indent of the list (e.g. 1, 2, etc.). H2: Examples !block example; lang='sdf' # Include myfile.c but exclude the copyright, revision history, etc. !include "myfile.c"; verbatim; skipheader; lang='c' !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fscript.sdf010064400042570001753000000022000622022216000172410ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: script Filter H2: Interface !filter_interface "script" H2: Description The {{script}} filter can be used to embed arbitrary Perl source code within an SDF document. This is useful for many things including: * declaring Perl subroutines implementing SDF filters and macros * accessing databases * updating log files. H2: Examples !block example; lang='sdf' !block script printf STDERR "Hello world!\n"; !endblock !endblock H2: Limitations & Future Directions As arbitrary sections of [[Perl]] can be included and executed, the code can potentially cause harm. At the moment, the ability to update external files from within an SDF document is seen as a {{feature}}. However, a version of SDF which restricts the embedded Perl to "safe" operations would be nice. sdf-2.001/doc/ref/filters/fdefault.sdf010064400042570001753000000021660622022216000173740ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: default Filter H2: Interface !filter_interface "default" H2: Description The {{default}} filter is a convenient way of calling the {{MAC:default}} macro for several variables. The {{family}} parameter is often used to specify a common prefix. The {{export}} parameter can be used to export the variables to the target document system. See the {{MAC:export}} macro for further details on variable exporting. H2: Examples !block example; lang='sdf' !block default Name Value COMPANY_NAME ACME Mining COMPANY_PHONE 1234 5678 !endblock !endblock A simpler version is: !block example; lang='sdf' !block default; family="COMPANY" Name Value NAME ACME Mining PHONE 1234 5678 !endblock !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fascii_g.sdf010064400042570001753000000011340622022216200173420ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: ascii_graphic Filter H2: Interface !filter_interface "ascii_graphic" H2: Description The {{ascii_graphic}} filter is used to specify a section of text as a diagram. #H2: Examples #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fnameval.sdf010064400042570001753000000017430645234554200174140ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 03-Jun-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: namevalues Filter H2: Interface !filter_interface "namevalues" H2: Description The {{namevalues}} filter is used to format a table of name-value pairs. Each name is output in bold. For PostScript output, the names are placed in the sidehead. H2: Examples !block example; lang='sdf' !block namevalues Name Value Description: Find the maximum of two numbers Module: general Author: Joe Bloggs !endblock !endblock The result is: !block namevalues Name Value Description: Find the maximum of two numbers Module: general Author: Joe Bloggs !endblock sdf-2.001/doc/ref/filters/ffront.sdf010064400042570001753000000013160645207527200171150ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: front Filter H2: Interface !filter_interface "front" H2: Description The {{front}} filter includes text as is. It is provided for backwards compatibility with older versions of SDF when the "front" section of a FrameMaker book needed to be placed into a separate SDF file. H2: Examples None. #H2: Limitations & Future Directions ------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: front Filter H2: Interface !filter_interface "front" H2: Description The {{front}} filter includes text as is. It is provided sdf-2.001/doc/ref/filters/fplain.sdf010064400042570001753000000016120645234334600170670ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: plain Filter H2: Interface !filter_interface "plain" H2: Description The {{plain}} filter is used when including a topic as an "plain" section within a document, i.e. normal headings are converted to plain headings. H2: Examples A typical book might look like this: !block example; lang='sdf' !init OPT_STYLE="manual" !define DOC_NAME "A Sample Book" !build_title !include "chapter1.sdf" !include "chapter2.sdf" !include "chapter3.sdf" !include "glossary.sdf"; plain !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fsimple.sdf010064400042570001753000000024050645236411400172520ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1997, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 01-May-97 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: simple Filter H2: Interface !block example !block {{B:simple}} [;{{parameters}}] ... !endblock !endblock The parameters are: !block table Name Description pre Perl code to execute before the block exec executed for each line with $line containing the text line post Perl code to execute after the block !endblock H2: Description The {{simple}} filter is typically used as a building block for other filters. It provides a simple way of specifying the before (pre), per-line (exec) and after (post) actions. Note: As creating new filters is not something that the average SDF users does, this filter is really provided to make life easier for advanced SDF users and SDF administrators. H2: Examples E:!on filter "testcases";; \ E: $name='simple'; \ E: $params.=';pre="!testcaseStart"'; \ E: $params.=';post="!testcaseEnd"' #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fcomment.sdf010064400042570001753000000012160622022216000174050ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: comment Filter H2: Interface !filter_interface "comment" H2: Description The {{comment}} filter is used to temporarily ignore a block of text. H2: Examples !block example; lang='sdf' !block comment Ignore me !endblock !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fabstrac.sdf010064400042570001753000000021030645234317400173760ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: abstract Filter H2: Interface !filter_interface "abstract" H2: Description The {{abstract}} filter is used to specify an abstract for a technical paper. This typically implies: * for [[PostScript]], the text is italics and indented from both margins * for [[HTML]], the text is given an appropriate heading. H2: Examples A typical paper starts like this: !block example; lang='sdf' !init OPT_STYLE="paper" !define DOC_NAME "Internet Management Tools" !define DOC_AUTHOR "I. M. Wise" !build_title !block abstract The internet is out of control. This paper ... # more paragraphs go here !endblock H1: Introduction # The interesting stuff goes here !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fexample.sdf010064400042570001753000000037010647527143200174210ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: example Filter H2: Interface !filter_interface "example" H2: Description The {{example}} filter is used to specify a section of fixed-width text. Unlike the {{FILT:verbatim}} filter, embedded SDF symbols (like E<2{>) are relevant. The {{skipheader}} parameter is useful when an external file is being included as an example, but you do not want the header comment in the example. The {{lang}} parameter, if any, is used to determine the commenting conventions. If no language is specified, comments are assumed to start with a # and be terminated by the end of line. The {{lang}} parameter can be used to pretty-print programming languages. In practice, this means: * comments are output in italics * keywords are output in bold. Note: The {{FILT:langdefs}} filter is used to configure the information the pretty-printing feature needs to know. A large number of languages are predefined in the {{FILE:stdlib/langdefs.sdm}} file. The {{wide}} parameter can be used to ensure that at least 80 characters are output on a line before it is wrapped. The {{listitem}} parameter can be used to specify that this block of text is part of a list. The value is the logical indent of the list (e.g. 1, 2, etc.). The {{pure}} parameter can be used to escape special SDF symbols (like E<2{>) embedded within the text. H2: Examples !block example; lang='sdf' # Include myfile.c but exclude the copyright, revision history, etc. !include "myfile.c"; example; skipheader; lang='c' # Pretty-print the same file !include "myfile.c"; example; wide; lang='c' !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/ftable.sdf010064400042570001753000000075460645714702400170670ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: table Filter H2: Interface !filter_interface "table" H2: Description The {{table}} filter specifies a table in {{FMT:TBL}} format. A brief description of each parameter is given below. A tutorial-style introduction to SDF's table features is also provided in the {{DOC:SDF User Guide}}. !block table Parameter Description align alignment of table: one of Left, Center, Right, Inner, Outer bgcolor background colour for a table (HTML only) bmargin default bottom margin for table cells (MIF only) cellpadding padding size for table cells (HTML only) cellspacing spacing size between table cells (HTML only) colaligns a comma-separated list of horizontal alignments \ values (Left, Center, Right) for columns; \ alternatively, a single word containing the letters L, C and R coltags a comma-separated list of phrase styles to apply to columns colvaligns a comma-separated list of vertical alignments \ values (Top, Middle, Bottom, Baseline) for columns; \ alternatively, a single word containing the letters T, M, B and L delete a comma-separated list of columns to delete footings the number of footing rows at the end of the table format a comma-separated list of column width specifications; \ alternatively, a single number where each digit represents \ 10% of the space available to the table groups pattern of group-style rows (default is /:$/) headings the number of heading rows at the top of the table landscape display the table in landscape mode (MIF only) listitem the list indent level (e.g. 1) of this table lmargin default left margin for table cells (MIF only) narrow if set, the table will only be as wide as required; \ otherwise the table will span the available space niceheadings set to 0 to disable _ to space conversion in headings nocalcs set to 0 to disable calculation processing within a table noheadings suppress headings in output objects alias for coltags (coltags is preferred) oncell Perl code to execute for each cell (internal use only!) parseline column headings parsing line (if not the first row in the text) placement vertical placement of table: one of Float, Pagetop, Columntop, \ Lefttop, Righttop (MIF only) rmargin default right margin for table cells (MIF only) select a comma-separated list of columns to display sort a comma-separated list of columns to sort the data rows by style overall look of the table tags alias for coltags (coltags is preferred) title table caption tmargin default top margin for table cells (MIF only) type alias for style (style is preferred) where an expression to filter the data rows with wide table straddles the side head area of the page wrap the number of data rows to display in a physical row !endblock H2: Examples A typical table is: !block example; lang='sdf' !block table; format=55; style="grid"; groups; title="Diary" Time_of_day Appointment Morning: 10:00 Dentist 12:00 Lunch with friends Afternoon: 15:00 Meeting on SDF !endblock !endblock The result is: !block table; format=55; style="grid"; groups; title="Diary" Time_of_day Appointment Morning: 10:00 Dentist 12:00 Lunch with friends Afternoon: 15:00 Meeting on SDF !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fnofill.sdf010064400042570001753000000020230633203111000172200ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1997, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 01-May-97 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: nofill Filter H2: Interface !filter_interface "nofill" H2: Description The {{nofill}} filter is used to format a set of lines, i.e. lines are separated by newline characters. Note: The {{FILT:address}} filter may be a better choice that nofill in certain cases. Unlike nofill, address is mapped to ADDRESS tags when HTML is generated. (It's then up to the browser to decide how the address is formatted.) H2: Examples !block example; lang='sdf' !block nofill Mr I.M. Lucky B.Sc. (Computing) B.Fun. (Eating) !endblock !endblock The output is: !block nofill Mr I.M. Lucky B.Sc. (Computing) B.Fun. (Eating) !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fhlp_hea.sdf010064400042570001753000000012170645234420000173530ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: hlp_header Filter H2: Interface !filter_interface "hlp_header" H2: Description The {{hlp_header}} filter is used to define a table of jumps within the non-scrolling region of a Windows help topic. #H2: Examples #To be completed. #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fchanged.sdf010064400042570001753000000014470645234353600173640ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: changed Filter H2: Interface !filter_interface "changed" H2: Description The {{changed}} filter is used to mark a section of text as changed. H2: Examples To add change bars to a section of text: !block example; lang='sdf' !block changed This text has been changed. And so has this. !endblock !endblock H2: Limitations & Future Directions At the moment, this filter only works when generating FrameMaker documents. sdf-2.001/doc/ref/filters/finline.sdf010064400042570001753000000022230636063172200172350ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: inline Filter H2: Interface !filter_interface "inline" H2: Description The {{inline}} filter is used to pass a section of text directly to a target documentation system. The {{target}} parameter is used to specify which target system the nominated text is to be passed to. The default target is {{html}}. The {{expand}} parameter can be used to request expansion of SDF expressions (enclosed in E<2[> and E<2]>) within the text. H2: Examples To embed [[HTML]] within an SDF document: !block example; lang='sdf' !block inline add arbitrary HTML here ... !endblock !endblock SDF expressions can be expand like this: !block example; lang='sdf' !define VERB "is" ... !block inline; expand

This HTML [[VERB]] expanded. !endblock !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/ftitle.sdf010064400042570001753000000023270645236701200171050ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: title Filter H2: Interface !filter_interface "title" H2: Description The {{title}} filter is used to build the title block for memos, faxes, etc. The {{type}} parameter can be used to override the document type. For PostScript output, the value is displayed in a box above the rest of the title. The {{toc}} parameter is used to request a table of contents. The value is the level of headings to include in the contents. The {{format}} attribute is used to fine tune the layout of the columns within the table for format where a table is used (e.g. plain text). H2: Examples !block example; lang='sdf' !block title Name Value Date: [[DATE:DOC_MODIFIED]] To: Joe Bloggs, Sue Brown, Maree Jones Copy: David Smith From: Neil Armstrong Subject: Solar System Information Ref. No: XY.002/GUI/96 !endblock !endblock sdf-2.001/doc/ref/filters/fdefine.sdf010064400042570001753000000021600622022216000171740ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: define Filter H2: Interface !filter_interface "define" H2: Description The {{define}} filter is a convenient way of calling the {{MAC:define}} macro for several variables. The {{family}} parameter is often used to specify a common prefix. The {{export}} parameter can be used to export the variables to the target document system. See the {{MAC:export}} macro for further details on variable exporting. H2: Examples !block example; lang='sdf' !block define Name Value COMPANY_NAME ACME Mining COMPANY_PHONE 1234 5678 !endblock !endblock A simpler version is: !block example; lang='sdf' !block define; family="COMPANY" Name Value NAME ACME Mining PHONE 1234 5678 !endblock !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fhlp_win.sdf010064400042570001753000000012000645234423600174140ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: hlp_window Filter H2: Interface !filter_interface "hlp_window" H2: Description The {{hlp_window}} filter is used to define the contents of a popup window for [[Windows]] help files. #H2: Examples #To be completed. #H2: Limitations & Future Directions sdf-2.001/doc/ref/filters/fabout.sdf010064400042570001753000000024010645207341400170670ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 16-May-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: about Filter H2: Interface !filter_interface "about" H2: Description The {{about}} filter is used when including a topic as an "about" section within a document. Typically, this implies: * the headings are converted to plain headings and slid down one level * the headings (except those initially at level 1) are removed from the table of contents. H2: Examples A typical book might look like this: !block example; lang='sdf' !init OPT_STYLE="manual" !define DOC_NAME "A Sample Book" !build_title !include "myabout.sdf"; about !include "chapter1.sdf" !include "chapter2.sdf" !include "chapter3.sdf" !include "appendx1.sdf"; appendix !endblock A typical about topic looks like this: !block example; lang='sdf' H1: About this manual H2: Purpose This manual provides information on ... H2: Scope This manual contains information on ... !endblock #H2: Limitations & Future Directions sdf-2.001/doc/ref/sdfcli.sdf010064400042570001753000000000750630252073000154000ustar00iancmtr00000400000236# Extract the documentation from the script !getdoc "sdfcli" sdf-2.001/doc/ref/cproduct.html010064400042570001753000000043360672242510400161600ustar00iancmtr00000400000236 SDF 2.001: SDF Reference: products Class

1.3. products Class


Interface

The general syntax is:

  !block products[; parameters]
  table of objects
  !endblock

The object attributes are:

Field Category Rule
Name mandatory  
Jump optional  

See Understanding Class Interfaces, if necessary.


Description

The products filter is used to declare and/or format objects in the products class. The attributes supported are:

Attribute Description
Name the product name
Jump the product URL, if any

Examples

See the objects.sdm file within SDF's stdlib directory.

sdf-2.001/doc/ref/in_prog.sdf010064400042570001753000000037110647625432600156120ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 29-Feb-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: Programs H2: Overview The programs available are summarised below. !block table; tags="CMD" Name Purpose sdf convert [[SDF]] files to other formats sdfapi extract the {{Application Programming Interface}} from source code sdfbatch generate [[FrameMaker]] batch files sdfcli extract the {{Command Line Interface}} from a utility sdfget extract documentation embedded in source code sdftest execute SDF regression tests sdngen build an SDF tuning module from a FrameMaker template #fm2ps convert FrameMaker files to PostScript (a wrapper for {{CMD:sdfbatch}}) #pod2sdf convert POD to SDF #poddiff compare POD files and report differences prn2ps convert Windows PostScript to Unix PostScript !endblock {{CMD:sdf}} is typically invoked as follows: E: sdf -2{{format}} [options] files Supported {{format}} values include the following: !block table Format Description ps a [[PostScript]] document html a [[HTML]] document hlp [[Microsoft]] Windows help input files fvo a {{PRD:FrameViewer}} file txt a plain text document rtf an [[RTF]] document book a book ([[PostScript]]) !endblock Further details on the programs are provided below. # Add the script directory to the search path !path_append "../../bin" # Include the subsections, placing each at the top of a page (or after a line) !if $var{'OPT_TARGET'} eq 'txt' !on paragraph 'H2'; h2top; &PrependText("Line:") !else !on paragraph 'H2'; h2top; $attr{'top'} = 1 !endif !block topics Topic sdf sdfapi sdfbatch sdfcli sdfget sdftest sdngen prn2ps !endblock !off paragraph h2top sdf-2.001/doc/ref/fsdf.html010064400042570001753000000034000672242525300152530ustar00iancmtr00000400000236 SDF 2.001: SDF Reference: sdf Filter

5.28. sdf Filter


Interface

The general syntax is:

  !block sdf[; parameters]
  ...
  !endblock

See Understanding Filter Interfaces, if necessary.


Description

The sdf filter can be used to apply an arbitrary set of paragraph and/or phrase attributes to a section of text.


Examples

To add change bars to a section of text, the sdf filter can be used in combination with the changed attribute as follows:

!block sdf; changed
This text has been changed.

And so has this.
!endblock
sdf-2.001/doc/ref/sdfget.sdf010064400042570001753000000000750630252072600154150ustar00iancmtr00000400000236# Extract the documentation from the script !getdoc "sdfget" sdf-2.001/doc/ref/sdngen.sdf010064400042570001753000000000750647021620400154160ustar00iancmtr00000400000236# Extract the documentation from the script !getdoc "sdngen" sdf-2.001/doc/ref/sprepend.sdf010064400042570001753000000013330635011350400157520ustar00iancmtr00000400000236# $Id$ # # >>Copyright:: # Copyright (c) 1992-1996, Ian Clatworthy (ianc@mincom.com). # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 29-Feb-96 ianc SDF 2.000 # ----------------------------------------------------------------------- # H1: PrependText H2: Purpose {{S:PrependText}} is used within a paragraph event handler to prepend [[SDF]] before a paragraph. H2: Interface E: &PrependText(@sdf) H3: Description The argument is the list of [[SDF]] paragraphs to prepend. H2: Examples To prepend a line before each level 1 heading: E: !on paragraph 'H1';; &AppendText('Line:') sdf-2.001/doc/ref/sfindfil.html010064400042570001753000000057040672242565500161460ustar00iancmtr00000400000236 SDF 2.001: SDF Reference: FindFile

12.3. FindFile


Purpose

This routine is used to search for include files, imported objects, configuration modules and templates.


Interface

  $fullname = &FindFile($filename, $image);

Description

If filename is not found, fullname should be an empty string. If the file is found, the pathname of the file is returned, otherwise the empty string is returned. If image is true, a target-specific set of extensions is searched for, complete with implicit image format conversion.


Examples

The default implementation is:

sub FindFile {
    local($filename, $image) = @_;
    local($fullname);

    # Get the list of directories to search
    use Cwd;
    my @dirs = ('.');
    my $dir = $var{'DOC_DIR'};
    push(@dirs, $dir) if $dir ne cwd();
    push(@dirs, @include_path, "$'sdf_lib/stdlib", $'sdf_lib);

    # Do the search
    if ($image) {
        my $context = $var{'OPT_TARGET'};
        my @exts = @{$'SDF_IMAGE_EXTS{$context} || $'SDF_IMAGE_EXTS{'ps'}};
        return &'NameFindOrGenerate($filename, \@dirs, \@exts, $context);
    }
    else {
        return &'NameFind($filename, @dirs);
    }
}

In order to tightly integrate SDF with certain development environments, it is occasionally necessary to override this routine in a configuration module. For example:

!block script
sub FindFile {
    local($filename, $image) = @_;
    local($fullname);

    # Search using our SCM
    $fullname = &'SearchSCM($filename, $image);

    # Return result
    return $fullname;
}
!endblock
sdf-2.001/doc/ref/in_ostyl.html010064400042570001753000000110730672242550600161770ustar00iancmtr00000400000236 SDF 2.001: SDF Reference: Phrase Styles

10. Phrase Styles

The phrase styles available are summarised below.

Tag Description Sample Output
Emphasis:    
1 1st level emphasis (default) emphasis 1
2 2nd level emphasis emphasis 2
3 3rd level emphasis emphasis 3
Formatting:    
N normal some normal text
I italic some italic text
B bold some bold text
U underline some underline text
EX example some example text
Types:    
EMAIL email address ianc@mincom.com
F (or FILE) Filename myfile.sdf
SECT Section Paragraphs
URL Uniform Resource Locator http://www.mincom.com
Classes:    
DOC document title SDF User Guide
REF reference (document code) MTR-SDF-0002
ORG organisation Mincom
PRD product MIMS
Specials:    
E (or CHAR) escape (i.e. special character) ©
S spaces are non-breaking section 2.1
IMPORT name of a figure to import
URLs:    
http    
ftp    
telnet    
news    
gopher    
wais    
https    
snews    


Note: When emphasising text, it is generally better to use an emphasis style rather than a formatting style as the best way of doing so depends on the output format.

> SDF 2.001: SDF Reference: Phrase Styles