home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / fte0827.zip / config / m_sgml.fte < prev    next >
Text File  |  1999-05-16  |  6KB  |  278 lines

  1. # SGML markup by Patrick L. McGillan
  2. # feel free to change and send changes to package maintainer
  3. # basic document
  4.  
  5. sub SGML_Base {
  6.     InsertString "<!doctype debiandoc system>"; LineNew;
  7.     InsertString "<debiandoc>"; LineNew;
  8.     2:MoveRight; InsertString "<book>"; LineNew;
  9.     2:MoveRight; InsertString "<titlepag>"; LineNew;
  10.     2:MoveRight; InsertString "<title></title>"; LineNew;
  11.     2:MoveRight; InsertString "<author>"; LineNew;
  12.     2:MoveRight; InsertString "<name></name>"; LineNew;
  13.     InsertString "<email></email>"; LineNew;
  14.     2:MoveLeft; InsertString "</author>"; LineNew;
  15.     2:MoveLeft; InsertString "<version><date></version>"; LineNew;
  16.     InsertString "<abstract>"; LineNew;
  17.     InsertString "</abstract>"; LineNew;
  18.     InsertString "<copyright>"; LineNew;
  19.     2:MoveRight; InsertString "<copyrightsummary>"; LineNew;
  20.     InsertString "</copyrightsummary>"; LineNew;
  21.     2:MoveLeft; InsertString "</copyright>"; LineNew;
  22.     2:MoveLeft; InsertString "</titlepag>"; LineNew;
  23.     InsertString "<toc>"; LineNew;
  24.     InsertString "<chapt>"; LineNew;
  25.     InsertString "</chapt>"; LineNew;
  26.     2:MoveLeft; InsertString "</book>"; LineNew;
  27.     2:MoveLeft; InsertString "</debiandoc>";
  28. }
  29.  
  30. sub SGML_CH {
  31.     InsertString "<chapt id=\"\">"; LineNew;
  32.     InsertString "<heading></heading>"; LineNew;
  33.     InsertString "<p>"; SavePos; LineNew;
  34.     InsertString "</chapt>"; MoveSavedPos;
  35. }
  36.  
  37. sub SGML_SE {
  38.     InsertString "<sect>";
  39. }
  40.  
  41. sub SGML_PA {
  42.     InsertString "<p>";
  43. }
  44.  
  45. sub SGML_MRF {
  46.     InsertString "<manref name=\"\" section=\"\">;
  47. }
  48.  
  49. sub SGML_EML {
  50.     InsertString "<email>";
  51. }
  52.  
  53. sub SGML_FTPS {
  54.     InsertString "<ftpsite>";
  55. }
  56.  
  57. sub SGML_FTPP {
  58.     InsertString "<ftppath>";
  59. }
  60.  
  61. sub SGML_HTPS {
  62.     InsertString "<httpsite>";
  63. }
  64.  
  65. sub SGML_HTPP {
  66.     InsertString "<httppath>";
  67. }
  68.  
  69. sub SGML_URL {
  70.     InsertString "<url id=\"\" name=\"\">";
  71. }
  72.  
  73. sub SGML_EX {
  74.     MoveBlockStart; LineNew; InsertString "<example>"; LineNew;
  75.     MoveBlockEnd; LineNew; InsertString "</example>"; BlockUnmark;
  76. }
  77.  
  78. sub SGML_REF {
  79.     MoveBlockStart; InsertString "<ref id=\"";
  80.     MoveBlockEnd; InsertString "\">"; BlockUnmark;
  81. }
  82.  
  83. sub SGML_BO {
  84.     MoveBlockStart; InsertString "<strong>";
  85.     MoveBlockEnd; InsertString "</strong>";
  86.     4:MoveLeft; BlockUnmark;
  87. }
  88.  
  89. sub SGML_IT {
  90.     MoveBlockStart; InsertString "<em>";
  91.     MoveBlockEnd; InsertString "</em>";
  92.     4:MoveLeft; BlockUnmark;
  93. }
  94.  
  95. sub SGML_TT {
  96.     MoveBlockStart; InsertString "<tt>";
  97.     MoveBlockEnd; InsertString "</tt>";
  98.     4:MoveLeft; BlockUnmark;
  99. }
  100.  
  101. sub SGML_VAR {
  102.     InsertString "<var>";
  103. }
  104.  
  105. sub SGML_PAK {
  106.     InsertString "<package>";
  107. }
  108.  
  109. sub SGML_PGN {
  110.     InsertString "<program>";
  111. }
  112.  
  113. sub SGML_FIL {
  114.     InsertString "<file>";
  115. }
  116.  
  117. sub SGML_ORD {
  118.     InsertString "<list>"; LineNew;
  119.     InsertString "<item>"; SavePos; LineNew;
  120.     InsertString "</list>"; MoveSavedPos;
  121. }
  122.  
  123. sub SGML_NUM {
  124.     InsertString "<enumlist>"; LineNew;
  125.     InsertString "<item>"; SavePos; LineNew;
  126.     InsertString "</enumlist>"; MoveSavedPos;
  127. }
  128.  
  129. sub SGML_TAG {
  130.     InsertString "<taglist>"; LineNew;
  131.     InsertString "<item>"; SavePos; LineNew;
  132.     InsertString "</taglist>"; MoveSavedPos;
  133. }
  134.  
  135.  
  136. colorize SGML {
  137.     SyntaxParser = 'SIMPLE';
  138.     
  139.     color {
  140.         { 'Normal',     'Editor_Default' },
  141.         { 'Command',    'Markup_Punctuation' },
  142.         { 'String',     'Markup_String' },
  143.         { 'Symbol',     'Markup_Symbol' },
  144.         { 'Tag',        'Markup_Tag' },
  145.         { 'Comment',    'Markup_Comment' },
  146.         { 'Special',    'Markup_Special' },
  147.     };
  148.  
  149.     keyword "Editor_Keywords" { # should be SGML 3.2 complete
  150.         "ABSTRACT",
  151.         "ARTICLE",
  152.         "AUTHOR",
  153.         "BF",
  154.         "BOOK",
  155.         "CHAPT",
  156.         "CODE",
  157.         "COPYRIGHT",
  158.         "DATE",
  159.         "DEBIANDOC",
  160.         "DESCRIP",
  161.         "DOCTYPE",
  162.         "EM",
  163.         "EMAIL",
  164.         "ENUM",
  165.         "ENUMLIST",
  166.         "EXAMPLE",
  167.         "FOOTNOTE",
  168.         "FTPSITE",
  169.         "FTPPATH",
  170.         "HEADING",
  171.         "HTMLURL",
  172.         "HTTPSITE",
  173.         "HTTPPATH",
  174.         "IT",
  175.         "ITEM",
  176.         "ITEMIZE",
  177.         "LABEL",
  178.         "LIST",
  179.         "MANREF",
  180.         "NAME",
  181.         "P",
  182.         "PRGN",
  183.         "PUBLIC",
  184.         "QREF",
  185.         "QUOTE",
  186.         "REF",
  187.         "SECT",
  188.         "SECT1",
  189.         "SECT2",
  190.         "SECT3",
  191.         "SECT4",
  192.         "STRONG",
  193.         "SYSTEM",
  194.         "TAG",
  195.         "TAGLIST",
  196.         "TITLE",
  197.         "TITLEPAG",
  198.         "TOC",
  199.         "TSCREEN",
  200.         "TT",
  201.         "URL",
  202.         "VAR",
  203.         "VERB",
  204.         "VERSION",
  205.     };
  206.     keyword "Editor_Keywords2" {
  207.         "COMPACT",
  208.         "ID",
  209.         "NAME",
  210.         "SECTION",
  211.     };
  212.  
  213.     h_state 0 { 'Normal' }
  214.     h_trans { 4, '<', '<!--', 'Comment' }
  215.     h_trans { 8, '<', '</', 'Command' }
  216.     h_trans { 1, '<', '<', 'Command' }
  217.     h_trans { 2, '<', '&', 'Symbol' }
  218.  
  219.     h_state 1 { 'Command' }
  220.     h_trans { 0, '>', '>', 'Command' }
  221.     h_trans { 0, '>', '<', 'Command' }
  222.     h_trans { 0, '>', '/>', 'Command' }
  223.     h_trans { 6, '<', '/', 'Command' }
  224.     h_trans { 3, '<', '"', 'String' }
  225.     h_wtype { -1, -1, -1, 'i', 'a-zA-Z0-9_\-' }
  226.  
  227.     h_state 2 { 'Symbol' }
  228.     h_trans { 0, '>', ';', 'Symbol' }
  229.     h_trans { 0, '-S', '#a-zA-Z0-9', 'Symbol' }
  230.  
  231.     h_state 3 { 'String' }
  232.     h_trans { 1, '>', '"', 'String' }
  233.  
  234.     h_state 4 { 'Comment' }
  235.     h_trans { 5, '>', '--', 'Comment' }
  236.  
  237.     h_state 5 { 'Special' }
  238.     h_trans { 4, '>', '--', 'Comment' }
  239.     h_trans { 0, '>', '>', 'Comment' }
  240.  
  241.     h_state 6 { 'Symbol' }
  242.     h_trans { 7, '-', '//', 'Command' }
  243.     h_trans { 0, '>', '/', 'Command' }
  244.     h_trans { 0, '>', '>', 'Symbol' }
  245.     h_trans { 7, '>', '</', 'Command' }
  246.     h_trans { 1, '>', '<', 'Command' }
  247.  
  248.     h_state 7 { 'Command' }
  249.     h_trans { 6, '>', '/', 'Command' }
  250.  
  251.     h_state 8 { 'Command' }
  252.     h_trans { 0, '>', '>', 'Command' }
  253.     h_trans { 3, '<', '"', 'String' }
  254.     h_wtype { -1, -1, -1, 'i', 'a-zA-Z0-9_\-' }
  255.  
  256. }
  257.  
  258. mode SGML: PLAIN {
  259.     FileNameRx          = /\.\c{SGML?}|{SGML?}$/;
  260.     HilitOn             = 1;
  261.     Colorizer           = "SGML";
  262.     MultiLineHilit      = 1;
  263.     AutoHilitParen      = 1;
  264.  
  265.     RoutineRegexp       = /\<[Hh]\d\>/;
  266.  
  267.     SaveFolds           = 2;      # save fold info at end of line
  268.     CommentStart        = "<!--";
  269.     CommentEnd          = "-->";
  270.     WordWrap            = 2;
  271.     RightMargin         = 85;
  272.     AutoIndent          = 1;
  273.     
  274.     Insert              = 1;
  275.     IndentMode          = "Plain";
  276.     Trim                = 1;
  277. }
  278.