put single line yaml info on one line
This commit is contained in:
parent
bcd4544692
commit
d74b056e11
1 changed files with 10 additions and 4 deletions
|
@ -20,13 +20,19 @@ record TestBase where
|
|||
run : IO Result
|
||||
|
||||
|
||||
private
|
||||
toLines1 : (String, String) -> List String
|
||||
toLines1 (k, v) =
|
||||
let vs = lines v in
|
||||
if length vs == 1
|
||||
then ["\{k}: \{v}"]
|
||||
else "\{k}: |" :: map (indent 2) vs
|
||||
|
||||
private
|
||||
toLines : Info -> List String
|
||||
toLines [] = []
|
||||
toLines xs =
|
||||
"---" ::
|
||||
concatMap (\(k, v) => "\{k}: |" :: map (indent 2) (lines v)) xs
|
||||
<+> ["..."]
|
||||
toLines xs = "---" :: concatMap toLines1 xs <+> ["..."]
|
||||
|
||||
|
||||
public export interface ToInfo e where toInfo : e -> Info
|
||||
|
||||
|
|
Loading…
Reference in a new issue