mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-26 10:16:32 +00:00
Format: add function diffExtensions.
This commit is contained in:
committed by
John MacFarlane
parent
038df3b24c
commit
db0232fc54
@@ -12,6 +12,7 @@ module Text.Pandoc.Format
|
||||
( FlavoredFormat (..)
|
||||
, ExtensionsConfig (..)
|
||||
, ExtensionsDiff (..)
|
||||
, diffExtensions
|
||||
, parseFlavoredFormat
|
||||
, applyExtensionsDiff
|
||||
, getExtensionsConfig
|
||||
@@ -59,6 +60,14 @@ instance Monoid ExtensionsDiff where
|
||||
mempty = ExtensionsDiff mempty mempty
|
||||
mappend = (<>)
|
||||
|
||||
-- | Calculate the change set to get from one set of extensions to
|
||||
-- another.
|
||||
diffExtensions :: Extensions -> Extensions -> ExtensionsDiff
|
||||
diffExtensions def actual = ExtensionsDiff
|
||||
{ extsToEnable = actual `disableExtensions` def
|
||||
, extsToDisable = def `disableExtensions` actual
|
||||
}
|
||||
|
||||
-- | Describes the properties of a format.
|
||||
data ExtensionsConfig = ExtensionsConfig
|
||||
{ extsDefault :: Extensions -- ^ Extensions enabled by default
|
||||
|
||||
Reference in New Issue
Block a user