Rename the tidy target to clean-editor-files so it can't be confused with the dok...
[privoxy.git] / GNUmakefile.in
index a751094..19b3dcd 100644 (file)
@@ -1,8 +1,8 @@
 # Note:  Makefile is built automatically from Makefile.in
 #
-# $Id: GNUmakefile.in,v 1.198 2011/08/26 16:11:59 fabiankeil Exp $
+# $Id: GNUmakefile.in,v 1.201 2011/08/31 13:36:35 fabiankeil Exp $
 #
-# Written by and Copyright (C) 2001-2010 members of the
+# Written by and Copyright (C) 2001-2011 members of the
 # Privoxy team. http://www.privoxy.org/
 #
 # Based on the Internet Junkbuster originally written
@@ -142,6 +142,7 @@ PERL       = perl
 DOC_DIR    = doc/source
 DOC_TMP    = $(DOC_DIR)/tmp
 DOC_STATUS = @DOC_STATUS@
+TIDY       = tidy -modify -indent -clean -wrap 78
 
 # Program to do LF->CRLF
 #
@@ -606,7 +607,7 @@ config-file-alt:
 # moves dokumentation to webserver
 #
 #############################################################################
-webserver: tidy
+webserver: clean-editor-files
        @$(ECHO) -------------------------------------------------------
        @$(ECHO) You will need to "create" a SF shell first:
        @$(ECHO)    ssh -t SF-USER-ID,ijbswa@shell.sourceforge.net create
@@ -631,7 +632,7 @@ webserver: tidy
        @$(SSH) shell.sourceforge.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true'
        @$(SSH) shell.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true'
 
-web-actions: tidy
+web-actions: clean-editor-files
        @$(ECHO) Uploading 
        @cd doc/webserver/actions; \
           upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
@@ -657,6 +658,22 @@ dok-get:
        $(WGET) http://www.privoxy.org/docs/$(DOC_FILE) ;\
        $(TAR) -zxvf $(DOC_FILE)
 
+#############################################################################
+#
+# Try to clean up the generated HTML files.
+#
+# The files are a such a mess that some of them require two tidy runs
+# in row as the first abort prematurely. The vanilla tidy output renders
+# poorly as it contains a bit too much white-space, so we additionally run
+# the files through perl to fix this again.
+#
+#############################################################################
+dok-tidy:
+       for html_file in `find doc/webserver -name "*.html"`; do \
+               $(TIDY) $$html_file || $(TIDY) $$html_file; \
+               $(PERL) -i\'\' -e 's@^\s*<br>\s*$$@@; s@ +$$@@;' -n -p $$html_file; \
+       done
+
 
 #############################################################################
 # Source file dependencies
@@ -729,12 +746,12 @@ clean:
        $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action \
                `find . -name TAGS -o -name tags | $(GREP) -v .git` config.base config.tmp
 
-tidy:
+clean-editor-files:
        $(RM) `find . -name "*~"`
        $(RM) `find . -name "#*#"` # Emacs backup files
        $(RM) `find . -name ".\#*"`
 
-clobber: tidy
+clobber: clean-editor-files
        $(RM) GNUmakefile configure config.h.in config.h config.cache config.status config.log logfile \
               privoxy.log core *.tar.gz *.tar privoxy-cl.spec doc/source/ldp.dsl config.new
        $(RM) -r autom4te.cache