Show path for which page has parse error.

This commit is contained in:
Dillon Kearns 2019-07-23 15:53:05 -07:00
parent 436ee1e3ac
commit 077636fa62

View File

@ -95,12 +95,15 @@ buildAllData record =
Err (renderErrors errors)
renderErrors : List Mark.Error.Error -> Element msg
renderErrors errors =
errors
renderErrors : ( List String, List Mark.Error.Error ) -> Element msg
renderErrors ( path, errors ) =
Element.column []
[ Element.text (path |> String.join "/")
, errors
|> List.map (Mark.Error.toHtml Mark.Error.Light)
|> List.map Element.html
|> Element.column []
]
combineResults :
@ -117,7 +120,7 @@ combineResults :
}
)
->
Result (List Mark.Error.Error)
Result ( List String, List Mark.Error.Error )
(List
( List String
, { body : List (Element msg)
@ -135,9 +138,9 @@ combineResults list =
Mark.Almost partial ->
-- Err "Almost"
Err partial.errors
Err ( path, partial.errors )
Mark.Failure failures ->
Err failures
Err ( path, failures )
)
|> Result.Extra.combine