1
1
mirror of https://github.com/srid/rib.git synced 2024-11-30 03:45:00 +03:00

Remove named arguments from type class

Not useful anymore
This commit is contained in:
Sridhar Ratnakumar 2019-12-29 17:47:34 -05:00
parent 521a396531
commit d71d7f83f3
4 changed files with 7 additions and 10 deletions

View File

@ -82,7 +82,7 @@ mkDocumentFrom ::
-- | Actual file path, for access and reading
"path" :! Path b File ->
m (Document repr)
mkDocumentFrom sm (arg #relpath -> k') f = do
mkDocumentFrom sm (arg #relpath -> k') (Arg f) = do
v <-
liftEither . first DocumentError_MarkupError
=<< readDoc sm f

View File

@ -14,7 +14,6 @@ module Rib.Markup
)
where
import Named
import Path
-- | Class for denoting Markup representations.
@ -40,5 +39,5 @@ class IsMarkup repr where
MonadIO m =>
SubMarkup repr ->
-- | Actual path to the file to parse.
"path" :! Path b File ->
Path b File ->
m (Either Text repr)

View File

@ -25,7 +25,6 @@ where
import Control.Foldl (Fold (..))
import Lucid (Html)
import Named
import Path
import Rib.Markup
import Text.MMark (MMark, projectYaml)
@ -43,7 +42,7 @@ instance IsMarkup MMark where
parseDoc () = parse "<memory>"
readDoc () (Arg f) =
readDoc () f =
parse (toFilePath f) <$> readFileText (toFilePath f)
-- | Render a MMark document as HTML

View File

@ -30,7 +30,6 @@ where
import Control.Monad.Except
import Data.Aeson
import Lucid (Html, toHtmlRaw)
import Named
import Path
import Rib.Markup
import Text.Pandoc
@ -55,14 +54,14 @@ instance IsMarkup Pandoc where
defaultSubMarkup = PandocFormat_Markdown
parseDoc k s =
parseDoc fmt s =
first show $ runExcept $ do
runPure'
$ readPandocFormat k readerSettings s
$ readPandocFormat fmt readerSettings s
readDoc k (Arg f) = fmap (first show) $ runExceptT $ do
readDoc fmt f = fmap (first show) $ runExceptT $ do
content <- readFileText (toFilePath f)
v' <- runIO' $ readPandocFormat k readerSettings content
v' <- runIO' $ readPandocFormat fmt readerSettings content
liftIO $ walkM includeSources v'
where
includeSources = includeCode $ Just $ Format "html5"