doctemplates 0.10.0.2 → 0.11
raw patch · 4 files changed
+3/−38 lines, 4 filesdep −HsYAMLPVP ok
version bump matches the API change (PVP)
Dependencies removed: HsYAML
API changes (from Hackage documentation)
- Text.DocTemplates.Internal: instance Text.DocTemplates.Internal.TemplateTarget a => Data.YAML.FromYAML (Text.DocTemplates.Internal.Context a)
- Text.DocTemplates.Internal: instance Text.DocTemplates.Internal.TemplateTarget a => Data.YAML.FromYAML (Text.DocTemplates.Internal.Val a)
- Text.DocTemplates.Internal: instance Text.DocTemplates.Internal.TemplateTarget a => Data.YAML.ToYAML (Text.DocTemplates.Internal.Context a)
- Text.DocTemplates.Internal: instance Text.DocTemplates.Internal.TemplateTarget a => Data.YAML.ToYAML (Text.DocTemplates.Internal.Val a)
Files
- README.md +1/−1
- doctemplates.cabal +2/−3
- src/Text/DocTemplates/Internal.hs +0/−33
- test/keyval.txt +0/−1
README.md view
@@ -1,4 +1,4 @@-# doctemplates+#( doctemplates [](https://github.com/jgm/doctemplates/actions)
doctemplates.cabal view
@@ -1,5 +1,5 @@ name: doctemplates-version: 0.10.0.2+version: 0.11 synopsis: Pandoc-style document templates description: This is the text templating system used by pandoc. It supports variable interpolation, iteration,@@ -32,7 +32,6 @@ safe, text-conversions, aeson,- HsYAML >= 0.2 && < 0.3, text, doclayout >= 0.4 && < 0.5, containers,@@ -73,7 +72,7 @@ Build-Depends: doctemplates, doclayout >= 0.4 && < 0.5, base >= 4.8 && < 5,- criterion >= 1.0 && < 1.6,+ criterion >= 1.0, filepath, aeson, text,
src/Text/DocTemplates/Internal.hs view
@@ -37,7 +37,6 @@ import Data.Text.Conversions (FromText(..), ToText(..)) import Data.Aeson (Value(..), ToJSON(..), FromJSON(..), Result(..), fromJSON)-import Data.YAML (ToYAML(..), FromYAML(..), Node(..), Scalar(..)) import Control.Monad.Identity import qualified Control.Monad.State.Strict as S import Data.Char (chr, ord)@@ -234,28 +233,6 @@ MapVal o -> return o _ -> fail "Expecting MapVal" -instance TemplateTarget a => FromYAML (Val a) where- parseYAML v =- case v of- Mapping _ _ m -> MapVal . Context . M.fromList <$>- mapM (\(key, val) -> do- val' <- parseYAML val- key' <- parseYAML key- return (key', val')) (M.toList m)- Sequence _ _ xs -> ListVal <$> mapM parseYAML xs- Scalar _ (SStr t) -> return $ SimpleVal $ fromString . fromText $ t- Scalar _ (SFloat n) -> return $ SimpleVal $ fromString . show $ n- Scalar _ (SInt n) -> return $ SimpleVal $ fromString . show $ n- Scalar _ (SBool b) -> return $ BoolVal b- _ -> return NullVal--instance TemplateTarget a => FromYAML (Context a) where- parseYAML v = do- val <- parseYAML v- case val of- MapVal o -> return o- _ -> fail "Expecting MapVal"- instance TemplateTarget a => ToJSON (Context a) where toJSON (Context m) = toJSON m @@ -265,16 +242,6 @@ toJSON (ListVal xs) = toJSON xs toJSON (SimpleVal d) = toJSON $ toText $ DL.render Nothing d toJSON (BoolVal b) = toJSON b--instance TemplateTarget a => ToYAML (Context a) where- toYAML (Context m) = toYAML m--instance TemplateTarget a => ToYAML (Val a) where- toYAML NullVal = toYAML (Nothing :: Maybe Text)- toYAML (MapVal m) = toYAML m- toYAML (ListVal xs) = toYAML xs- toYAML (SimpleVal d) = toYAML $ toText $ DL.render Nothing d- toYAML (BoolVal b) = toYAML b mapDoc :: TemplateTarget a => (Doc a -> Doc a) -> Val a -> Val a mapDoc f val =
− test/keyval.txt
@@ -1,1 +0,0 @@-