2016-01-14 21:18:40 +03:00
|
|
|
module Renderer where
|
|
|
|
|
2016-02-29 05:29:59 +03:00
|
|
|
import Data.Functor.Both
|
2016-01-14 21:18:40 +03:00
|
|
|
import Diff
|
2016-03-31 00:26:52 +03:00
|
|
|
import Info
|
2016-01-14 21:18:40 +03:00
|
|
|
import Source
|
2016-04-05 00:20:26 +03:00
|
|
|
import Data.Text
|
2016-01-14 21:18:40 +03:00
|
|
|
|
|
|
|
-- | A function that will render a diff, given the two source files.
|
2016-04-05 00:20:26 +03:00
|
|
|
type Renderer a = Diff a Info -> Both SourceBlob -> Text
|
2016-04-01 22:34:52 +03:00
|
|
|
|
|
|
|
data DiffArguments = DiffArguments { format :: Format, output :: Maybe FilePath, outputPath :: FilePath }
|
|
|
|
|
|
|
|
-- | The available types of diff rendering.
|
|
|
|
data Format = Split | Patch | JSON
|