home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / s / stronged / !StrongED / Defaults / Modes / !HTML / ModeFile < prev    next >
Encoding:
Text File  |  1997-05-10  |  4.8 KB  |  231 lines

  1.  
  2. # HTML mode for strong ed
  3. # Written by Andrew Black  andrew@bach.demon.co.uk
  4. # Contact me with comments, gribes, praise , suggestions .......
  5. #
  6. # $Header: RCS.html 4.0 96/05/11 11:53:42 root Exp $
  7.  
  8. #----------------------------------------------------------------------
  9.  
  10. SyntaxOptions
  11.     SingleQuote    No
  12.     DoubleQuote    Yes
  13.     QuoteQuote    Yes
  14.     SplitString    No
  15. End
  16. SyntaxComment 
  17.     Type        Multiline
  18.     StartWith    <!--
  19.     EndWith        -->
  20. End 
  21.  
  22. # Id's are used to try and pick up all tags that  don't have their
  23. # own colouring.   It also picks out start of tags such as
  24. # <A ( as part of <A HREF=""></A> )
  25. # Of course it will also pick out non-tags such as <ANDREW>
  26.  
  27. ID_FirstChar    <
  28. ID_Middle    /A-Za-z_0-9
  29. ID_LastChar    A-Za-z_0-9>
  30.  
  31. SyntaxWords Group1 EndAlways nocase
  32.  
  33.     <address> <html> <head> <title> <body>
  34.     </address> </html> </head> </title> </body>
  35. #     this covers <BODY BACKGROUND ...
  36.     <body
  37.     <h1> <h2> <h3> </h1> </h2> </h3>
  38.  
  39. End
  40.  
  41. SyntaxWords Group2 EndAlways nocase
  42.     <ul> </ul>  <dl> </dl> <ol> </ol>
  43.     <form> </form>
  44.     <table> </table>
  45. End
  46.  
  47. SyntaxWords Group3 EndAlways nocase
  48.     <li> <dt> <dd>
  49.     <input
  50. End
  51.  
  52. # recommended colour - blue (to look like an anchor in browers)
  53. SyntaxWords Group4 EndOFTAG nocase
  54.     <img
  55.     <a
  56. End
  57.  
  58. #SyntaxWords Group5 EndOfTAG nocase
  59. #    </a>
  60. #End
  61.  
  62. #----------------------------------------------------------------------
  63.  
  64.  
  65. Search
  66.     heading1    "<h"  AlphaNum   ">" @0 *  "</" @9
  67.     heading        "<h"  AlphaNum   ">" @0 * @9 "</"
  68.     tag        "<" ["\\"] { AlphaNum | "/" }+  ">"
  69.     _MarkWord    tag  | {AlphaNum}+   | {Punct}+
  70.  
  71.     quote        "\""
  72.     anchor        "<a" {iswhite}+ * "href" {iswhite} "="  {iswhite}  quote @0 ** quote  ">" @9
  73.     anchor1        "<a" {iswhite}+ * "href" {iswhite} "="  {iswhite}  quote @0
  74.     selected_line    {any}+
  75.  
  76. # match everything sensible but not , 
  77. #    textstr     { AlphaNum | '\' _\-' }+
  78.  
  79.     url        {AlphaNum}+ ":/" { ["~"] alphanum | '/_.' }+
  80.     url_text    @1 url @2 {iswhite} @3 {.} @4
  81.     text        @1 @2 @3 {.} @4
  82. #        hotlist    url_text  |  text
  83.     hotlist        url_text
  84. # removing tag
  85.     anch_st        "<a" {iswhite}+ * quote
  86.     anch_end    quote  {iswhite} ">"
  87.     remove_tag    anch_st | anch_end | tag
  88.  
  89. End
  90.  
  91. Replace
  92.     h1        "<H1>" @@ "</H1>"
  93.     h2        "<H2>" @@ "</H2>"
  94.     h3        "<H3>" @@  "</H3>"
  95. #misc
  96.     ital        "<I>" @@ "</I>"
  97.     bold        "<B>" @@ "</B>"
  98.     strong        "<STRONG>" @@ "</STRONG>"
  99.     emphasis    "<EM>" @@  "</EM>"
  100.  
  101.     hotlist_r  "<A href=\"" @12  "\">" @34  "</A>" nl
  102. #    anch     "<A href=\"" @@  "\"> </A>"
  103. End
  104.  
  105. #ClickList Select1
  106. #END
  107.  
  108. ClickList Adjust1
  109.     http    BroadcastURL("<tmp$word>")
  110. END
  111.  
  112. Functions
  113.  
  114.     Icon    lof
  115.     Select     ListOfFound (heading1,All,Align,noLine,NoCase)
  116.     Menu    Hhtml_loh
  117.     Help    Select - list of headings|MAdjust - list of Anchors
  118.  
  119.     Adjust    ListOfFound (anchor,All,align,noLine,NoCase)
  120.  
  121.     Key    ⇧F3
  122.     Menu    Save & Render      ⇧F3
  123.     Icon    run
  124.     Select    SetTmp() SaveDClick ("<tmp$path>.<tmp$leaf>")
  125.     Help    Hhtml_run
  126.  
  127.     Menu    Escape brackets
  128.     Key    ⇧^F4
  129.     Select    Replace ("<","<", block ) Replace (">",">", block )
  130.     Help    Hhtml_esc
  131.  
  132.     Menu    Load selected file
  133.     Help    Click to load the HTML file under cursor.
  134.     Select    SetTmp() LoadOne ("<tmp$path>.<tmp$word>","<tmp$word>")
  135.     Help    Hhtml_lod
  136.  
  137. #    Key
  138.     Menu    Create <H1>
  139.     Icon    ab_h1
  140.     Select    Replace( selected_line,h1 , block , noline,nocase)
  141.     Help    Hhtml_h1
  142.  
  143.     Menu    Create <H2>
  144.     Icon    ab_h2
  145.     Select    Replace( selected_line,h2 , block , noline,nocase)
  146.     Help    Hhtml_h2
  147.     
  148.     Menu    Create <H3>
  149.     Icon    ab_h3
  150.     Select    Replace( selected_line,h3 , block , noline,nocase)
  151.     Help    Hhtml_h3
  152.  
  153. #     !stronged sounds like a good icon for this.  hope Guttorm doesn't mind :-)
  154.     Menu    Add strong
  155.     Icon    sm!stronged
  156.     Select    Replace( selected_line,strong , block , noline,nocase)
  157.     Help    Hhtml_str
  158.  
  159.     Menu    Add emphasis
  160.     Icon    ab_emph
  161.     Select    Replace( selected_line,emphasis , block , noline,nocase)
  162.     Help    Hhtml_emp
  163.  
  164.     Menu    Add italic
  165.     Icon    ab_italic
  166.     Select    Replace( selected_line,ital , block , noline,nocase)
  167.     Help    Hhtml_ita
  168.  
  169.     Menu    Add bold
  170.     Icon    ab_bold
  171.     Select    Replace( selected_line,bold , block , noline,nocase)
  172.     Help    Hhtml_bld
  173.  
  174.     Menu    Remove tags
  175.     Select    Replace( remove_tag,"" , block , noline,nocase)
  176.     Help    Hhtml_rm
  177.  
  178. #        Menu    Insert Anchor
  179.     Icon    ab_anchor
  180.       Select    InsertStr("<A href=\"\"> </A>")
  181.       Help        Hhtml_anc
  182.  
  183.       Key f9
  184.       Adjust    Replace (hotlist,hotlist_r, block )
  185.  
  186.  
  187. End
  188.  
  189.  
  190. Shortcuts
  191. # overall HTML file (to create a new file)
  192. # add your name etc into here
  193.     ''f    <HTML>\N<HEAD>\N  <TITLE>\@</TITLE>\N</HEAD>\N\N<BODY>\N<H1>\@</H1>\N<HR>\N<ADDRESS>My name </ADDRESS>\N</BODY></HTML>
  194. #lists
  195.     ''ul    <UL>\N\I  <LI>\@\N\I</UL>
  196.     ''ol    <OL>\N\I  <LI>\@\N\I</OL>
  197.     <LI>+    <LI>\@\N\I<LI>
  198.  
  199. #anchors
  200.     ''ai    <A href="\@">\@</A>
  201.     ''ae    <A href="http://\@/\@">\@</A>
  202.     ''ha    <H1><a name="\@">\@</a></H1>
  203. # heads
  204.     ''1    <H1>\@</H1>\N
  205.     ''2    <H2>\@</H2>\N
  206.     ''3    <H3>\@</H3>\N
  207. #misc
  208.     ''i    <I>\@</I>
  209.     ''b    <B>\@</B>
  210.     ''m    <IMG SRC="\@" ALT="[\@]">
  211. #  comment :
  212.     ''!    <!-- \@ -->
  213.  
  214. End
  215.  
  216. Shortcuts
  217.     å    å
  218.     Å    &ARING;
  219.     ø    ø
  220.     Ø    &OSLASH;
  221.     æ    ¸la;
  222.     Æ    &CEDILLA;
  223.     ä    ä
  224.     Ä    &AUML;
  225.     ö    ö
  226.     Ö    &OUML;
  227.     ü    ü
  228.     Ü    &UUML;
  229.     ß    ß
  230. End  
  231.