2 * Describe all known highlight languages.
21 state describe_languages
35 * Create a HTML report of all supported highlighting rules.
38 sub html_annotate_mailtos (str)
40 return regsuball (str, /[-_a-zA-Z0-9\\.]+@[-_a-zA-Z0-9\\.]+/,
41 "<a href=\"mailto:$0\">$0</a>");
46 str = regsuball (str, /\&/, "&");
47 str = regsuball (str, /</, "<");
48 str = regsuball (str, />/, ">");
49 str = regsuball (str, /\"/, """);
53 sub describe_me_html_print_pending_name ()
55 if (!language_name_pending)
58 print ("<p>\n<dl compact>\n<dt><b>Name:</b><dd>",
59 html_quote (language_name), "\n");
61 language_name_pending = 0;
64 state describe_me_html
70 /* Terminate this state. */
71 describe_me_html_print_pending_name ();
78 if (regmatch (row, /Name:(.*)/))
81 language_name_pending = 1;
83 else if (regmatch (row, /Description:(.*)/))
85 /* This starts the new language. */
87 title = regsub (title, /^[ \t]+/, "");
88 title = regsub (title, /[ \t\\.]+$/, "");
89 print ("<p><li><b>", html_quote (title), "</b><p>\n");
91 else if (regmatch (row, /([a-zA-Z]+:)(.*)/))
93 describe_me_html_print_pending_name ();
94 print ("<dt><b>", html_quote ($1), "</b><dd>",
95 html_annotate_mailtos (html_quote ($2)));
98 print (html_annotate_mailtos (html_quote (row)));
102 current_input_file = 0;
104 state describe_languages_html
107 if (current_input_file == 0)
109 title = "Enscript Highlighting Languages And File Formats";
110 print ("<!DOCTYPE html PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n",
111 "<html>\n<head>\n<title>", title, "</title>\n",
112 "<LINK REV=\"made\" HREF=\"mailto:mtr@iki.fi\">\n",
114 "<body BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\" LINK=\"#1F00FF\"",
115 "ALINK=\"#FF0000\" VLINK=\"#9900DD\">\n",
116 "<h1>", title, "</h1>\n<hr>\n<ul>\n");
118 current_input_file++;
122 if (current_input_file == length (argv))
123 print ("\n</ul>\n<hr><address>By ", version,
124 "</address>\n</body>\n</html>\n");
128 call (describe_me_html);