Skip to content

Commit d515424

Browse files
authored
how to diff
1 parent 2e245f8 commit d515424

File tree

1 file changed

+80
-4
lines changed

1 file changed

+80
-4
lines changed

FAQ.md

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,83 @@ Unfortunately, unlike [AsciiDoc](https://docs.asciidoctor.org/asciidoc/latest/ve
127127

128128
Alternatively what you can do is:
129129

130-
- Take a screenshot and add a red rectangle and arrows, then include the image in Markdown
131-
- Make a diff between the original exploit and the one you modified, then create a code block with `diff` as a language for syntax highlight
132-
- Write paragraphs and illustrate with short code blocks including the lines you changed
133-
- Using a more complex solution with Lua filters to introduce a markup for line highlight, e.g. https://github.com/jgm/pandoc/issues/7743
130+
1. Take a screenshot and add a red rectangle and arrows, then include the image in Markdown
131+
2. Make a diff between the original exploit and the one you modified, then create a code block with `diff` as a language for syntax highlight
132+
3. Write paragraphs and illustrate with short code blocks including the lines you changed
133+
4. Using a more complex solution with Lua filters to introduce a markup for line highlight, e.g. https://github.com/jgm/pandoc/issues/7743
134+
135+
About option 2.:
136+
137+
File `nota.a`:
138+
139+
```text
140+
Hi,
141+
142+
I am noraj.
143+
144+
I hope you enjoy writing your report.
145+
146+
Cheers,
147+
148+
noraj
149+
```
150+
151+
File `note.b`:
152+
153+
```text
154+
Hello,
155+
156+
I am the great noraj.
157+
158+
I wish you a good reporting time.
159+
160+
Regards,
161+
162+
noraj
163+
```
164+
165+
Command: `diff -u note.a note.b`
166+
167+
Output of the command formated into a Markdown fenced code block with `diff` language class:
168+
169+
~~~text
170+
```diff
171+
--- toto.a 2024-07-16 01:18:09.234602615 +0200
172+
+++ toto.b 2024-07-16 01:18:55.269563085 +0200
173+
@@ -1,9 +1,9 @@
174+
-Hi,
175+
+Hello,
176+
177+
-I am noraj.
178+
+I am the great noraj.
179+
180+
-I hope you enjoy writing your report.
181+
+I wish you a good reporting time.
182+
183+
-Cheers,
184+
+Regards,
185+
186+
noraj
187+
```
188+
~~~
189+
190+
Display of the rendered diff code block:
191+
192+
```diff
193+
--- toto.a 2024-07-16 01:18:09.234602615 +0200
194+
+++ toto.b 2024-07-16 01:18:55.269563085 +0200
195+
@@ -1,9 +1,9 @@
196+
-Hi,
197+
+Hello,
198+
199+
-I am noraj.
200+
+I am the great noraj.
201+
202+
-I hope you enjoy writing your report.
203+
+I wish you a good reporting time.
204+
205+
-Cheers,
206+
+Regards,
207+
208+
noraj
209+
```

0 commit comments

Comments
 (0)