git.iko.soy/typeable/pandoc
on master help sign in
Add reference-location options to executable.
commit14209b2ba0266f1d0aee8bfdfe01a561142930c1 authorJesse Rosenthal <jrosenthal@jhu.edu> dateTue 11 Oct 2016, 15:07 (10 years ago) parentca50dee
1 file changed+17
pandoc.hs+17
pandoc.hs+17
@@ -196,6 +196,7 @@ data Opt = Opt
196196 , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
197197 , optVerbose :: Bool -- ^ Verbose diagnostic output
198198 , optReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst
199+ , optReferenceLocation :: ReferenceLocation -- ^ location for footnotes and link references in markdown output
199200 , optDpi :: Int -- ^ Dpi
200201 , optWrapText :: WrapOption -- ^ Options for wrapping text
201202 , optColumns :: Int -- ^ Line length in characters
@@ -260,6 +261,7 @@ defaultOpts = Opt
260261 , optIgnoreArgs = False
261262 , optVerbose = False
262263 , optReferenceLinks = False
264+ , optReferenceLocation = EndOfDocument
263265 , optDpi = 96
264266 , optWrapText = WrapAuto
265267 , optColumns = 72
@@ -584,6 +586,19 @@ options =
584586 (\opt -> return opt { optReferenceLinks = True } ))
585587 "" -- "Use reference links in parsing HTML"
586588
589+ , Option "" ["reference-location"]
590+ (ReqArg
591+ (\arg opt -> do
592+ action <- case arg of
593+ "block" -> return EndOfBlock
594+ "section" -> return EndOfSection
595+ "document" -> return EndOfDocument
596+ _ -> err 6
597+ ("Unknown option for reference-location: " ++ arg)
598+ return opt { optReferenceLocation = action })
599+ "block|section|document")
600+ "" -- "Accepting or reject MS Word track-changes.""
601+
587602 , Option "" ["atx-headers"]
588603 (NoArg
589604 (\opt -> return opt { optSetextHeaders = False } ))
@@ -1120,6 +1135,7 @@ convertWithOpts opts args = do
11201135 , optIgnoreArgs = ignoreArgs
11211136 , optVerbose = verbose
11221137 , optReferenceLinks = referenceLinks
1138+ , optReferenceLocation = referenceLocation
11231139 , optDpi = dpi
11241140 , optWrapText = wrap
11251141 , optColumns = columns
@@ -1360,6 +1376,7 @@ convertWithOpts opts args = do
13601376 writerNumberOffset = numberFrom,
13611377 writerSectionDivs = sectionDivs,
13621378 writerReferenceLinks = referenceLinks,
1379+ writerReferenceLocation = referenceLocation,
13631380 writerDpi = dpi,
13641381 writerWrapText = wrap,
13651382 writerColumns = columns,