git.iko.soy/typeable/pandoc
on master help sign in
Set writerSlideVariant in Text.Pandoc rather than pandoc.hs.
commit1bd0c479685fd009ba3c808e6fea3fac24f26428 authorJohn MacFarlane <fiddlosopher@gmail.com> dateMon 23 Jul 2012, 22:53 (14 years ago) parentd2cc56a
2 files changed+47−53
src/Text/Pandoc.hs+9−4 src/pandoc.hs+38−49
src/Text/Pandoc.hs+9−4
@@ -191,10 +191,15 @@ writers = [("native" , writeNative)
191191 ,("html5+lhs" , \o ->
192192 writeHtmlString o{ writerLiterateHaskell = True,
193193 writerHtml5 = True })
194− ,("s5" , writeHtmlString)
195− ,("slidy" , writeHtmlString)
196− ,("slideous" , writeHtmlString)
197− ,("dzslides" , writeHtmlString)
194+ ,("s5" , \o ->
195+ writeHtmlString o{ writerSlideVariant = S5Slides })
196+ ,("slidy" , \o ->
197+ writeHtmlString o{ writerSlideVariant = SlidySlides })
198+ ,("slideous" , \o ->
199+ writeHtmlString o{ writerSlideVariant = SlideousSlides })
200+ ,("dzslides" , \o ->
201+ writeHtmlString o{ writerSlideVariant = DZSlides
202+ , writerHtml5 = True })
198203 ,("docbook" , writeDocbook)
199204 ,("opendocument" , writeOpenDocument)
200205 ,("latex" , writeLaTeX)
src/pandoc.hs+38−49
@@ -902,13 +902,6 @@ main = do
902902 (\_ -> throwIO e)
903903 else throwIO e)
904904
905− let slideVariant = case writerName' of
906− "s5" -> S5Slides
907− "slidy" -> SlidySlides
908− "slideous" -> SlideousSlides
909− "dzslides" -> DZSlides
910− _ -> NoSlides
911−
912905 variables' <- case mathMethod of
913906 LaTeXMathML Nothing -> do
914907 s <- readDataFile datadir $ "data" </> "LaTeXMathML.js"
@@ -918,8 +911,8 @@ main = do
918911 return $ ("mathml-script", s) : variables
919912 _ -> return variables
920913
921− variables'' <- case slideVariant of
922− DZSlides -> do
914+ variables'' <- case writerName' of
915+ "dzslides" -> do
923916 dztempl <- readDataFile datadir $ "dzslides" </> "template.html"
924917 let dzcore = unlines $ dropWhile (not . isPrefixOf "<!-- {{{{ dzslides core")
925918 $ lines dztempl
@@ -939,8 +932,7 @@ main = do
939932 then "."
940933 else takeDirectory (head sources)
941934
942− let startParserState =
943− defaultParserState { stateParseRaw = parseRaw,
935+ let startParserState = def{ stateParseRaw = parseRaw,
944936 stateTabStop = tabStop,
945937 stateLiterateHaskell = "+lhs" `isSuffixOf` readerName' ||
946938 lhsExtension sources,
@@ -955,44 +947,41 @@ main = do
955947 stateApplyMacros = not laTeXOutput
956948 }
957949
958− let writerOptions = defaultWriterOptions
959− { writerStandalone = standalone',
960− writerTemplate = templ,
961− writerVariables = variables'',
962− writerEPUBMetadata = epubMetadata,
963− writerTabStop = tabStop,
964− writerTableOfContents = toc &&
965− writerName' /= "s5",
966− writerHTMLMathMethod = mathMethod,
967− writerSlideVariant = slideVariant,
968− writerIncremental = incremental,
969− writerCiteMethod = citeMethod,
970− writerBiblioFiles = reffiles,
971− writerIgnoreNotes = False,
972− writerNumberSections = numberSections,
973− writerSectionDivs = sectionDivs,
974− writerStrictMarkdown = strict,
975− writerReferenceLinks = referenceLinks,
976− writerWrapText = wrap,
977− writerColumns = columns,
978− writerLiterateHaskell = False,
979− writerEmailObfuscation = if strict
980− then ReferenceObfuscation
981− else obfuscationMethod,
982− writerIdentifierPrefix = idPrefix,
983− writerSourceDirectory = sourceDir,
984− writerUserDataDir = datadir,
985− writerHtml5 = html5 ||
986− slideVariant == DZSlides,
987− writerChapters = chapters,
988− writerListings = listings,
989− writerBeamer = False,
990− writerSlideLevel = slideLevel,
991− writerHighlight = highlight,
992− writerHighlightStyle = highlightStyle,
993− writerSetextHeaders = setextHeaders,
994− writerTeXLigatures = texLigatures
995− }
950+ let writerOptions = def { writerStandalone = standalone',
951+ writerTemplate = templ,
952+ writerVariables = variables'',
953+ writerEPUBMetadata = epubMetadata,
954+ writerTabStop = tabStop,
955+ writerTableOfContents = toc &&
956+ writerName' /= "s5",
957+ writerHTMLMathMethod = mathMethod,
958+ writerIncremental = incremental,
959+ writerCiteMethod = citeMethod,
960+ writerBiblioFiles = reffiles,
961+ writerIgnoreNotes = False,
962+ writerNumberSections = numberSections,
963+ writerSectionDivs = sectionDivs,
964+ writerStrictMarkdown = strict,
965+ writerReferenceLinks = referenceLinks,
966+ writerWrapText = wrap,
967+ writerColumns = columns,
968+ writerLiterateHaskell = False,
969+ writerEmailObfuscation = if strict
970+ then ReferenceObfuscation
971+ else obfuscationMethod,
972+ writerIdentifierPrefix = idPrefix,
973+ writerSourceDirectory = sourceDir,
974+ writerUserDataDir = datadir,
975+ writerHtml5 = html5,
976+ writerChapters = chapters,
977+ writerListings = listings,
978+ writerBeamer = False,
979+ writerSlideLevel = slideLevel,
980+ writerHighlight = highlight,
981+ writerHighlightStyle = highlightStyle,
982+ writerSetextHeaders = setextHeaders,
983+ writerTeXLigatures = texLigatures
984+ }
996985
997986 when (writerName' `elem` nonTextFormats&& outputFile == "-") $
998987 err 5 $ "Cannot write " ++ writerName' ++ " output to stdout.\n" ++