git.iko.soy/typeable/pandoc
on master help sign in
Removed `--print-sample-lua-writer`, added `--print-default-data-file`.

Closes #943.

commitbd73d73a28acc2863bd52bdc6f0f9d850fa34d84 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 13 Aug 2013, 18:25 (13 years ago) parent3ebdc5b
2 files changed+13−13
README+3−4 pandoc.hs+10−9
README+3−4
@@ -311,9 +311,8 @@ General writer options
311311: Print the default template for an output *FORMAT*. (See `-t`
312312 for a list of possible *FORMAT*s.)
313313
314−`--print-sample-lua-writer`
315−: Print a sample lua custom writer (see [Custom writers](#custom-writers),
316− below.
314+`--print-default-data-file=`*FILE*
315+: Print a default data file.
317316
318317`--no-wrap`
319318: Disable text wrapping in output. By default, text is wrapped
@@ -2759,7 +2758,7 @@ Creating a custom writer requires writing a lua function for each
27592758possible element in a pandoc document. To get a documented example
27602759which you can modify according to your needs, do
27612760
2762− pandoc --print-sample-lua-writer
2761+ pandoc --print-default-data-file sample.lua
27632762
27642763Authors
27652764=======
pandoc.hs+10−9
@@ -33,8 +33,8 @@ module Main where
3333import Text.Pandoc
3434import Text.Pandoc.PDF (makePDF)
3535import Text.Pandoc.Readers.LaTeX (handleIncludes)
36−import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, safeRead,
37− headerShift, normalize, err, warn )
36+import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, readDataFile,
37+ safeRead, headerShift, normalize, err, warn )
3838import Text.Pandoc.XML ( toEntities, fromEntities )
3939import Text.Pandoc.SelfContained ( makeSelfContained )
4040import Text.Pandoc.Process (pipeProcess)
@@ -58,6 +58,7 @@ import Data.Foldable (foldrM)
5858import Network.HTTP (simpleHTTP, mkRequest, getResponseBody, RequestMethod(..))
5959import Network.URI (parseURI, isURI, URI(..))
6060import qualified Data.ByteString.Lazy as B
61+import qualified Data.ByteString as BS
6162import Text.CSL.Reference (Reference(..))
6263import Data.Aeson (eitherDecode', encode)
6364
@@ -347,13 +348,13 @@ options =
347348 "FORMAT")
348349 "" -- "Print default template for FORMAT"
349350
350− , Option "" ["print-sample-lua-writer"]
351− (NoArg
352− (\_ -> do
353− sample <- readDataFileUTF8 Nothing "sample.lua"
354− UTF8.hPutStr stdout sample
355− exitWith ExitSuccess))
356− "" -- "Print sample lua custom writer"
351+ , Option "" ["print-default-data-file"]
352+ (ReqArg
353+ (\arg _ -> do
354+ readDataFile Nothing arg >>= BS.hPutStr stdout
355+ exitWith ExitSuccess)
356+ "FILE")
357+ "" -- "Print default data file"
357358
358359 , Option "" ["no-wrap"]
359360 (NoArg