[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#721245: ITP: libtext-diff-html-perl -- Format Text::Diff output in (X)HTML+CSS



Jonas Smedegaard wrote:
> Quoting Axel Beckert (2013-08-29 13:49:18)
> > Text::Diff::HTML subclasses Text::Diff::Unified, a formatting class 
> > provided by the Text::Diff module, to add XHTML markup to the unified 
> > diff format.
> > 
> > Together with some suitable CSS (an example is provided) this allows 
> > to included a colored version of diffs generated with Text::Diff in 
> > web pages etc.
> 
> There is already libstring-diff-perl seemingly doing same task.

Ah, thanks for this hint!

> If both are relevant, then perhaps we should try figure out the 
> differences and improve the long descriptions.

>From the man page of String::Diff and from what I know about
Text::Diff and Text::Diff::HTML, I see the following differences:

String:Diff allows you much more flexibility but also expects from you
way more configuration, i.e. you seem to always have to give opening
and closing HTML tags for additions and removals explicitly. At least
the synopsis looks like getting something  comparable to Text::Diff::HTML
with String::Diff would be quite some configuration work.

Text:Diff::HTML already knows about practical HTML tags (the same as
suggested in String::Diff's examples :-) for this purpose so you only
need an appropriate CSS. There's one in the distribution included, so
the only thing you have to yourself here is calling Text::Diff::diff
on two strings, say yoyu want HTML output and include the CSS.

Short said, String::Diff is extremely flexible and tedious, Text::Diff::HTML
does only one thing, but DWIM and out of the box. String::Diff seems
more a framework, Text::Diff::HTML only a renderer (for Text::Diff).

And I actually was looking for a Text::Diff renderer for HTML output
as we already use Text::Diff, partially via Test::Differences.

So despite I am happy about the alternative and despite I see the
similarities, I also see that String::Diff can't really provide what I
was looking for. So I'd say, I go on.

But yes, we should check the descriptions, the long as well as short
ones and highlight the differences.

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5


Reply to: