1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 | package Torello.Java;
class TextToHTMLPage
{
static String convert
(String text, String titleStr)
{
return
"<HTML>\n" +
"<HEAD>\n" +
"<TITLE>" + titleStr + "</TITLE>\n" +
"<STYLE TYPE='text/css'>\n" + '\n' +
// This method simply copies the CSS-Definitions File out of the Java-HTML JAR, and
// into a String that is returned to the user. Make sure to wrap that String
// inside of a <STYLE>...</STYLE> HTML-Tag. Also - set the background color
C.getCSSDefinitions() +
"BODY\n" +
"{\n" +
" font-family: monospace;\n" +
" background: black;\n" +
" color: white;\n" +
" white-space: pre;\n" +
" overflow-x: hidden;\n" +
" margin: 1em;\n" +
"}\n" +
"</STYLE>\n" +
"</HEAD>\n" +
"<BODY>\n" +
// NOTE: This just calls the other variant of 'toHTML' - but ensures that 'true' is
// passed to the 'useCSSClasses' parameter.
TextToHTML.convert(text, true, true, true) +
"</BODY>\n" +
"</HTML>";
}
}
|