--- a/src/Pure/Thy/html.scala Sat Jan 09 20:56:00 2016 +0100
+++ b/src/Pure/Thy/html.scala Sat Jan 09 22:00:22 2016 +0100
@@ -20,11 +20,11 @@
Symbol.bold -> "b",
Symbol.bold_decoded -> "b")
- def encode(text: String): String =
+ def output(text: String): String =
{
val result = new StringBuilder
- def encode_char(c: Char) =
+ def output_char(c: Char) =
c match {
case '<' => result ++= "<"
case '>' => result ++= ">"
@@ -34,7 +34,7 @@
case '\n' => result ++= "<br/>"
case _ => result += c
}
- def encode_chars(s: String) = s.iterator.foreach(encode_char(_))
+ def output_chars(s: String) = s.iterator.foreach(output_char(_))
var ctrl = ""
for (sym <- Symbol.iterator(text)) {
@@ -43,16 +43,16 @@
control.get(ctrl) match {
case Some(elem) if Symbol.is_controllable(sym) && sym != "\"" =>
result ++= ("<" + elem + ">")
- encode_chars(sym)
+ output_chars(sym)
result ++= ("</" + elem + ">")
case _ =>
- encode_chars(ctrl)
- encode_chars(sym)
+ output_chars(ctrl)
+ output_chars(sym)
}
ctrl = ""
}
}
- encode_chars(ctrl)
+ output_chars(ctrl)
result.toString
}
@@ -60,8 +60,6 @@
/* document */
- val end_document = "\n</div>\n</body>\n</html>\n"
-
def begin_document(title: String): String =
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" +
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " +
@@ -69,13 +67,15 @@
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
"<head>\n" +
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n" +
- "<title>" + encode(title) + "</title>\n" +
+ "<title>" + output(title + " (" + Distribution.version + ")") + "</title>\n" +
"<link media=\"all\" rel=\"stylesheet\" type=\"text/css\" href=\"isabelle.css\"/>\n" +
"</head>\n" +
"\n" +
"<body>\n" +
"<div class=\"head\">" +
- "<h1>" + encode(title) + "</h1>\n"
+ "<h1>" + output(title) + "</h1>\n"
+
+ val end_document = "\n</div>\n</body>\n</html>\n"
/* common markup elements */