瀏覽代碼

Produces valid XHTML/transitional now.

Added alts for imgs, missing ul tag, fixed CSS.
Heikki Hokkanen 18 年之前
父節點
當前提交
690a81dedc
共有 2 個文件被更改,包括 10 次插入14 次删除
  1. 10
    10
      statgit
  2. 0
    4
      statgit.css

+ 10
- 10
statgit 查看文件

@@ -321,7 +321,7 @@ class HTMLReportCreator(ReportCreator):
321 321
 			else:
322 322
 				f.write('<td>0.00</td>')
323 323
 		f.write('</tr></table>')
324
-		f.write('<img src="hour_of_day.png" />')
324
+		f.write('<img src="hour_of_day.png" alt="Hour of Day" />')
325 325
 		fg = open(path + '/hour_of_day.dat', 'w')
326 326
 		for i in range(0, 24):
327 327
 			if i in hour_of_day:
@@ -347,7 +347,7 @@ class HTMLReportCreator(ReportCreator):
347 347
 				f.write('<td>0</td>')
348 348
 			f.write('</tr>')
349 349
 		f.write('</table></div>')
350
-		f.write('<img src="day_of_week.png" />')
350
+		f.write('<img src="day_of_week.png" alt="Day of Week" />')
351 351
 		fp.close()
352 352
 
353 353
 		# Month of Year
@@ -363,7 +363,7 @@ class HTMLReportCreator(ReportCreator):
363 363
 			fp.write('%d %d\n' % (mm, commits))
364 364
 		fp.close()
365 365
 		f.write('</table></div>')
366
-		f.write('<img src="month_of_year.png" />')
366
+		f.write('<img src="month_of_year.png" alt="Month of Year" />')
367 367
 
368 368
 		# Commits by year/month
369 369
 		f.write('<h2>Commits by year/month</h2>')
@@ -371,7 +371,7 @@ class HTMLReportCreator(ReportCreator):
371 371
 		for yymm in reversed(sorted(data.commits_by_month.keys())):
372 372
 			f.write('<tr><td>%s</td><td>%d</td></tr>' % (yymm, data.commits_by_month[yymm]))
373 373
 		f.write('</table></div>')
374
-		f.write('<img src="commits_by_year_month.png" />')
374
+		f.write('<img src="commits_by_year_month.png" alt="Commits by year/month" />')
375 375
 		fg = open(path + '/commits_by_year_month.dat', 'w')
376 376
 		for yymm in sorted(data.commits_by_month.keys()):
377 377
 			fg.write('%s %s\n' % (yymm, data.commits_by_month[yymm]))
@@ -383,7 +383,7 @@ class HTMLReportCreator(ReportCreator):
383 383
 		for yy in reversed(sorted(data.commits_by_year.keys())):
384 384
 			f.write('<tr><td>%s</td><td>%d (%.2f%%)</td></tr>' % (yy, data.commits_by_year[yy], (100.0 * data.commits_by_year[yy]) / data.getTotalCommits()))
385 385
 		f.write('</table></div>')
386
-		f.write('<img src="commits_by_year.png" />')
386
+		f.write('<img src="commits_by_year.png" alt="Commits by Year" />')
387 387
 		fg = open(path + '/commits_by_year.dat', 'w')
388 388
 		for yy in sorted(data.commits_by_year.keys()):
389 389
 			fg.write('%d %d\n' % (yy, data.commits_by_year[yy]))
@@ -454,7 +454,7 @@ class HTMLReportCreator(ReportCreator):
454 454
 			fg.write('%s %d\n' % (datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d'), data.files_by_stamp[stamp]))
455 455
 		fg.close()
456 456
 			
457
-		f.write('<img src="files_by_date.png" />')
457
+		f.write('<img src="files_by_date.png" alt="Files by Date" />')
458 458
 
459 459
 		f.write('<h2>Average file size by date</h2>')
460 460
 
@@ -587,9 +587,9 @@ plot 'files_by_date.dat' using 1:2 smooth csplines
587 587
 
588 588
 	def printHeader(self, f):
589 589
 		f.write(
590
-"""<?xml version="1.0" encoding="utf-8"?>
591
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
592
-<html>
590
+"""<?xml version="1.0" encoding="UTF-8"?>
591
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
592
+<html xmlns="http://www.w3.org/1999/xhtml">
593 593
 <head>
594 594
 	<title>StatGit</title>
595 595
 	<link rel="stylesheet" href="statgit.css" type="text/css" />
@@ -600,6 +600,7 @@ plot 'files_by_date.dat' using 1:2 smooth csplines
600 600
 	def printNav(self, f):
601 601
 		f.write("""
602 602
 <div class="nav">
603
+<ul>
603 604
 <li><a href="index.html">General</a></li>
604 605
 <li><a href="activity.html">Activity</a></li>
605 606
 <li><a href="authors.html">Authors</a></li>
@@ -615,7 +616,6 @@ usage = """
615 616
 Usage: statgit [options] <gitpath> <outputpath>
616 617
 
617 618
 Options:
618
-  -o html
619 619
 """
620 620
 
621 621
 if len(sys.argv) <  3:

+ 0
- 4
statgit.css 查看文件

@@ -66,10 +66,6 @@ td {
66 66
 	margin: 0.5em;
67 67
 }
68 68
 
69
-.nav:hover li a {
70
-	background-color: #ddd;
71
-}
72
-
73 69
 .nav li a:hover {
74 70
 	background-color: #ddd;
75 71
 	border-bottom: 1px solid #cc9;