any {split,unified} {diff,interdiff} can be rendered by adhering to this interface.
+31
types/diff_renderer.go
+31
types/diff_renderer.go
···
1
+
package types
2
+
3
+
import "tangled.org/core/appview/filetree"
4
+
5
+
type DiffRenderer interface {
6
+
// list of file affected by these diffs
7
+
ChangedFiles() []DiffFileRenderer
8
+
9
+
// filetree
10
+
FileTree() *filetree.FileTreeNode
11
+
12
+
Stats() DiffStat
13
+
}
14
+
15
+
type DiffFileRenderer interface {
16
+
// html ID for each file in the diff
17
+
Id() string
18
+
19
+
// produce a splitdiff
20
+
Split() SplitDiff
21
+
22
+
// stats for this single file
23
+
Stats() DiffFileStat
24
+
25
+
// old and new name of file
26
+
Names() DiffFileName
27
+
28
+
// whether this diff can be displayed,
29
+
// returns a reason if not, and the empty string if it can
30
+
CanRender() string
31
+
}
History
2 rounds
0 comments
1 commit
expand
collapse
types: add interfaces for a generic, renderable diff
any {split,unified} {diff,interdiff} can be rendered by adhering to this
interface.
2/3 failed, 1/3 success
expand
collapse
expand 0 comments
pull request successfully merged
1 commit
expand
collapse
types: add interfaces for a generic, renderable diff
any {split,unified} {diff,interdiff} can be rendered by adhering to this
interface.