"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Text/Pandoc/App.hs" between
pandoc-2.11.1.1.tar.gz and pandoc-2.11.2.tar.gz

About: Pandoc converts files from one markup format into another.

App.hs  (pandoc-2.11.1.1):App.hs  (pandoc-2.11.2)
skipping to change at line 134 skipping to change at line 134
Just f -> return f Just f -> return f
Nothing -> case formatFromFilePaths sources of Nothing -> case formatFromFilePaths sources of
Just f' -> return f' Just f' -> return f'
Nothing | sources == ["-"] -> return "markdown" Nothing | sources == ["-"] -> return "markdown"
| any (isURI . T.pack) sources -> return "htm l" | any (isURI . T.pack) sources -> return "htm l"
| otherwise -> do | otherwise -> do
report $ CouldNotDeduceFormat report $ CouldNotDeduceFormat
(map (T.pack . takeExtension) sources) "markdow n" (map (T.pack . takeExtension) sources) "markdow n"
return "markdown" return "markdown"
let readerNameBase = T.takeWhile (\c -> c /= '+' && c /= '-') readerName
let pdfOutput = map toLower (takeExtension outputFile) == ".pdf" let pdfOutput = map toLower (takeExtension outputFile) == ".pdf"
when (pdfOutput && readerName == "latex") $ when (pdfOutput && readerNameBase == "latex") $
case optInputFiles opts of case optInputFiles opts of
Just (inputFile:_) -> report $ UnusualConversion $ T.pack $ Just (inputFile:_) -> report $ UnusualConversion $ T.pack $
"to convert a .tex file to PDF, you get better results by using pdflat ex " "to convert a .tex file to PDF, you get better results by using pdflat ex "
<> "(or lualatex or xelatex) directly, try `pdflatex " <> inputFile <> "(or lualatex or xelatex) directly, try `pdflatex " <> inputFile
<> "` instead of `pandoc " <> inputFile <> " -o " <> outputFile <> " `." <> "` instead of `pandoc " <> inputFile <> " -o " <> outputFile <> " `."
_ -> return () _ -> return ()
(reader :: Reader PandocIO, readerExts) <- getReader readerName (reader :: Reader PandocIO, readerExts) <- getReader readerName
let convertTabs = tabFilter (if optPreserveTabs opts || let convertTabs = tabFilter (if optPreserveTabs opts ||
readerName == "t2t" || readerNameBase == "t2t" ||
readerName == "man" readerNameBase == "man"
then 0 then 0
else optTabStop opts) else optTabStop opts)
let readSources :: [FilePath] -> PandocIO Text let readSources :: [FilePath] -> PandocIO Text
readSources srcs = convertTabs . T.intercalate (T.pack "\n") <$> readSources srcs = convertTabs . T.intercalate (T.pack "\n") <$>
mapM readSource srcs mapM readSource srcs
outputSettings <- optToOutputSettings opts outputSettings <- optToOutputSettings opts
let format = outputFormat outputSettings let format = outputFormat outputSettings
let writer = outputWriter outputSettings let writer = outputWriter outputSettings
let writerName = outputWriterName outputSettings let writerName = outputWriterName outputSettings
let writerNameBase = T.takeWhile (\c -> c /= '+' && c /= '-') writerName
let writerOptions = outputWriterOptions outputSettings let writerOptions = outputWriterOptions outputSettings
let bibOutput = writerName == "bibtex" || let bibOutput = writerNameBase == "bibtex" ||
writerName == "biblatex" || writerNameBase == "biblatex" ||
writerName == "csljson" writerNameBase == "csljson"
let standalone = optStandalone opts || let standalone = optStandalone opts ||
not (isTextFormat format) || not (isTextFormat format) ||
pdfOutput || pdfOutput ||
bibOutput bibOutput
-- We don't want to send output to the terminal if the user -- We don't want to send output to the terminal if the user
-- does 'pandoc -t docx input.txt'; though we allow them to -- does 'pandoc -t docx input.txt'; though we allow them to
-- force this with '-o -'. On posix systems, we detect -- force this with '-o -'. On posix systems, we detect
-- when stdout is being piped and allow output to stdout -- when stdout is being piped and allow output to stdout
skipping to change at line 239 skipping to change at line 241
then (stripEmptyParagraphs :) then (stripEmptyParagraphs :)
else id) . else id) .
(if extensionEnabled Ext_east_asian_line_breaks (if extensionEnabled Ext_east_asian_line_breaks
readerExts && readerExts &&
not (extensionEnabled Ext_east_asian_line_breaks not (extensionEnabled Ext_east_asian_line_breaks
(writerExtensions writerOptions) && (writerExtensions writerOptions) &&
writerWrapText writerOptions == WrapPreserve) writerWrapText writerOptions == WrapPreserve)
then (eastAsianLineBreakFilter :) then (eastAsianLineBreakFilter :)
else id) . else id) .
(case optIpynbOutput opts of (case optIpynbOutput opts of
_ | readerNameBase /= "ipynb" -> id
IpynbOutputAll -> id IpynbOutputAll -> id
IpynbOutputNone -> (filterIpynbOutput Nothing :) IpynbOutputNone -> (filterIpynbOutput Nothing :)
IpynbOutputBest -> (filterIpynbOutput (Just $ IpynbOutputBest -> (filterIpynbOutput (Just $
if htmlFormat format if htmlFormat format
then Format "html" then Format "html"
else else
case format of case format of
"latex" -> Format "latex" "latex" -> Format "latex"
"beamer" -> Format "latex" "beamer" -> Format "latex"
_ -> Format format) :)) _ -> Format format) :))
$ [] $ []
let sourceToDoc :: [FilePath] -> PandocIO Pandoc let sourceToDoc :: [FilePath] -> PandocIO Pandoc
sourceToDoc sources' = sourceToDoc sources' =
case reader of case reader of
TextReader r TextReader r
| optFileScope opts || readerName == "json" -> | optFileScope opts || readerNameBase == "json" ->
mconcat <$> mapM (readSource >=> r readerOpts) sources' mconcat <$> mapM (readSource >=> r readerOpts) sources'
| otherwise -> | otherwise ->
readSources sources' >>= r readerOpts readSources sources' >>= r readerOpts
ByteStringReader r -> ByteStringReader r ->
mconcat <$> mapM (readFile' >=> r readerOpts) sources' mconcat <$> mapM (readFile' >=> r readerOpts) sources'
when (readerName == "markdown_github" || when (readerNameBase == "markdown_github" ||
writerName == "markdown_github") $ writerNameBase == "markdown_github") $
report $ Deprecated "markdown_github" "Use gfm instead." report $ Deprecated "markdown_github" "Use gfm instead."
mapM_ (uncurry setRequestHeader) (optRequestHeaders opts) mapM_ (uncurry setRequestHeader) (optRequestHeaders opts)
setNoCheckCertificate (optNoCheckCertificate opts) setNoCheckCertificate (optNoCheckCertificate opts)
let isPandocCiteproc (JSONFilter f) = takeBaseName f == "pandoc-citeproc" let isPandocCiteproc (JSONFilter f) = takeBaseName f == "pandoc-citeproc"
isPandocCiteproc _ = False isPandocCiteproc _ = False
when (any isPandocCiteproc filters) $ when (any isPandocCiteproc filters) $
 End of changes. 8 change blocks. 
9 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)