Removed --print-sample-lua-writer, added --print-default-data-file.

Closes #943.
This commit is contained in:
John MacFarlane 2013-08-13 18:25:20 -07:00
parent 3ebdc5b5f0
commit bd73d73a28
2 changed files with 13 additions and 13 deletions

7
README
View file

@ -311,9 +311,8 @@ General writer options
: Print the default template for an output *FORMAT*. (See `-t`
for a list of possible *FORMAT*s.)
`--print-sample-lua-writer`
: Print a sample lua custom writer (see [Custom writers](#custom-writers),
below.
`--print-default-data-file=`*FILE*
: Print a default data file.
`--no-wrap`
: 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
possible element in a pandoc document. To get a documented example
which you can modify according to your needs, do
pandoc --print-sample-lua-writer
pandoc --print-default-data-file sample.lua
Authors
=======

View file

@ -33,8 +33,8 @@ module Main where
import Text.Pandoc
import Text.Pandoc.PDF (makePDF)
import Text.Pandoc.Readers.LaTeX (handleIncludes)
import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, safeRead,
headerShift, normalize, err, warn )
import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, readDataFile,
safeRead, headerShift, normalize, err, warn )
import Text.Pandoc.XML ( toEntities, fromEntities )
import Text.Pandoc.SelfContained ( makeSelfContained )
import Text.Pandoc.Process (pipeProcess)
@ -58,6 +58,7 @@ import Data.Foldable (foldrM)
import Network.HTTP (simpleHTTP, mkRequest, getResponseBody, RequestMethod(..))
import Network.URI (parseURI, isURI, URI(..))
import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString as BS
import Text.CSL.Reference (Reference(..))
import Data.Aeson (eitherDecode', encode)
@ -347,13 +348,13 @@ options =
"FORMAT")
"" -- "Print default template for FORMAT"
, Option "" ["print-sample-lua-writer"]
(NoArg
(\_ -> do
sample <- readDataFileUTF8 Nothing "sample.lua"
UTF8.hPutStr stdout sample
exitWith ExitSuccess))
"" -- "Print sample lua custom writer"
, Option "" ["print-default-data-file"]
(ReqArg
(\arg _ -> do
readDataFile Nothing arg >>= BS.hPutStr stdout
exitWith ExitSuccess)
"FILE")
"" -- "Print default data file"
, Option "" ["no-wrap"]
(NoArg