-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 Output delta diff results to file (#1)
* Add deltabae.sh * Add example. * Wrote shebang.
- Loading branch information
Showing
5 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/zsh | ||
mkdir -p ./tmp && delta ./a.txt ./b.txt --side-by-side --syntax-theme="Nord" --zero-style="#333" | ansifilter --html --encoding "utf-8" > ./tmp/diff.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Example Usage | ||
|
||
This directory contains examples of how to use the deltabae.sh script in the parent directory. | ||
|
||
## Files | ||
|
||
- `a.txt`, `b.txt`: Text files to be compared. | ||
- `diff.html` (to be generated): This file will be generated after running the script. It contains the side-by-side diff of `a.txt` and `b.txt` with syntax highlighting. | ||
|
||
<!-- TODO: Change to accept arguments --> | ||
|
||
## Steps to Run the Example | ||
|
||
1. Navigate to the parent directory: `cd ..` | ||
2. Run the deltabae.sh script: `bash deltabae.sh` | ||
3. Open the generated `diff.html` file in a web browser to view the output. | ||
|
||
The `diff.html` file should show the differences between `a.txt` and `b.txt` in a side-by-side format with syntax highlighting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
hoge | ||
fuga | ||
piyo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
hoge | ||
fugafuga | ||
hogera |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<style type="text/css"> | ||
pre { | ||
font-family:Courier New; | ||
font-size:10pt; | ||
} | ||
|
||
.af_line { | ||
color: gray; | ||
text-decoration: none; | ||
} | ||
|
||
</style> | ||
<title>Source file</title> | ||
</head> | ||
<body> | ||
<pre> | ||
<span style="color:#0000ee;">Δ ./a.txt ⟶ ./b.txt</span> | ||
<span style="color:#0000ee;">────────────────────────────────────────────────────────────────────────────────</span> | ||
|
||
<span style="color:#0000ee;">─────</span><span style="color:#0000ee;">┐</span> | ||
<span style="color:#0000ee;">•</span> <span style="color:#0000ee;">1</span>: <span style="color:#0000ee;">│</span> | ||
<span style="color:#0000ee;">─────</span><span style="color:#0000ee;">┘</span> | ||
<span style="color:#0000ee;">│</span><span style="color:#444444;"> 1 </span><span style="color:#0000ee;">│</span><span style="color:#000000;">hoge</span> <span style="color:#0000ee;">│</span><span style="color:#444444;"> 1 </span><span style="color:#0000ee;">│</span><span style="color:#000000;">hoge</span> | ||
<span style="color:#0000ee;">│</span><span style="color:#870000;"> 2 </span><span style="color:#0000ee;">│</span><span style="color:#dadada;background-color:#5f0000;">fuga</span><span style="background-color:#5f0000;"> </span><span style="color:#0000ee;">│</span><span style="color:#008700;"> </span><span style="color:#0000ee;">│</span> | ||
<span style="color:#0000ee;">│</span><span style="color:#870000;"> 3 </span><span style="color:#0000ee;">│</span><span style="color:#dadada;background-color:#5f0000;">piyo</span><span style="background-color:#5f0000;"> </span><span style="color:#0000ee;">│</span><span style="color:#008700;"> </span><span style="color:#0000ee;">│</span> | ||
<span style="color:#0000ee;">│</span><span style="color:#870000;"> </span><span style="color:#0000ee;">│</span> <span style="color:#0000ee;">│</span><span style="color:#008700;"> 2 </span><span style="color:#0000ee;">│</span><span style="color:#dadada;background-color:#1c1c1c;">fugafuga</span><span style="background-color:#1c1c1c;"> </span> | ||
<span style="color:#0000ee;">│</span><span style="color:#870000;"> </span><span style="color:#0000ee;">│</span> <span style="color:#0000ee;">│</span><span style="color:#008700;"> 3 </span><span style="color:#0000ee;">│</span><span style="color:#dadada;background-color:#1c1c1c;">hogera</span><span style="background-color:#1c1c1c;"> </span> | ||
</pre> | ||
</body> | ||
</html> | ||
<!--HTML generated by ansifilter 2.20, http://www.andre-simon.de/--> |