Skip to content

Commit 81f7ce6

Browse files
committed
Add quick Architecture doc + code flow diagram
[ci skip]
1 parent 968b348 commit 81f7ce6

File tree

10 files changed

+30
-2
lines changed

10 files changed

+30
-2
lines changed

ARCHITECTURE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Architecture
2+
3+
I'll have more later around this,
4+
but here are some quick hits:
5+
6+
## Basic concepts
7+
8+
* A **differ** figures out which operational sequencer to use.
9+
* An **operational sequencer** makes a comparison between two like data structures.
10+
and generates a set of operations between them
11+
(additions, deletions, or changes).
12+
* An **operation sequence** is a list of those operations
13+
associated with some kind of diff formatter.
14+
* A **diff formatter** takes a list of operations
15+
and spits out a textual representation of that list in the form of a conventional diff.
16+
* An **object inspector** generates a multi-line textual representation of an object,
17+
similar to PrettyPrinter in Ruby or AwesomePrint,
18+
but more appropriate for showing within a diff.
19+
20+
## Code flow diagram
21+
22+
[![code flow](./docs/code-flow-diagram.png)](https://docs.google.com/drawings/d/1nKi4YKXgzzIIM-eY0P4uwjkglmuwlf8nTRFne8QZhBg/edit)

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,9 @@ I'll try to respond as quickly as I can.
3535
I may have suggestions about code style or your approach,
3636
but hopefully everything looks good and your changes get merged!
3737
Now you're a contributor! 🎉
38+
39+
## Understanding the codebase
40+
41+
If you want to make a change
42+
but you're having trouble where to start,
43+
you might find the [Architecture](./ARCHITECTURE.md) document helpful.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ expect(actual).to eq(expected)
8585

8686
You would get output that looks like this:
8787

88-
![Before super_diff](doc/before.png)
88+
![Before super_diff](docs/before.png)
8989

9090
What this library does
9191
is to provide a diff engine
@@ -94,7 +94,7 @@ and display them in a sensible way.
9494
So, using the example above,
9595
you'd get this instead:
9696

97-
![After super_diff](doc/after.png)
97+
![After super_diff](docs/after.png)
9898

9999
## Installation
100100

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/code-flow-diagram.png

96.9 KB
Loading

0 commit comments

Comments
 (0)