// -*- ASCII:EDT -*- // DocType.edt // Anthony Roy ////////////////////////////////////// BeginGroup; // Get DocType: LetReg(2,'invalid'); Loop(!|> LetReg(0,"4");> EnterReg(0, "4.01: Loose(4); Strict(s); Frames(f). 3.2 Final(3). Other(o)",> "DocType version?");> IfStr("%!0","4","=",'LetReg(2,`valid`);LetReg(1,`HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"`);');> IfStr("%!0","s","=",'LetReg(2,`valid`);LetReg(1,`HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"`);');> IfStr("%!0","f","=",'LetReg(2,`valid`);LetReg(1,`HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"`);');> IfStr("%!0","3","=",'LetReg(2,`valid`);LetReg(1,`HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"`);');> IfStr("%!0","o","=",'LetReg(2,`valid`);LetReg(0,`other`);LetReg(1,``);');> IfStr("%!2","valid","=","Stop;");> |); //Go to the beginning of the file and insert doctype tag. Mark(0); CMD("Go To Beginning Of File"); InsText('%\'); IfStr('%!0','other','=','CMD(`Previous Bullet`);','Goto(0);'); EndGroup; End; BEHAVIOUR: Inserts the appropriate DocType declaration at the beginning of the document and returns to the current place in the text. Currently only supports HTML doctypes, but has an 'other' option which merely inserts the empty tag. INSTALLATION: Move this file into the ..\WinEdt\Macros\HTML\ directory, and then insert a new macro into the desired menu with the line [Exe("%B\Macros\HTML\DocType.edt")] as the Macro command.