add link to readable source

This commit is contained in:
Mark Pilgrim
2009-09-27 11:23:26 -04:00
parent d06da808f7
commit 3e0cb2a405
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -3,4 +3,4 @@ syntax: glob
build
grid28.gif
copyedit
proofs
+5 -1
View File
@@ -1,9 +1,11 @@
#!/usr/bin/python3
"""Quick-and-dirty HTML minimizer"""
import sys
import re
import html.entities
import itertools
import os.path
_SERVERS = ['a.wearehugh.com',
'b.wearehugh.com',
@@ -52,4 +54,6 @@ with open(output_file, 'w', encoding="utf-8") as _out, open(input_file, encoding
_out.write(line)
else:
_out.write(g)
if g.lower() == '<!doctype html>':
_out.write('\n<!-- readable source @ http://hg.diveintopython3.org/hgweb.cgi/file/tip/{0} -->\n'.format(os.path.basename(input_file)))