mirror of
https://github.com/srid/rib.git
synced 2024-11-29 19:09:55 +03:00
Cleanup TODOs
This commit is contained in:
parent
efc80f5157
commit
f8c1efb8c1
@ -146,14 +146,13 @@ detectReader ::
|
||||
m (ReaderOptions -> Text -> m1 Pandoc)
|
||||
detectReader f = do
|
||||
ext <-
|
||||
catchInMonadError (UnknownExtension . show) $
|
||||
liftEither . first (UnknownExtension . show) $
|
||||
fileExtension f
|
||||
liftEither $ maybeToRight (UnknownExtension ext) $
|
||||
liftEither . maybeToRight (UnknownExtension ext) $
|
||||
formats !? ext
|
||||
where
|
||||
formats :: Map String (ReaderOptions -> Text -> m1 Pandoc)
|
||||
formats =
|
||||
-- TODO: Expand this list, cf. `Text.Pandoc.Readers.readers`
|
||||
fromList
|
||||
[ (".md", readMarkdown),
|
||||
(".rst", readRST),
|
||||
@ -161,9 +160,6 @@ detectReader f = do
|
||||
(".tex", readLaTeX),
|
||||
(".ipynb", readIpynb)
|
||||
]
|
||||
-- Re-constrain code constrained by MonadThrow to be constrained by
|
||||
-- MonadError instead.
|
||||
catchInMonadError ef = either (throwError . ef) pure
|
||||
|
||||
-- | Flatten a Pandoc 'Meta' into a well-structured JSON object.
|
||||
--
|
||||
|
@ -96,7 +96,6 @@ readDocMulti pat = do
|
||||
mkDocumentFrom
|
||||
! #relpath f
|
||||
! #path (input </> f)
|
||||
-- TODO: Make error reporting nice, without Shake's stack trace ugliness.
|
||||
case result of
|
||||
Left e ->
|
||||
fail $ "Error converting " <> toFilePath f <> " to HTML: " <> show e
|
||||
|
Loading…
Reference in New Issue
Block a user