Skip to content
This repository
Browse code

add link to readable source

  • Loading branch information...
commit 3e0cb2a405f17d31be93af9e7e940f8244a5d6a3 1 parent d06da80
authored September 27, 2009
2  .hgignore
@@ -3,4 +3,4 @@ syntax: glob
3 3
 build
4 4
 grid28.gif
5 5
 copyedit
6  
-
  6
+proofs
6  util/htmlminimizer.py
... ...
@@ -1,9 +1,11 @@
  1
+#!/usr/bin/python3
1 2
 """Quick-and-dirty HTML minimizer"""
2 3
 
3 4
 import sys
4 5
 import re
5 6
 import html.entities
6 7
 import itertools
  8
+import os.path
7 9
 
8 10
 _SERVERS = ['a.wearehugh.com',
9 11
             'b.wearehugh.com',
@@ -52,4 +54,6 @@
52 54
             _out.write(line)
53 55
         else:
54 56
             _out.write(g)
55  
-    
  57
+        if g.lower() == '<!doctype html>':
  58
+            _out.write('\n<!-- readable source @ http://hg.diveintopython3.org/hgweb.cgi/file/tip/{0} -->\n'.format(os.path.basename(input_file)))
  59
+

0 notes on commit 3e0cb2a

Please sign in to comment.
Something went wrong with that request. Please try again.