Diff Tools

R

ranjithkumar

Our repository holds a big chunk of HTML files. I would like to see
the diff of the html files across versions. I would like to have the
diffs without the html tags on it.

Is there anything available or any idea to build the tool would be very
useful.

Cheers
Randll
 
J

John Bokma

Our repository holds a big chunk of HTML files. I would like to see
the diff of the html files across versions. I would like to have the
diffs without the html tags on it.

I would say: check it all in into subversion, oldest files first, then
overwrite them with the next oldest files, check in, etc.

You can then do diffs between versions. However, HTML tags are made visible
in each. I myself see no point in stripping out the HTML, but an option
might be to strip off the tags, and also check the resulting text files in,
so my recipe then would be:

create a directory
store the oldest HTML files in it
run a strip HTML script and save output as text
check all files in

store the next oldests HTML files in the directory
run the strip script
check in

etc.

(If you do this on Windows, I recommend to use TortoiseSVN for version
control, since it gives visual feedback in the Explorer).
 
J

Joe Smith

Our repository holds a big chunk of HTML files. I would like to see
the diff of the html files across versions. I would like to have the
diffs without the html tags on it.

nohtml file1.html >file1.txt
nohtml file2.html >file2.txt
diff -u file1.txt file2.txt
-Joe

#!/usr/bin/perl
# Name: nohtml Author: (e-mail address removed) 07-Nov-2001
# Purpose: Extracts just the text portions of a document.
# I use '|nohtml|less -s' inside of mutt to handle messages in HTML.

use strict; use warnings;
use HTML::parser ();

sub text_handler { # Ordinary text
print @_;
}

my $p = HTML::parser->new(api_version => 3);
$p->handler( text => \&text_handler, "dtext");
$p->parse_file(shift || "-") || die $!;
1;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top