Skip to content

Commit

Permalink
Cut HTML Unified Renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiLive authored and DigiLive committed Nov 21, 2020
1 parent 532bd4a commit 1ba255f
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 353 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ directory. Included is a light and a dark theme.

![HTML Inline Example](assets/htmlInline.png "HTML Inline Example")

#### HTML Unified Example

![HTML Unified Example](assets/htmlUnified.png "HTML Unified Example")

#### Text Unified Example

![Text Unified Example](assets/textUnified.png "Text Unified Example")
Expand Down
Binary file removed assets/htmlUnified.png
Binary file not shown.
62 changes: 0 additions & 62 deletions example/dark-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,65 +153,3 @@ a, a:visited {
.DifferencesMerged th.ChangeDelete {
background-image: linear-gradient(-45deg, #AAAAAA 0%, #EE9999 100%);
}

/*
* HTML Unified Diff
*/

/* Line removed in new */
.DifferencesUnified .ChangeDelete .Left::before {
content: "- \00a0";
}

.DifferencesUnified .ChangeDelete .Left {
background: #EE9999;
color: #272822;
}

/* Line modified in old and new */
.DifferencesUnified .ChangeReplace {
background: #FFEE99;
color: #272822;
display: table;
}

/* Line in old replaced by line in new */
.DifferencesUnified .ChangeReplace .Left:first-child:before {
content: "\250C \00a0";
}

.DifferencesUnified .ChangeReplace .Left:before {
content: "\251C \00a0";
}

.DifferencesUnified .ChangeReplace .Left {
background: #FFEE99;
}

/* Line in new replaced line in old */
.DifferencesUnified .ChangeReplace .Right:last-of-type:before {
content: "\2514 \00a0";
}

.DifferencesUnified .ChangeReplace .Right:before {
content: "\251C \00a0";
}

.DifferencesUnified .ChangeReplace .Right {
background: #FFEE99;
}

/* Line inserted in new */
.DifferencesUnified .ChangeInsert .Right:before {
content: "+ \00A0";
}

/* Character inserted in line of new */
.DifferencesUnified .ChangeReplace ins {
background: #99EE99;
}

/* Character removed from line in old */
.DifferencesUnified .ChangeReplace del {
background: #EE9999;
}
8 changes: 0 additions & 8 deletions example/example.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use jblond\Diff\Renderer\Html\Inline;
use jblond\Diff\Renderer\Html\Merged;
use jblond\Diff\Renderer\Html\SideBySide;
use jblond\Diff\Renderer\Html\Unified as HtmlUnified;
use jblond\Diff\Renderer\Text\Context;
use jblond\Diff\Renderer\Text\Unified;

Expand Down Expand Up @@ -99,13 +98,6 @@ function changeCSS(cssFile, cssLinkIndex) {
echo $diff->isIdentical() ? 'No differences found.' : $diff->Render($renderer);
?>

<h2>HTML Unified Diff</h2>
<?php
// Generate a unified diff.
$renderer = new HtmlUnified($rendererOptions);
echo $diff->isIdentical() ? 'No differences found.' : '<pre>' . $diff->Render($renderer) . '</pre>';
?>

<h2>Text Unified Diff</h2>
<?php
// Generate a unified diff.
Expand Down
60 changes: 0 additions & 60 deletions example/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,63 +132,3 @@ pre {
.DifferencesMerged th.ChangeDelete {
background-image: linear-gradient(-45deg, #CCCCCC 0%, #EE9999 100%);
}

/*
* HTML Unified Diff
*/

/* Line removed in new */
.DifferencesUnified .ChangeDelete .Left::before {
content: "- \00a0";
}

.DifferencesUnified .ChangeDelete .Left {
background: #CCCCCC;
}

/* Line modified in old and new */
.DifferencesUnified .ChangeReplace {
display: table;
background: #FFEE99;
}

/* Line in old replaced by line in new */
.DifferencesUnified .ChangeReplace .Left:first-child:before {
content: "\250C \00a0";
}

.DifferencesUnified .ChangeReplace .Left:before {
content: "\251C \00a0";
}

.DifferencesUnified .ChangeReplace .Left {
background: #FFEE99;
}

/* Line in new replaced line in old */
.DifferencesUnified .ChangeReplace .Right:last-of-type:before {
content: "\2514 \00a0";
}

.DifferencesUnified .ChangeReplace .Right:before {
content: "\251C \00a0";
}

.DifferencesUnified .ChangeReplace .Right {
background: #FFEE99;
}

/* Line inserted in new */
.DifferencesUnified .ChangeInsert .Right:before {
content: "+ \00A0";
}

/* Character inserted in line of new */
.DifferencesUnified .ChangeReplace ins {
background: #99EE99;
}

/* Character removed from line in old */
.DifferencesUnified .ChangeReplace del {
background: #EE9999;
}
8 changes: 1 addition & 7 deletions lib/jblond/Diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
namespace jblond;

use InvalidArgumentException;
use jblond\Diff\Renderer\Html\Inline;
use jblond\Diff\Renderer\Html\SideBySide;
use jblond\Diff\Renderer\Html\Unified as UnifiedHtml;
use jblond\Diff\Renderer\Text\Context;
use jblond\Diff\Renderer\Text\Unified;
use jblond\Diff\SequenceMatcher;
use jblond\Diff\Similarity;
use OutOfRangeException;
Expand Down Expand Up @@ -179,8 +174,7 @@ public function getVersion2(): array
/**
* Render a diff-view using a rendering class and get its results.
*
* @param object|Context|Unified|UnifiedHtml|Inline|SideBySide $renderer An instance of the rendering object,
* used for generating the diff-view.
* @param object $renderer An instance of the rendering object, used for generating the diff-view.
*
* @return mixed The generated diff-view. The type of the return value depends on the applied renderer.
*/
Expand Down
189 changes: 0 additions & 189 deletions lib/jblond/Diff/Renderer/Html/Unified.php

This file was deleted.

Loading

0 comments on commit 1ba255f

Please sign in to comment.