1Text::WordDiff::HTMLTwoULsienresC(o3nptmr)ibuted Perl DoTceuxmte:n:tWaotridoDniff::HTMLTwoLines(3pm)
2
3
4
6 Text::WordDiff::HTMLTwoLines - XHTML formatting for Text::WordDiff with
7 content on two lines
8
10 use Text::WordDiff;
11
12 my $diff = word_diff 'file1.txt', 'file2.txt'; { STYLE => 'HTMLTwoLines' };
13 my $diff = word_diff \$string1, \$string2, { STYLE => 'HTMLTwoLines' };
14 my $diff = word_diff \*FH1, \*FH2, { STYLE => 'HTMLTwoLines' };
15 my $diff = word_diff \&reader1, \&reader2, { STYLE => 'HTMLTwoLines' };
16 my $diff = word_diff \@records1, \@records2, { STYLE => 'HTMLTwoLines' };
17
18 # May also mix input types:
19 my $diff = word_diff \@records1, 'file_B.txt', { STYLE => 'HTMLTwoLines' };
20
22 This class subclasses Text::WordDiff::Base to provide a XHTML
23 formatting for Text::WordDiff. See Term::WordDiff for usage details.
24 This class should never be used directly.
25
26 Text::WordDiff::HTMLTwoLines formats word diffs for viewing in a Web
27 browser. The output is similar to that produced by
28 Term::WordDiff::HTML but the two lines (or files, records, etc.) are
29 shown separately, with deleted items highlighted in the first line and
30 inserted items highlighted in the second. HTMLTwoLines puts a span tag
31 around each word or set of words in the diff.
32
33 The diff content is highlighted as follows:
34
35 • "<div class="file">"
36
37 The inputs to word_diff() are each contained in a div element of
38 class "file". All the following results are subsumed by these
39 elements.
40
41 • "<span class="fileheader">"
42
43 The header section for the files being "diff"ed, usually
44 something like:
45
46 --- in.txt Thu Sep 1 12:51:03 2005
47
48 for the first file, and
49
50 +++ out.txt Thu Sep 1 12:52:12 2005
51
52 for the second.
53
54 This element immediately follows the opening "file" "<div>"
55 element, but will not be present if Text::WordDiff cannot
56 determine the file names for both files being compared.
57
58 • "<span class="hunk">"
59
60 This element contains a single diff "hunk". Each hunk may
61 contain the following elements:
62
63 • "<ins>"
64
65 Inserted content.
66
67 • "<del>"
68
69 Deleted content.
70
71 You may do whatever you like with these elements and classes; I highly
72 recommend that you style them using CSS. You'll find an example CSS
73 file in the eg directory in the Text-WordDiff distribution.
74
76 Text::WordDiff
77 Text::WordDiff::ANSIColor
78 Text::WordDiff::ANSIColor
79
81 Amelia Ireland <join(".", $firstname, $lastname) . "@gmail.com">
82
83 Currently maintained by the developers of The Perl Shop <tps@cpan.org>.
84
86 Copyright (c) 2011 Amelia Ireland. Some Rights Reserved.
87
88 This module is free software; you can redistribute it and/or modify it
89 under the same terms as Perl itself.
90
91
92
93perl v5.38.0 2023-07-21 Text::WordDiff::HTMLTwoLines(3pm)