Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add link to readable source

  • Loading branch information...
commit 3e0cb2a405f17d31be93af9e7e940f8244a5d6a3 1 parent d06da80
Mark Pilgrim authored
Showing with 6 additions and 2 deletions.
  1. +1 −1  .hgignore
  2. +5 −1 util/htmlminimizer.py
View
2  .hgignore
@@ -3,4 +3,4 @@ syntax: glob
build
grid28.gif
copyedit
-
+proofs
View
6 util/htmlminimizer.py
@@ -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 @@
_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)))
+
Please sign in to comment.
Something went wrong with that request. Please try again.