git.iko.soy/typeable/pandoc
on master help sign in
Set writerSlideVariant in Text.Pandoc rather than pandoc.hs.
1bd0c47John MacFarlane
src/Text/Pandoc.hs+9−4
@@ -191,10 +191,15 @@ writers = [("native" , writeNative)
191 ,("html5+lhs" , \o ->
191 ,("html5+lhs" , \o ->
192 writeHtmlString o{ writerLiterateHaskell = True,
192 writeHtmlString o{ writerLiterateHaskell = True,
193 writerHtml5 = True })
193 writerHtml5 = True })
194+ ,("s5" , \o ->
194− ,("s5" , writeHtmlString)
195+ writeHtmlString o{ writerSlideVariant = S5Slides })
196+ ,("slidy" , \o ->
195− ,("slidy" , writeHtmlString)
197+ writeHtmlString o{ writerSlideVariant = SlidySlides })
196− ,("slideous" , writeHtmlString)
198+ ,("slideous" , \o ->
199+ writeHtmlString o{ writerSlideVariant = SlideousSlides })
197− ,("dzslides" , writeHtmlString)
200+ ,("dzslides" , \o ->
201+ writeHtmlString o{ writerSlideVariant = DZSlides
202+ , writerHtml5 = True })
198 ,("docbook" , writeDocbook)
203 ,("docbook" , writeDocbook)
199 ,("opendocument" , writeOpenDocument)
204 ,("opendocument" , writeOpenDocument)
200 ,("latex" , writeLaTeX)
205 ,("latex" , writeLaTeX)
src/pandoc.hs+38−49
@@ -902,13 +902,6 @@ main = do
902 (\_ -> throwIO e)
902 (\_ -> throwIO e)
903 else throwIO e)
903 else throwIO e)
904
904
905− let slideVariant = case writerName' of
906− "s5" -> S5Slides
907− "slidy" -> SlidySlides
908− "slideous" -> SlideousSlides
909− "dzslides" -> DZSlides
910− _ -> NoSlides
911−
912 variables' <- case mathMethod of
905 variables' <- case mathMethod of
913 LaTeXMathML Nothing -> do
906 LaTeXMathML Nothing -> do
914 s <- readDataFile datadir $ "data" </> "LaTeXMathML.js"
907 s <- readDataFile datadir $ "data" </> "LaTeXMathML.js"
@@ -918,8 +911,8 @@ main = do
918 return $ ("mathml-script", s) : variables
911 return $ ("mathml-script", s) : variables
919 _ -> return variables
912 _ -> return variables
920
913
921− variables'' <- case slideVariant of
914+ variables'' <- case writerName' of
922− DZSlides -> do
915+ "dzslides" -> do
923 dztempl <- readDataFile datadir $ "dzslides" </> "template.html"
916 dztempl <- readDataFile datadir $ "dzslides" </> "template.html"
924 let dzcore = unlines $ dropWhile (not . isPrefixOf "<!-- {{{{ dzslides core")
917 let dzcore = unlines $ dropWhile (not . isPrefixOf "<!-- {{{{ dzslides core")
925 $ lines dztempl
918 $ lines dztempl
@@ -939,8 +932,7 @@ main = do
939 then "."
932 then "."
940 else takeDirectory (head sources)
933 else takeDirectory (head sources)
941
934
942− let startParserState =
935+ let startParserState = def{ stateParseRaw = parseRaw,
943− defaultParserState { stateParseRaw = parseRaw,
944 stateTabStop = tabStop,
936 stateTabStop = tabStop,
945 stateLiterateHaskell = "+lhs" `isSuffixOf` readerName' ||
937 stateLiterateHaskell = "+lhs" `isSuffixOf` readerName' ||
946 lhsExtension sources,
938 lhsExtension sources,
@@ -955,44 +947,41 @@ main = do
955 stateApplyMacros = not laTeXOutput
947 stateApplyMacros = not laTeXOutput
956 }
948 }
957
949
958− let writerOptions = defaultWriterOptions
959− { writerStandalone = standalone',
950+ let writerOptions = def { writerStandalone = standalone',
960− writerTemplate = templ,
951+ writerTemplate = templ,
961− writerVariables = variables'',
952+ writerVariables = variables'',
962− writerEPUBMetadata = epubMetadata,
953+ writerEPUBMetadata = epubMetadata,
963− writerTabStop = tabStop,
954+ writerTabStop = tabStop,
964− writerTableOfContents = toc &&
955+ writerTableOfContents = toc &&
965− writerName' /= "s5",
956+ writerName' /= "s5",
966− writerHTMLMathMethod = mathMethod,
957+ writerHTMLMathMethod = mathMethod,
967− writerSlideVariant = slideVariant,
968− writerIncremental = incremental,
958+ writerIncremental = incremental,
969− writerCiteMethod = citeMethod,
959+ writerCiteMethod = citeMethod,
970− writerBiblioFiles = reffiles,
960+ writerBiblioFiles = reffiles,
971− writerIgnoreNotes = False,
961+ writerIgnoreNotes = False,
972− writerNumberSections = numberSections,
962+ writerNumberSections = numberSections,
973− writerSectionDivs = sectionDivs,
963+ writerSectionDivs = sectionDivs,
974− writerStrictMarkdown = strict,
964+ writerStrictMarkdown = strict,
975− writerReferenceLinks = referenceLinks,
965+ writerReferenceLinks = referenceLinks,
976− writerWrapText = wrap,
966+ writerWrapText = wrap,
977− writerColumns = columns,
967+ writerColumns = columns,
978− writerLiterateHaskell = False,
968+ writerLiterateHaskell = False,
979− writerEmailObfuscation = if strict
969+ writerEmailObfuscation = if strict
980− then ReferenceObfuscation
970+ then ReferenceObfuscation
981− else obfuscationMethod,
971+ else obfuscationMethod,
982− writerIdentifierPrefix = idPrefix,
972+ writerIdentifierPrefix = idPrefix,
983− writerSourceDirectory = sourceDir,
973+ writerSourceDirectory = sourceDir,
984− writerUserDataDir = datadir,
974+ writerUserDataDir = datadir,
985− writerHtml5 = html5 ||
975+ writerHtml5 = html5,
986− slideVariant == DZSlides,
987− writerChapters = chapters,
976+ writerChapters = chapters,
988− writerListings = listings,
977+ writerListings = listings,
989− writerBeamer = False,
978+ writerBeamer = False,
990− writerSlideLevel = slideLevel,
979+ writerSlideLevel = slideLevel,
991− writerHighlight = highlight,
980+ writerHighlight = highlight,
992− writerHighlightStyle = highlightStyle,
981+ writerHighlightStyle = highlightStyle,
993− writerSetextHeaders = setextHeaders,
982+ writerSetextHeaders = setextHeaders,
994− writerTeXLigatures = texLigatures
983+ writerTeXLigatures = texLigatures
995− }
984+ }
996
985
997 when (writerName' `elem` nonTextFormats&& outputFile == "-") $
986 when (writerName' `elem` nonTextFormats&& outputFile == "-") $
998 err 5 $ "Cannot write " ++ writerName' ++ " output to stdout.\n" ++
987 err 5 $ "Cannot write " ++ writerName' ++ " output to stdout.\n" ++