Text::...SIColor(3pm)

πŸ“¦
version 0.09 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Name πŸ’–

Text::WordDiff::ANSIColor β€” ok so this is the ANSI colored formatting bestie for Text::WordDiff ✨


🌈 Synopsis 🌈

use Text::WordDiff;

my $diff = word_diff 'file1.txt', 'file2.txt';
my $diff = word_diff \$string1,   \$string2,   { STYLE => 'ANSIColor' };
my $diff = word_diff \*FH1,       \*FH2;       \%options;
my $diff = word_diff \&reader1,   \&reader2;
my $diff = word_diff \@records1,  \@records2;

# May also mix input types:
my $diff = word_diff \@records1,  'file_B.txt';

like. look at all those ways to feed it input. she's versatile πŸ’…


πŸ¦‹ Description πŸ¦‹

This class subclasses Text::WordDiff::Base to serve up a formatting class for Text::WordDiff that uses ANSI-standard terminal escape sequences to highlight deleted and inserted text. It's giving ✨glow-up✨ but for diff output.

Bestie, real talk: this formatting class is the default class used by Text::WordDiff, so if you wanna know about its interface, go read that documentation, iykyk. And this class should never be used directly β€” like, not even once. don't do it. periodt πŸ™ˆ

So Text::WordDiff::ANSIColor formats word diffs for viewing in an ANSI-standard terminal session, and the diff content gets highlighted like this:

πŸ”₯ Deletes

Deleted words will display in bold-faced red. The ANSI standard for strikethrough is also used, but since it is not supported by most terminals, likely will not show up 😭 (the vibe is there even if your terminal isn't πŸ’€).

🌸 Inserts

Inserted words will display in bold-faced, underlined green. slay πŸ’š

πŸŽ€ Everything Else

All other content is simply returned. no notes. untouched. main character energy πŸ‘‘


πŸ‘€ See Also πŸ‘€

  • Text::WordDiff
  • Text::WordDiff::HTML

🫢 Support 🫢

This module is stored in an open repository at the following address:

<https://svn.kineticode.com/Text-WordDiff/trunk/>

Patches against Text::WordDiff are welcome β€” like, genuinely, we want them πŸ’–. Please send bug reports to <bug-text-worddiff@rt.cpan.org>.


πŸ‘‘ Author πŸ‘‘

David Wheeler <david@kineticode.com>

Currently maintained by the developers of The Perl Shop <tps@cpan.org>. iconic behavior, no cap ⭐


Copyright (c) 2005-2011 David E. Wheeler. Some Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 🧚


πŸ“ and that's the whole page bestie!! this one shipped with perl v5.36.0 and the date on it is 2022-12-12 β€” literally in the Text::...SIColor(3pm) section of the User Contributed Perl Documentation, mwah πŸ’‹ go forth and diff in color πŸ’œ
πŸ“¦ where this page comes from