
# HTML mode for strong ed
# Written by Andrew Black  andrew@bach.demon.co.uk
# Contact me with comments, gribes, praise , suggestions .......
#
# $Header: RCS.html 4.0 96/05/11 11:53:42 root Exp $

#----------------------------------------------------------------------

SyntaxOptions
	SingleQuote	No
	DoubleQuote	Yes
	QuoteQuote	Yes
	SplitString	No
End
SyntaxComment 
	Type		Multiline
	StartWith	<!--
	EndWith		-->
End 

# Id's are used to try and pick up all tags that  don't have their
# own colouring.   It also picks out start of tags such as
# <A ( as part of <A HREF=""></A> )
# Of course it will also pick out non-tags such as <ANDREW>

ID_FirstChar	<
ID_Middle	/A-Za-z_0-9
ID_LastChar	A-Za-z_0-9>

SyntaxWords Group1 EndAlways nocase
	<address> <html> <head> <title> <body <body> <frameset <noframes>
	</address> </html> </head> </title> </body> </frameset> </noframes>
	<h1> <h2> <h3> <h4> <h5> <h6> </h1> </h2> </h3> </h4> </h5> </h6>
	<h1 <h2 <h3 <h4 <h5 <h6
End

SyntaxWords Group2 EndAlways nocase
	<p <p> <br> </p> </br> <tr> <tr </tr> </tr
End

SyntaxWords Group3 EndAlways nocase
	<ul> <ul </ul>  <dl> <dl </dl> <ol> <ol </ol>
	<form> <form </form>
	<table> <table </table> <td> <td </td> </td
End

SyntaxWords Group4 EndAlways nocase
	<li> <dt> <dd>
	<input
End

# recommended colour - blue (to look like an anchor in browers)
SyntaxWords Group5 EndAlways nocase
	<img
	<a  </a>
End

# Tags to change the general appearance of body text

SyntaxWords Group6 EndAlways nocase
	<b> <i> <em> <strong> </b> </i> </em> </strong>
	<code> </code> <pre> </pre> <font </font>
End

#Entities

SyntaxWords Group7 EndAlways case
	&quot; &lt; &gt; &amp; &#
	&nbsp;
End

#----------------------------------------------------------------------


Search
	heading1	"<h"  AlphaNum   ">" @0 *  "</" @9
	heading		"<h"  AlphaNum   ">" @0 * @9 "</"
	tag		"<" ["\\"] { AlphaNum | "/" }+  ">"
	_MarkWord	tag  | {AlphaNum}+   | {Punct}+

	quote		"\""
	anchor		"<a" {iswhite}+ * "href" {iswhite} "="  {iswhite}  quote @0 ** quote  ">" @9
	anchor1		"<a" {iswhite}+ * "href" {iswhite} "="  {iswhite}  quote @0
	selected_line	{any}+

# match everything sensible but not , 
#	textstr	 { AlphaNum | '\' _\-' }+

	url		{AlphaNum}+ ":/" { ["~"] alphanum | '/_.' }+
	url_text	@1 url @2 {iswhite} @3 {.} @4
	text		@1 @2 @3 {.} @4
#        hotlist	url_text  |  text
	hotlist		url_text
# removing tag
	anch_st		"<a" {iswhite}+ * quote
	anch_end	quote  {iswhite} ">"
	remove_tag	anch_st | anch_end | tag

End

Replace
	h1		"<H1>" @@ "</H1>"
	h2		"<H2>" @@ "</H2>"
	h3		"<H3>" @@  "</H3>"
#misc
	ital		"<I>" @@ "</I>"
	bold		"<B>" @@ "</B>"
	strong		"<STRONG>" @@ "</STRONG>"
	emphasis	"<EM>" @@  "</EM>"

	hotlist_r  "<A href=\"" @12  "\">" @34  "</A>" nl
#	anch     "<A href=\"" @@  "\"> </A>"
End

#ClickList Select1
#END

ClickList Select2
	http	BroadcastURL("<tmp$word>")
END

Functions

	Icon	lof
	Select 	ListOfFound (heading1,All,Align,noLine,NoCase)
	Menu	Hhtml_loh
	Help	Select - list of headings|MAdjust - list of Anchors

	Adjust	ListOfFound (anchor,All,align,noLine,NoCase)

	Key	F3
	Menu	Save & Render      F3
	Icon	run
	Select	SetTmp() SaveDClick ("<tmp$path>.<tmp$leaf>")
	Help	Hhtml_run

	Menu	Escape brackets
	Key	^F4
	Select	Replace ("<","&lt;", block ) Replace (">","&gt;", block )
	Help	Hhtml_esc

	Menu	Load selected file
	Help	Click to load the HTML file under cursor.
	Select	SetTmp() LoadOne ("<tmp$path>.<tmp$word>","<tmp$word>")
	Help	Hhtml_lod

#	Key
	Menu	Create <H1>
	Icon	ab_h1
	Select	Replace( selected_line,h1 , block , noline,nocase)
	Help	Hhtml_h1

	Menu	Create <H2>
	Icon	ab_h2
	Select	Replace( selected_line,h2 , block , noline,nocase)
	Help	Hhtml_h2
	
	Menu	Create <H3>
	Icon	ab_h3
	Select	Replace( selected_line,h3 , block , noline,nocase)
	Help	Hhtml_h3

# 	!stronged sounds like a good icon for this.  hope Guttorm doesn't mind :-)
	Menu	Add strong
	Icon	sm!stronged
	Select	Replace( selected_line,strong , block , noline,nocase)
	Help	Hhtml_str

	Menu	Add emphasis
	Icon	ab_emph
	Select	Replace( selected_line,emphasis , block , noline,nocase)
	Help	Hhtml_emp

	Menu	Add italic
	Icon	ab_italic
	Select	Replace( selected_line,ital , block , noline,nocase)
	Help	Hhtml_ita

	Menu	Add bold
	Icon	ab_bold
	Select	Replace( selected_line,bold , block , noline,nocase)
	Help	Hhtml_bld

	Menu	Remove tags
	Select	Replace( remove_tag,"" , block , noline,nocase)
	Help	Hhtml_rm

#        Menu	Insert Anchor
	Icon	ab_anchor
	  Select	InsertStr("<A href=\"\"> </A>")
	  Help		Hhtml_anc

	  Key f9
	  Adjust	Replace (hotlist,hotlist_r, block )


End


Shortcuts
# overall HTML file (to create a new file)
# add your name etc into here
	''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>
#lists
	''ul	<UL>\N\I  <LI>\@\N\I</UL>
	''ol	<OL>\N\I  <LI>\@\N\I</OL>
	<LI>+	<LI>\@\N\I<LI>

#anchors
	''ai	<A href="\@">\@</A>
	''ae	<A href="http://\@/\@">\@</A>
	''ha	<H1><a name="\@">\@</a></H1>
# heads
	''1	<H1>\@</H1>\N
	''2	<H2>\@</H2>\N
	''3	<H3>\@</H3>\N
#misc
	''i	<I>\@</I>
	''b	<B>\@</B>
	''m	<IMG SRC="\@" ALT="[\@]">
#  comment :
	''!	<!-- \@ -->

End

Shortcuts
		&aring;
		&ARING;
		&oslash;
		&OSLASH;
		&cedilla;
		&CEDILLA;
		&auml;
		&AUML;
		&ouml;
		&OUML;
		&uuml;
		&UUML;
		&szlig;
End  
