package bibweb;

public class BuiltinMacros {
	static String[][] macros = {
		{ "url", "<a href=\"#1\">#1</a>" },
		{ "'e", "&eacute;" },
		{ "'i", "&iacute;" },
		{ "\"u", "&uuml;" },
		{ "\"o", "&ouml;" },
		{ "\"a", "&auml;" },
		{ "\\{", "{" },
		{ "\\}", "}" },
		{ "--", "&ndash;" },
		{ "---", "&mdash;" },
		{ "~", "&nbsp;" },
		{ "textsuperscript", "<span class=ordinal>#1</span>" },
		{ "texttt", "<tt>#1</tt>" },
		{ "textbf", "<b>#1</b>" },
		{ "header",
			"\\doctype\r\n" +
			"<html>\r\n" +
			"<head>\r\n" +
			"  <title>\\pagetitle</title>\r\n" +
			"  \\urimeta\r\n" +
			"  \\contenttype\r\n" + 
			"  \\moremeta\r\n" +
			"  \\style\r\n" +
			"  \\morestyle\r\n" +
			"</head>\r\n" +
			"<body>\\opening\r\n" +
			"  \\banner\r\n"
		},
		{ "footer",
			"\\closing\r\n" +
		    "</body>\r\n" +
			"</html>" },
		{ "doctype",     "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\""
				       + " \"http://www.w3.org/TR/html4/loose.dtd\">"},
	    { "pagetitle",       "Publications by \\author" },
	    { "contenttype", "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"},
		{ "moremeta",    "  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" },
		{ "style",       "  <link href=\"\\stylesheet\" type=\"text/css\" rel=\"stylesheet\" />" },
		{ "morestyle",   "" },
		{ "uri",         "" },
		{ "urimeta",     "" },
		{ "opening",     "<div class=paperlist>" },
		{ "closing",     "</div>\\credits" },
		{ "credits",     "<p class=credits>Generated by <a href=\"https://github.com/andrewcmyers/bibweb\">bibweb</a></p>" },
		{ "intro",       "<h2>Publications</h2>" },
		{ "banner",      "<h1>Publications by \\author</h1>" },
		{ "stylesheet",  "default.css" },
		{ "author",      "John Doe" },
		{ "openpaperlist", "<ul class=pubs>" },
		{ "closepaperlist", "</ul>" },
		{ "pubformat",
			"<li>\r\n\\authors. \\title.\r\n"
	      + "\\wherepublished.</li>\r\n" },
	    { "\\authors", "(formatted author list)" },
	    { "\\title", "(title of this publication)" },
	    { "\\wherepublished", "(publication venue and pages)" },
	    { "\\year", "(year of this publication)" },
	    // ifdef
	    // ifndef
	    // pubinfo
	    // ifeq
	    // ifne
	    // def
	};
}

@@ -2161,85 +2161,521 @@
     
-// ifdef
+%7B %22%5C%5Cifdef%22, %22(insert second argument if first is a defined macro)%22%7D,
 %0A%09    
-// 
+%7B %22%5C%5C
 ifndef
-%0A%09    // pubinfo%0A%09    // ifeq%0A%09    // ifne%0A%09    // def
+%22, %22(insert second argument if first is not a defined macro)%22%7D,%0A%09    %7B %22%5C%5Cifeq%22, %22(insert third argument if first two are equal)%22%7D,%0A%09    %7B %22%5C%5Cifne%22, %22(insert third argument if first two are not equal)%22%7D,%0A%09    %7B %22%5C%5Cpubinfo%22, %22(%5C%5Cpubinfo%7Bkey%7D%7Battribute%7D looks up an attribute of publication with the given key)%22%7D,%0A%09    %7B %22%5C%5Cdef%22, %22(%5C%5Cdef%7Bname%7D%7Bexpansion%7D defines a new macro. Arguments can be named as #1, #2, etc. in expansion%22%7D
 %0A%09%7D;

Document the special macros.