diff options
-rw-r--r-- | src/Text/Pandoc/Filter.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Filter.hs b/src/Text/Pandoc/Filter.hs index 5f8a9fdee..df80d4c82 100644 --- a/src/Text/Pandoc/Filter.hs +++ b/src/Text/Pandoc/Filter.hs @@ -38,11 +38,11 @@ module Text.Pandoc.Filter ) where import Prelude -#ifdef AVOID_TEMPLATE_HASKELL +#ifdef DERIVE_JSON_VIA_TH +import Data.Aeson.TH (deriveJSON, defaultOptions) +#else import Data.Aeson (FromJSON (..), ToJSON (..), defaultOptions, genericToEncoding) -#else -import Data.Aeson.TH (deriveJSON, defaultOptions) #endif import Data.Foldable (foldrM) import GHC.Generics (Generic) @@ -76,10 +76,10 @@ expandFilterPath :: Filter -> PandocIO Filter expandFilterPath (LuaFilter fp) = LuaFilter <$> Path.expandFilterPath fp expandFilterPath (JSONFilter fp) = JSONFilter <$> Path.expandFilterPath fp -#ifdef AVOID_TEMPLATE_HASKELL +#ifdef DERIVE_JSON_VIA_TH +$(deriveJSON defaultOptions ''Filter) +#else instance ToJSON Filter where toEncoding = genericToEncoding defaultOptions instance FromJSON Filter -#else -$(deriveJSON defaultOptions ''Filter) #endif |