git.iko.soy/typeable/pandoc
on master help sign in
Options: Add references location.

This will be used by the markdown writer for deciding where to put links and footnotes.

commit27113bda1f4858ac8ada423391d053450dada175 authorJesse Rosenthal <jrosenthal@jhu.edu> dateTue 11 Oct 2016, 13:10 (10 years ago) parentf4b7ab1
1 file changed+9
src/Text/Pandoc/Options.hs+9
src/Text/Pandoc/Options.hs+9
@@ -45,6 +45,7 @@ module Text.Pandoc.Options ( Extension(..)
4545 , WrapOption (..)
4646 , WriterOptions (..)
4747 , TrackChanges (..)
48+ , ReferenceLocation (..)
4849 , def
4950 , isEnabled
5051 ) where
@@ -336,6 +337,12 @@ data WrapOption = WrapAuto -- ^ Automatically wrap to width
336337 | WrapPreserve -- ^ Preserve wrapping of input source
337338 deriving (Show, Read, Eq, Data, Typeable, Generic)
338339
340+-- | Locations for footnotes and references in markdown output
341+data ReferenceLocation = EndOfBlock -- ^ End of block
342+ | EndOfSection -- ^ prior to next section header (or end of document)
343+ | EndOfDocument -- ^ at end of document
344+ deriving (Show, Read, Eq, Data, Typeable, Generic)
345+
339346-- | Options for writers
340347data WriterOptions = WriterOptions
341348 { writerStandalone :: Bool -- ^ Include header and footer
@@ -383,6 +390,7 @@ data WriterOptions = WriterOptions
383390 , writerMediaBag :: MediaBag -- ^ Media collected by docx or epub reader
384391 , writerVerbose :: Bool -- ^ Verbose debugging output
385392 , writerLaTeXArgs :: [String] -- ^ Flags to pass to latex-engine
393+ , writerReferenceLocation :: ReferenceLocation -- ^ Location of footnotes and references for writing markdown
386394 } deriving (Show, Data, Typeable, Generic)
387395
388396instance Default WriterOptions where
@@ -430,6 +438,7 @@ instance Default WriterOptions where
430438 , writerMediaBag = mempty
431439 , writerVerbose = False
432440 , writerLaTeXArgs = []
441+ , writerReferenceLocation = EndOfDocument
433442 }
434443
435444-- | Returns True if the given extension is enabled.