On Tue, May 18, 1999 at 05:59:36PM +0200, Jean-Marc Lasgouttes wrote:
> 
> I was just thinking about comparing two documents and seeing
> additions/deletions, like diff does for text file.
> 

This sounds Hard. Do tools like this exist for, say, HTML? If so, we could
probably steal them.

What are the problems?

- word wrap. I did some work on a perl diff (Algorithm::Diff in CPAN). We
  had talked about the possibility of a "word-based" diff. In fact, I think
someone (Jean-Marc?) said a wdiff already exists. Alternatively, we could
make all paragraphs into one line and then run the diff. If you want to
display the differences as a LyX document (um, how *do* we want to display
this?) then you need to make the diff paragraph-based. Or be more
sophisticated and highlight the portions you've changed in certain colors
(like the CVSweb color diff, but better!).

- character formatting. Ouch. This is actually several problems.  (1) add an
  italicized word to a regular paragraph.  (2) add a word (in italics) to an
italicized paragraph.  (3) change a word from regular print to italics.
Um, I suppose you could remove all character formatting and just compare
text, which would be better than nothing.


Ah. I've been thinking of doing the diff outside of LyX, of some version of
a diff on the text of a LyX file. To do it within LyX
has a different set of problems. For example, you have character formatting
information on each character, making comparison easier. But you'll need to
steal the GNUdiff algorithm and put it into LyX. Ugh.

Yup. Sounds Hard.

-Amir

Reply via email to