浏览代码

Generate html5, not xhtml.

Heikki Hokkanen 11 年前
父节点
当前提交
107ada370a
共有 1 个文件被更改,包括 15 次插入16 次删除
  1. 15
    16
      gitstats

+ 15
- 16
gitstats 查看文件

@@ -839,7 +839,7 @@ class HTMLReportCreator(ReportCreator):
839 839
 			else:
840 840
 				f.write('<td>0.00</td>')
841 841
 		f.write('</tr></table>')
842
-		f.write('<img src="hour_of_day.png" alt="Hour of Day" />')
842
+		f.write('<img src="hour_of_day.png" alt="Hour of Day">')
843 843
 		fg = open(path + '/hour_of_day.dat', 'w')
844 844
 		for i in range(0, 24):
845 845
 			if i in hour_of_day:
@@ -867,7 +867,7 @@ class HTMLReportCreator(ReportCreator):
867 867
 				f.write('<td>0</td>')
868 868
 			f.write('</tr>')
869 869
 		f.write('</table></div>')
870
-		f.write('<img src="day_of_week.png" alt="Day of Week" />')
870
+		f.write('<img src="day_of_week.png" alt="Day of Week">')
871 871
 		fp.close()
872 872
 
873 873
 		# Hour of Week
@@ -910,7 +910,7 @@ class HTMLReportCreator(ReportCreator):
910 910
 			fp.write('%d %d\n' % (mm, commits))
911 911
 		fp.close()
912 912
 		f.write('</table></div>')
913
-		f.write('<img src="month_of_year.png" alt="Month of Year" />')
913
+		f.write('<img src="month_of_year.png" alt="Month of Year">')
914 914
 
915 915
 		# Commits by year/month
916 916
 		f.write(html_header(2, 'Commits by year/month'))
@@ -918,7 +918,7 @@ class HTMLReportCreator(ReportCreator):
918 918
 		for yymm in reversed(sorted(data.commits_by_month.keys())):
919 919
 			f.write('<tr><td>%s</td><td>%d</td><td>%d</td><td>%d</td></tr>' % (yymm, data.commits_by_month.get(yymm,0), data.lines_added_by_month.get(yymm,0), data.lines_removed_by_month.get(yymm,0)))
920 920
 		f.write('</table></div>')
921
-		f.write('<img src="commits_by_year_month.png" alt="Commits by year/month" />')
921
+		f.write('<img src="commits_by_year_month.png" alt="Commits by year/month">')
922 922
 		fg = open(path + '/commits_by_year_month.dat', 'w')
923 923
 		for yymm in sorted(data.commits_by_month.keys()):
924 924
 			fg.write('%s %s\n' % (yymm, data.commits_by_month[yymm]))
@@ -930,7 +930,7 @@ class HTMLReportCreator(ReportCreator):
930 930
 		for yy in reversed(sorted(data.commits_by_year.keys())):
931 931
 			f.write('<tr><td>%s</td><td>%d (%.2f%%)</td><td>%d</td><td>%d</td></tr>' % (yy, data.commits_by_year.get(yy,0), (100.0 * data.commits_by_year.get(yy,0)) / data.getTotalCommits(), data.lines_added_by_year.get(yy,0), data.lines_removed_by_year.get(yy,0)))
932 932
 		f.write('</table></div>')
933
-		f.write('<img src="commits_by_year.png" alt="Commits by Year" />')
933
+		f.write('<img src="commits_by_year.png" alt="Commits by Year">')
934 934
 		fg = open(path + '/commits_by_year.dat', 'w')
935 935
 		for yy in sorted(data.commits_by_year.keys()):
936 936
 			fg.write('%d %d\n' % (yy, data.commits_by_year[yy]))
@@ -974,12 +974,12 @@ class HTMLReportCreator(ReportCreator):
974 974
 			f.write('<p class="moreauthors">These didn\'t make it to the top: %s</p>' % ', '.join(rest))
975 975
 
976 976
 		f.write(html_header(2, 'Cumulated Added Lines of Code per Author'))
977
-		f.write('<img src="lines_of_code_by_author.png" alt="Lines of code per Author" />')
977
+		f.write('<img src="lines_of_code_by_author.png" alt="Lines of code per Author">')
978 978
 		if len(allauthors) > conf['max_authors']:
979 979
 			f.write('<p class="moreauthors">Only top %d authors shown</p>' % conf['max_authors'])
980 980
 
981 981
 		f.write(html_header(2, 'Commits per Author'))
982
-		f.write('<img src="commits_by_author.png" alt="Commits per Author" />')
982
+		f.write('<img src="commits_by_author.png" alt="Commits per Author">')
983 983
 		if len(allauthors) > conf['max_authors']:
984 984
 			f.write('<p class="moreauthors">Only top %d authors shown</p>' % conf['max_authors'])
985 985
 
@@ -1057,7 +1057,7 @@ class HTMLReportCreator(ReportCreator):
1057 1057
 			fp.write('%s %d %d\n' % (domain, n , info['commits']))
1058 1058
 			f.write('<tr><th>%s</th><td>%d (%.2f%%)</td></tr>' % (domain, info['commits'], (100.0 * info['commits'] / totalcommits)))
1059 1059
 		f.write('</table></div>')
1060
-		f.write('<img src="domains.png" alt="Commits by Domains" />')
1060
+		f.write('<img src="domains.png" alt="Commits by Domains">')
1061 1061
 		fp.close()
1062 1062
 
1063 1063
 		f.write('</body></html>')
@@ -1094,7 +1094,7 @@ class HTMLReportCreator(ReportCreator):
1094 1094
 		#	fg.write('%s %d\n' % (datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d'), data.files_by_stamp[stamp]))
1095 1095
 		fg.close()
1096 1096
 			
1097
-		f.write('<img src="files_by_date.png" alt="Files by Date" />')
1097
+		f.write('<img src="files_by_date.png" alt="Files by Date">')
1098 1098
 
1099 1099
 		#f.write('<h2>Average file size by date</h2>')
1100 1100
 
@@ -1126,7 +1126,7 @@ class HTMLReportCreator(ReportCreator):
1126 1126
 		f.write('</dl>\n')
1127 1127
 
1128 1128
 		f.write(html_header(2, 'Lines of Code'))
1129
-		f.write('<img src="lines_of_code.png" />')
1129
+		f.write('<img src="lines_of_code.png">')
1130 1130
 
1131 1131
 		fg = open(path + '/lines_of_code.dat', 'w')
1132 1132
 		for stamp in sorted(data.changes_by_date.keys()):
@@ -1373,14 +1373,13 @@ plot """
1373 1373
 
1374 1374
 	def printHeader(self, f, title = ''):
1375 1375
 		f.write(
1376
-"""<?xml version="1.0" encoding="UTF-8"?>
1377
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1378
-<html xmlns="http://www.w3.org/1999/xhtml">
1376
+"""<!DOCTYPE html>
1377
+<html>
1379 1378
 <head>
1379
+	<meta charset="UTF-8">
1380 1380
 	<title>GitStats - %s</title>
1381
-	<link rel="stylesheet" href="%s" type="text/css" />
1382
-	<meta name="generator" content="GitStats %s" />
1383
-	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
1381
+	<link rel="stylesheet" href="%s" type="text/css">
1382
+	<meta name="generator" content="GitStats %s">
1384 1383
 	<script type="text/javascript" src="sortable.js"></script>
1385 1384
 </head>
1386 1385
 <body>