prettification
M · style.css +3, -3 1@@ -1,5 +1,5 @@
2 body {
3- font-family: sans-serif;
4+ font-family: monospace, sans-serif;
5 color: #333;
6 background-color: #fff;
7 }
8@@ -20,8 +20,8 @@ table td {
9 padding: 0 3px;
10 }
11
12-table tr:hover td {
13- background-color: #ddd;
14+#content table tr:hover td {
15+ background-color: #eee;
16 }
17
18 h1, h2, h3, h4, h5, h6 {
M · urmoms.c
+11, -4 1@@ -116,8 +116,9 @@ writeheader(FILE *fp)
2 fprintf(fp, "<link rel=\"alternate\" type=\"application/atom+xml\" title=\"%s Atom Feed\" href=\"%satom.xml\" />\n",
3 name, relpath);
4 fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
5- fputs("</head>\n<body>\n<center>\n", fp);
6- fprintf(fp, "<h1><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /> %s <span class=\"desc\">%s</span></h1>\n",
7+ fputs("</head>\n<body>\n\n", fp);
8+ fprintf(fp, "<table><tr><td><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></td>"
9+ "<td><h1>%s</h1><span class=\"desc\">%s</span></td></tr><tr><td></td><td>\n",
10 relpath, name, description);
11 fprintf(fp, "<a href=\"%slog.html\">Log</a> | ", relpath);
12 fprintf(fp, "<a href=\"%sfiles.html\">Files</a>", relpath);
13@@ -125,7 +126,7 @@ writeheader(FILE *fp)
14 fprintf(fp, " | <a href=\"%sreadme.html\">README</a>", relpath);
15 if (haslicense)
16 fprintf(fp, " | <a href=\"%slicense.html\">LICENSE</a>", relpath);
17- fputs("\n</center>\n<hr/>\n<pre>", fp);
18+ fputs("</td></tr></table>\n<hr/><div id=\"content\">\n", fp);
19
20 return 0;
21 }
22@@ -133,7 +134,7 @@ writeheader(FILE *fp)
23 int
24 writefooter(FILE *fp)
25 {
26- return !fputs("</pre>\n</body>\n</html>", fp);
27+ return !fputs("</div></body>\n</html>", fp);
28 }
29
30 FILE *
31@@ -284,6 +285,7 @@ printshowfile(struct commitinfo *ci)
32
33 fp = efopen(path, "w+b");
34 writeheader(fp);
35+ fputs("<pre>\n", fp);
36 printcommit(fp, ci);
37
38 memset(&statsbuf, 0, sizeof(statsbuf));
39@@ -347,6 +349,7 @@ printshowfile(struct commitinfo *ci)
40 }
41 git_buf_free(&statsbuf);
42
43+ fputs( "</pre>\n", fp);
44 writefooter(fp);
45 fclose(fp);
46 return;
47@@ -584,9 +587,11 @@ main(int argc, char *argv[])
48 if (!git_revparse_single(&obj, repo, "HEAD:LICENSE")) {
49 fp = efopen("license.html", "w+b");
50 writeheader(fp);
51+ fputs("<pre>\n", fp);
52 writeblobhtml(fp, (git_blob *)obj);
53 if (ferror(fp))
54 err(1, "fwrite");
55+ fputs("</pre>\n", fp);
56 writefooter(fp);
57
58 fclose(fp);
59@@ -596,9 +601,11 @@ main(int argc, char *argv[])
60 if (!git_revparse_single(&obj, repo, "HEAD:README")) {
61 fp = efopen("readme.html", "w+b");
62 writeheader(fp);
63+ fputs("<pre>\n", fp);
64 writeblobhtml(fp, (git_blob *)obj);
65 if (ferror(fp))
66 err(1, "fwrite");
67+ fputs("</pre>\n", fp);
68 writefooter(fp);
69 fclose(fp);
70 }