1- [ ![ Build Status] ( https://travis-ci.org/jfcherng/php-diff.svg?branch=v6 )] ( https://travis-ci.org/jfcherng/php-diff )
2- [ ![ Codacy Badge] ( https://api.codacy.com/project/badge/Grade/3a7a07d2ed67434e8e8582ea4ec9867b )] ( https://app.codacy.com/app/jfcherng/php-diff?utm_source=github.com&utm_medium=referral&utm_content=jfcherng/php-diff&utm_campaign=Badge_Grade_Dashboard )
3-
41# php-diff
52
3+ <a href =" https://travis-ci.org/jfcherng/php-diff " ><img alt =" Travis (.org) branch " src =" https://img.shields.io/travis/jfcherng/php-diff/v6 " ></a >
4+ <a href =" https://app.codacy.com/project/jfcherng/php-diff/dashboard " ><img alt =" Codacy grade " src =" https://img.shields.io/codacy/grade/3a7a07d2ed67434e8e8582ea4ec9867b/v6 " ></a >
5+ <a href =" https://packagist.org/packages/jfcherng/php-diff " ><img alt =" Packagist " src =" https://img.shields.io/packagist/dt/jfcherng/php-diff " ></a >
6+ <a href =" https://packagist.org/packages/jfcherng/php-diff " ><img alt =" Packagist Version " src =" https://img.shields.io/packagist/v/jfcherng/php-diff " ></a >
7+ <a href =" https://github.com/jfcherng/php-diff/blob/v6/LICENSE " ><img alt =" Project license " src =" https://img.shields.io/github/license/jfcherng/php-diff " ></a >
8+ <a href =" https://github.com/jfcherng/php-diff/stargazers " ><img alt =" GitHub stars " src =" https://img.shields.io/github/stars/jfcherng/php-diff?logo=github " ></a >
9+ <a href =" https://www.paypal.me/jfcherng/5usd " title =" Donate to this project using Paypal " ><img src =" https://img.shields.io/badge/paypal-donate-blue.svg?logo=paypal " /></a >
10+
611A comprehensive library for generating diff between two strings.
712
813
9- # Introduction
14+ ## Introduction
1015
1116Generated diff can be rendered in all of the standard formats including:
1217
@@ -20,20 +25,20 @@ Note that for HTML rendered results, you have to add CSS for a better visualizat
2025You may modify one from ` example/diff-table.css ` or write your own from zero.
2126
2227
23- # Requirements
28+ ## Requirements
2429
25- - PHP >= 7 .1.3
26- - Extension: ` iconv ` (usually as a built-in in PHP )
30+ ![ php ] ( https://img.shields.io/badge/php-%5E7 .1.3-blue )
31+ ![ ext- iconv] ( https://img.shields.io/badge/ext-iconv-brightgreen )
2732
2833
29- # Installation
34+ ## Installation
3035
31- ```
36+ ``` bash
3237$ composer require jfcherng/php-diff
3338```
3439
3540
36- # Example
41+ ## Example
3742
3843See [ example/demo.php] ( https://github.com/jfcherng/php-diff/blob/v6/example/demo.php ) and files under ` tests/ ` .
3944
@@ -98,10 +103,10 @@ $result = $renderer->render($differ);
98103```
99104
100105
101- # Rendered Results
106+ ## Rendered Results
102107
103108
104- ## HTML Diff In-line Detailed Rendering
109+ ### HTML Diff In-line Detailed Rendering
105110
106111<table >
107112 <tr >
@@ -123,17 +128,17 @@ $result = $renderer->render($differ);
123128</table >
124129
125130
126- ## Renderer: Inline
131+ ### Renderer: Inline
127132
128133![ Inline] ( https://raw.githubusercontent.com/jfcherng/php-diff/v6/example/images/inline-renderer.png )
129134
130135
131- ## Renderer: Side By Side
136+ ### Renderer: Side By Side
132137
133138![ Side By Side] ( https://raw.githubusercontent.com/jfcherng/php-diff/v6/example/images/side-by-side-renderer.png )
134139
135140
136- ## Renderer: Unified
141+ ### Renderer: Unified
137142
138143``` diff
139144@@ -1,3 +1,4 @@
@@ -153,7 +158,9 @@ $result = $renderer->render($differ);
153158```
154159
155160
156- ## Renderer: Context
161+ ### Renderer: Context
162+
163+ <details ><summary >Click to expand</summary >
157164
158165```
159166***************
@@ -182,8 +189,10 @@ $result = $renderer->render($differ);
182189 Say hello to my neighbors.
183190```
184191
192+ </details >
185193
186- ## Renderer: JSON
194+
195+ ### Renderer: JSON
187196
188197<details ><summary >Click to expand</summary >
189198
@@ -328,17 +337,12 @@ $result = $renderer->render($differ);
328337 ]
329338]
330339```
340+
331341</details >
332342
333343
334- # Acknowledgment
344+ ## Acknowledgment
335345
336346This package is built on the top of [ chrisboulton/php-diff] ( https://github.com/chrisboulton/php-diff ) initially.
337347But the original repository looks like no longer maintained.
338348Here have been quite lots of rewrites and new features since then, hence I re-started this as a new package for better visibility.
339-
340-
341- Supporters <a href =" https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ATXYY9Y78EQ3Y " target =" _blank " ><img src =" https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif " /></a >
342- ==========
343-
344- Thank you guys for sending me some cups of coffee.
0 commit comments