summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-10-11 13:10:59 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2016-10-11 13:30:01 -0400
commit27113bda1f4858ac8ada423391d053450dada175 (patch)
tree2187339c1e919c909f4a00e02609dbaf8b55936f /src
parentf4b7ab125e0eb034b4f90448f093d4c4a2284589 (diff)
Options: Add references location.
This will be used by the markdown writer for deciding where to put links and footnotes.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Options.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs
index 1aa07515e..39d314974 100644
--- a/src/Text/Pandoc/Options.hs
+++ b/src/Text/Pandoc/Options.hs
@@ -45,6 +45,7 @@ module Text.Pandoc.Options ( Extension(..)
, WrapOption (..)
, WriterOptions (..)
, TrackChanges (..)
+ , ReferenceLocation (..)
, def
, isEnabled
) where
@@ -336,6 +337,12 @@ data WrapOption = WrapAuto -- ^ Automatically wrap to width
| WrapPreserve -- ^ Preserve wrapping of input source
deriving (Show, Read, Eq, Data, Typeable, Generic)
+-- | Locations for footnotes and references in markdown output
+data ReferenceLocation = EndOfBlock -- ^ End of block
+ | EndOfSection -- ^ prior to next section header (or end of document)
+ | EndOfDocument -- ^ at end of document
+ deriving (Show, Read, Eq, Data, Typeable, Generic)
+
-- | Options for writers
data WriterOptions = WriterOptions
{ writerStandalone :: Bool -- ^ Include header and footer
@@ -383,6 +390,7 @@ data WriterOptions = WriterOptions
, writerMediaBag :: MediaBag -- ^ Media collected by docx or epub reader
, writerVerbose :: Bool -- ^ Verbose debugging output
, writerLaTeXArgs :: [String] -- ^ Flags to pass to latex-engine
+ , writerReferenceLocation :: ReferenceLocation -- ^ Location of footnotes and references for writing markdown
} deriving (Show, Data, Typeable, Generic)
instance Default WriterOptions where
@@ -430,6 +438,7 @@ instance Default WriterOptions where
, writerMediaBag = mempty
, writerVerbose = False
, writerLaTeXArgs = []
+ , writerReferenceLocation = EndOfDocument
}
-- | Returns True if the given extension is enabled.