git.iko.soy/typeable/pandoc
on master help sign in
Use Data.List's 'intercalate' instead of custom 'joinWithSep'.

+ Removed joinWithSep definition from Text.Pandoc.Shared. + Replaced joinWithSep with intercalate + Depend on base >= 3, since in base < 3 intercalate is not included. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1428 788f1e2b-df1e-0410-8736-df70ead52e1b

commit000b89c718fdef3790a56fad9cbbfcdcf7fbea52 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 8 Sep 2008, 06:36 (18 years ago) parent2e893b4
15 files changed+54−65
Main.hs+7−6 Text/Pandoc/Readers/HTML.hs+3−3 Text/Pandoc/Readers/Markdown.hs+6−6 Text/Pandoc/Readers/RST.hs+3−3 Text/Pandoc/Shared.hs+9−17 Text/Pandoc/Writers/ConTeXt.hs+3−3 Text/Pandoc/Writers/Docbook.hs+2−2 Text/Pandoc/Writers/HTML.hs+2−2 Text/Pandoc/Writers/LaTeX.hs+2−2 Text/Pandoc/Writers/Man.hs+4−4 Text/Pandoc/Writers/Markdown.hs+2−2 Text/Pandoc/Writers/OpenDocument.hs+2−1 Text/Pandoc/Writers/RTF.hs+3−3 Text/Pandoc/Writers/S5.hs+3−2 pandoc.cabal+3−9
Main.hs+7−6
@@ -32,7 +32,7 @@ writers.
3232module Main where
3333import Text.Pandoc
3434import Text.Pandoc.ODT
35−import Text.Pandoc.Shared ( joinWithSep, HTMLMathMethod (..) )
35+import Text.Pandoc.Shared ( HTMLMathMethod (..) )
3636import Text.Pandoc.Highlighting ( languages )
3737import System.Environment ( getArgs, getProgName, getEnvironment )
3838import System.Exit ( exitWith, ExitCode (..) )
@@ -40,6 +40,7 @@ import System.FilePath ( takeExtension, takeDirectory )
4040import System.Console.GetOpt
4141import Data.Maybe ( fromMaybe )
4242import Data.Char ( toLower )
43+import Data.List ( intercalate )
4344import Prelude hiding ( putStrLn, writeFile, readFile, getContents )
4445import System.IO ( stdout, stderr )
4546import System.IO.UTF8
@@ -188,13 +189,13 @@ options =
188189 (ReqArg
189190 (\arg opt -> return opt { optReader = map toLower arg })
190191 "FORMAT")
191− "" -- ("(" ++ (joinWithSep ", " $ map fst readers) ++ ")")
192+ "" -- ("(" ++ (intercalate ", " $ map fst readers) ++ ")")
192193
193194 , Option "tw" ["to","write"]
194195 (ReqArg
195196 (\arg opt -> return opt { optWriter = map toLower arg })
196197 "FORMAT")
197− "" -- ("(" ++ (joinWithSep ", " $ map fst writers) ++ ")")
198+ "" -- ("(" ++ (intercalate ", " $ map fst writers) ++ ")")
198199
199200 , Option "s" ["standalone"]
200201 (NoArg
@@ -389,8 +390,8 @@ options =
389390usageMessage :: String -> [OptDescr (Opt -> IO Opt)] -> String
390391usageMessage programName opts = usageInfo
391392 (programName ++ " [OPTIONS] [FILES]" ++ "\nInput formats: " ++
392− (joinWithSep ", " $ map fst readers) ++ "\nOutput formats: " ++
393− (joinWithSep ", " $ map fst writers) ++ "\nOptions:")
393+ (intercalate ", " $ map fst readers) ++ "\nOutput formats: " ++
394+ (intercalate ", " $ map fst writers) ++ "\nOptions:")
394395 opts
395396
396397-- Determine default reader based on source file extensions
@@ -599,7 +600,7 @@ main = do
599600 then putStrLn
600601 else writeFile outputFile . (++ "\n")
601602
602− fmap (reader startParserState . tabFilter tabStop . joinWithSep "\n")
603+ fmap (reader startParserState . tabFilter tabStop . intercalate "\n")
603604 (readSources sources) >>=
604605#ifdef _CITEPROC
605606 processBiblio cslFile refs >>=
Text/Pandoc/Readers/HTML.hs+3−3
@@ -46,7 +46,7 @@ import Text.Pandoc.Definition
4646import Text.Pandoc.Shared
4747import Text.Pandoc.CharacterReferences ( decodeCharacterReferences )
4848import Data.Maybe ( fromMaybe )
49−import Data.List ( takeWhile, dropWhile, isPrefixOf, isSuffixOf )
49+import Data.List ( takeWhile, dropWhile, isPrefixOf, isSuffixOf, intercalate )
5050import Data.Char ( toLower, isAlphaNum )
5151import Network.URI ( parseURIReference, URI (..) )
5252
@@ -534,7 +534,7 @@ definitionListItem :: GenParser Char ParserState ([Inline], [Block])
534534definitionListItem = try $ do
535535 terms <- sepEndBy1 (inlinesIn "dt") spaces
536536 defs <- sepEndBy1 (blocksIn "dd") spaces
537− let term = joinWithSep [LineBreak] terms
537+ let term = intercalate [LineBreak] terms
538538 return (term, concat defs)
539539
540540--
@@ -580,7 +580,7 @@ code = try $ do
580580 -- remove internal line breaks, leading and trailing space,
581581 -- and decode character references
582582 return $ Code $ decodeCharacterReferences $ removeLeadingTrailingSpace $
583− joinWithSep " " $ lines result
583+ intercalate " " $ lines result
584584
585585rawHtmlInline :: GenParser Char ParserState Inline
586586rawHtmlInline = do
Text/Pandoc/Readers/Markdown.hs+6−6
@@ -32,7 +32,7 @@ module Text.Pandoc.Readers.Markdown (
3232 readMarkdown
3333 ) where
3434
35−import Data.List ( transpose, isPrefixOf, isSuffixOf, lookup, sortBy, findIndex )
35+import Data.List ( transpose, isPrefixOf, isSuffixOf, lookup, sortBy, findIndex, intercalate )
3636import Data.Ord ( comparing )
3737import Data.Char ( isAlphaNum, isAlpha, isLower, isDigit )
3838import Data.Maybe
@@ -234,7 +234,7 @@ noteBlock = try $ do
234234 optional blanklines
235235 endPos <- getPosition
236236 -- parse the extracted text, which may contain various block elements:
237− contents <- parseFromString parseBlocks $ (joinWithSep "\n" raw) ++ "\n\n"
237+ contents <- parseFromString parseBlocks $ (intercalate "\n" raw) ++ "\n\n"
238238 let newnote = (ref, contents)
239239 st <- getState
240240 let oldnotes = stateNotes st
@@ -381,7 +381,7 @@ codeBlockDelimited = try $ do
381381 (size, attr) <- codeBlockDelimiter Nothing
382382 contents <- manyTill anyLine (codeBlockDelimiter (Just size))
383383 blanklines
384− return $ CodeBlock attr $ joinWithSep "\n" contents
384+ return $ CodeBlock attr $ intercalate "\n" contents
385385
386386codeBlockIndented :: GenParser Char ParserState Block
387387codeBlockIndented = do
@@ -414,7 +414,7 @@ blockQuote :: GenParser Char ParserState Block
414414blockQuote = do
415415 raw <- emailBlockQuote
416416 -- parse the extracted block, which may contain various block elements:
417− contents <- parseFromString parseBlocks $ (joinWithSep "\n" raw) ++ "\n\n"
417+ contents <- parseFromString parseBlocks $ (intercalate "\n" raw) ++ "\n\n"
418418 return $ BlockQuote contents
419419
420420--
@@ -757,7 +757,7 @@ multilineTableHeader = try $ do
757757 let rawHeadsList = transpose $ map
758758 (\ln -> tail $ splitByIndices (init indices) ln)
759759 rawContent
760− let rawHeads = map (joinWithSep " ") rawHeadsList
760+ let rawHeads = map (intercalate " ") rawHeadsList
761761 let aligns = zipWith alignType rawHeadsList lengths
762762 return ((map removeLeadingTrailingSpace rawHeads), aligns, indices)
763763
@@ -884,7 +884,7 @@ mathInline = try $ do
884884 words' <- sepBy1 mathWord (many1 (spaceChar <|> (newline >>~ notFollowedBy' blankline)))
885885 char '$'
886886 notFollowedBy digit
887− return $ joinWithSep " " words'
887+ return $ intercalate " " words'
888888
889889emph :: GenParser Char ParserState Inline
890890emph = ((enclosed (char '*') (notFollowedBy' strong >> char '*') inline) <|>
Text/Pandoc/Readers/RST.hs+3−3
@@ -33,7 +33,7 @@ module Text.Pandoc.Readers.RST (
3333import Text.Pandoc.Definition
3434import Text.Pandoc.Shared
3535import Text.ParserCombinators.Parsec
36−import Data.List ( findIndex, delete )
36+import Data.List ( findIndex, delete, intercalate )
3737
3838-- | Parse reStructuredText string and return Pandoc document.
3939readRST :: ParserState -> String -> Pandoc
@@ -144,7 +144,7 @@ fieldListItem indent = try $ do
144144 first <- manyTill anyChar newline
145145 rest <- option "" $ try $ lookAhead (string indent >> oneOf " \t") >>
146146 indentedBlock
147− return (name, joinWithSep " " (first:(lines rest)))
147+ return (name, intercalate " " (first:(lines rest)))
148148
149149fieldList :: GenParser Char ParserState Block
150150fieldList = try $ do
@@ -583,7 +583,7 @@ code :: GenParser Char ParserState Inline
583583code = try $ do
584584 string "``"
585585 result <- manyTill anyChar (try (string "``"))
586− return $ Code $ removeLeadingTrailingSpace $ joinWithSep " " $ lines result
586+ return $ Code $ removeLeadingTrailingSpace $ intercalate " " $ lines result
587587
588588emph :: GenParser Char ParserState Inline
589589emph = enclosed (char '*') (char '*') inline >>=
Text/Pandoc/Shared.hs+9−17
@@ -33,7 +33,6 @@ module Text.Pandoc.Shared (
3333 splitBy,
3434 splitByIndices,
3535 substitute,
36− joinWithSep,
3736 -- * Text processing
3837 backslashEscapes,
3938 escapeStringUsing,
@@ -110,7 +109,7 @@ import Text.PrettyPrint.HughesPJ ( Doc, fsep, ($$), (<>), empty, isEmpty, text )
110109import qualified Text.PrettyPrint.HughesPJ as PP
111110import Text.Pandoc.CharacterReferences ( characterReference )
112111import Data.Char ( toLower, toUpper, ord, isLower, isUpper )
113−import Data.List ( find, isPrefixOf )
112+import Data.List ( find, isPrefixOf, intercalate )
114113import Control.Monad ( join )
115114import Network.URI ( parseURI, URI (..), isAllowedInURI )
116115import System.Directory
@@ -145,13 +144,6 @@ substitute target replacement lst =
145144 then replacement ++ (substitute target replacement $ drop (length target) lst)
146145 else (head lst):(substitute target replacement $ tail lst)
147146
148−-- | Joins a list of lists, separated by another list.
149−joinWithSep :: [a] -- ^ List to use as separator
150− -> [[a]] -- ^ Lists to join
151− -> [a]
152−joinWithSep _ [] = []
153−joinWithSep sep lst = foldr1 (\a b -> a ++ sep ++ b) lst
154−
155147--
156148-- Text processing
157149--
@@ -441,7 +433,7 @@ domain :: GenParser Char st [Char]
441433domain = do
442434 first <- many1 domainChar
443435 dom <- many1 $ try (char '.' >> many1 domainChar )
444− return $ joinWithSep "." (first:dom)
436+ return $ intercalate "." (first:dom)
445437
446438-- | Parses an email address; returns string.
447439emailAddress :: GenParser Char st [Char]
@@ -732,7 +724,7 @@ indentBy num first str =
732724 let (firstLine:restLines) = lines str
733725 firstLineIndent = num + first
734726 in (replicate firstLineIndent ' ') ++ firstLine ++ "\n" ++
735− (joinWithSep "\n" $ map ((replicate num ' ') ++ ) restLines)
727+ (intercalate "\n" $ map ((replicate num ' ') ++ ) restLines)
736728
737729-- | Prettyprint list of Pandoc blocks elements.
738730prettyBlockList :: Int -- ^ Number of spaces to indent list of blocks
@@ -740,7 +732,7 @@ prettyBlockList :: Int -- ^ Number of spaces to indent list of blocks
740732 -> String
741733prettyBlockList indent [] = indentBy indent 0 "[]"
742734prettyBlockList indent blocks = indentBy indent (-2) $ "[ " ++
743− (joinWithSep "\n, " (map prettyBlock blocks)) ++ " ]"
735+ (intercalate "\n, " (map prettyBlock blocks)) ++ " ]"
744736
745737-- | Prettyprint Pandoc block element.
746738prettyBlock :: Block -> String
@@ -748,20 +740,20 @@ prettyBlock (BlockQuote blocks) = "BlockQuote\n " ++
748740 (prettyBlockList 2 blocks)
749741prettyBlock (OrderedList attribs blockLists) =
750742 "OrderedList " ++ show attribs ++ "\n" ++ indentBy 2 0 ("[ " ++
751− (joinWithSep ", " $ map (\blocks -> prettyBlockList 2 blocks)
743+ (intercalate ", " $ map (\blocks -> prettyBlockList 2 blocks)
752744 blockLists)) ++ " ]"
753745prettyBlock (BulletList blockLists) = "BulletList\n" ++
754− indentBy 2 0 ("[ " ++ (joinWithSep ", "
746+ indentBy 2 0 ("[ " ++ (intercalate ", "
755747 (map (\blocks -> prettyBlockList 2 blocks) blockLists))) ++ " ]"
756748prettyBlock (DefinitionList blockLists) = "DefinitionList\n" ++
757− indentBy 2 0 ("[" ++ (joinWithSep ",\n"
749+ indentBy 2 0 ("[" ++ (intercalate ",\n"
758750 (map (\(term, blocks) -> " (" ++ show term ++ ",\n" ++
759751 indentBy 1 2 (prettyBlockList 2 blocks) ++ " )") blockLists))) ++ " ]"
760752prettyBlock (Table caption aligns widths header rows) =
761753 "Table " ++ show caption ++ " " ++ show aligns ++ " " ++
762754 show widths ++ "\n" ++ prettyRow header ++ " [\n" ++
763− (joinWithSep ",\n" (map prettyRow rows)) ++ " ]"
764− where prettyRow cols = indentBy 2 0 ("[ " ++ (joinWithSep ", "
755+ (intercalate ",\n" (map prettyRow rows)) ++ " ]"
756+ where prettyRow cols = indentBy 2 0 ("[ " ++ (intercalate ", "
765757 (map (\blocks -> prettyBlockList 2 blocks)
766758 cols))) ++ " ]"
767759prettyBlock block = show block
Text/Pandoc/Writers/ConTeXt.hs+3−3
@@ -31,7 +31,7 @@ module Text.Pandoc.Writers.ConTeXt ( writeConTeXt ) where
3131import Text.Pandoc.Definition
3232import Text.Pandoc.Shared
3333import Text.Printf ( printf )
34−import Data.List ( isSuffixOf )
34+import Data.List ( isSuffixOf, intercalate )
3535import Control.Monad.State
3636import Text.PrettyPrint.HughesPJ hiding ( Str )
3737
@@ -87,7 +87,7 @@ contextHeader options (Meta title authors date) = do
8787 then ""
8888 else if length authors == 1
8989 then stringToConTeXt $ head authors
90− else stringToConTeXt $ (joinWithSep ", " $
90+ else stringToConTeXt $ (intercalate ", " $
9191 init authors) ++ " & " ++ last authors
9292 let datetext = if date == ""
9393 then ""
@@ -168,7 +168,7 @@ blockToConTeXt (OrderedList (start, style', delim) lst) = do
168168 let specs2Items = filter (not . null) [start', delim', width'']
169169 let specs2 = if null specs2Items
170170 then ""
171− else "[" ++ joinWithSep "," specs2Items ++ "]"
171+ else "[" ++ intercalate "," specs2Items ++ "]"
172172 let style'' = case style' of
173173 DefaultStyle -> orderedListStyles !! level
174174 Decimal -> "[n]"
Text/Pandoc/Writers/Docbook.hs+2−2
@@ -32,7 +32,7 @@ import Text.Pandoc.Definition
3232import Text.Pandoc.XML
3333import Text.Pandoc.Shared
3434import Text.Pandoc.Readers.TeXMath
35−import Data.List ( isPrefixOf, drop )
35+import Data.List ( isPrefixOf, drop, intercalate )
3636import Text.PrettyPrint.HughesPJ hiding ( Str )
3737
3838-- | Convert list of authors to a docbook <author> section
@@ -50,7 +50,7 @@ authorToDocbook name = inTagsIndented "author" $
5050 (firstname, lastname) = case lengthname of
5151 0 -> ("","")
5252 1 -> ("", name)
53− n -> (joinWithSep " " (take (n-1) namewords), last namewords)
53+ n -> (intercalate " " (take (n-1) namewords), last namewords)
5454 in inTagsSimple "firstname" (text $ escapeStringForXML firstname) $$
5555 inTagsSimple "surname" (text $ escapeStringForXML lastname)
5656
Text/Pandoc/Writers/HTML.hs+2−2
@@ -37,7 +37,7 @@ import Text.Pandoc.Readers.TeXMath
3737import Text.Pandoc.Highlighting ( highlightHtml, defaultHighlightingCss )
3838import Numeric ( showHex )
3939import Data.Char ( ord, toLower, isAlpha )
40−import Data.List ( isPrefixOf, intersperse )
40+import Data.List ( isPrefixOf, intercalate )
4141import qualified Data.Set as S
4242import Control.Monad.State
4343import Text.XHtml.Transitional hiding ( stringToHtml )
@@ -252,7 +252,7 @@ inlineListToIdentifier' (x:xs) =
252252 xAsText ++ inlineListToIdentifier' xs
253253 where xAsText = case x of
254254 Str s -> filter (\c -> c == '-' || not (isPunctuation c)) $
255− concat $ intersperse "-" $ words $ map toLower s
255+ intercalate "-" $ words $ map toLower s
256256 Emph lst -> inlineListToIdentifier' lst
257257 Strikeout lst -> inlineListToIdentifier' lst
258258 Superscript lst -> inlineListToIdentifier' lst
Text/Pandoc/Writers/LaTeX.hs+2−2
@@ -31,7 +31,7 @@ module Text.Pandoc.Writers.LaTeX ( writeLaTeX ) where
3131import Text.Pandoc.Definition
3232import Text.Pandoc.Shared
3333import Text.Printf ( printf )
34−import Data.List ( (\\), isSuffixOf )
34+import Data.List ( (\\), isSuffixOf, intercalate )
3535import Data.Char ( toLower )
3636import qualified Data.Set as S
3737import Control.Monad.State
@@ -92,7 +92,7 @@ latexHeader options (Meta title authors date) = do
9292 then text "\\VerbatimFootnotes % allows verbatim text in footnotes"
9393 else empty
9494 let authorstext = text $ "\\author{" ++
95− joinWithSep "\\\\" (map stringToLaTeX authors) ++ "}"
95+ intercalate "\\\\" (map stringToLaTeX authors) ++ "}"
9696 let datetext = if date == ""
9797 then empty
9898 else text $ "\\date{" ++ stringToLaTeX date ++ "}"
Text/Pandoc/Writers/Man.hs+4−4
@@ -32,7 +32,7 @@ module Text.Pandoc.Writers.Man ( writeMan) where
3232import Text.Pandoc.Definition
3333import Text.Pandoc.Shared
3434import Text.Printf ( printf )
35−import Data.List ( isPrefixOf, drop, nub, intersperse )
35+import Data.List ( isPrefixOf, drop, nub, intersperse, intercalate )
3636import Text.PrettyPrint.HughesPJ hiding ( Str )
3737import Control.Monad.State
3838
@@ -77,8 +77,8 @@ metaToMan options (Meta title authors date) = do
7777 doubleQuotes (text date) <+> hsep extras
7878 let foot = case length authors of
7979 0 -> empty
80− 1 -> text ".SH AUTHOR" $$ (text $ joinWithSep ", " authors)
81− _ -> text ".SH AUTHORS" $$ (text $ joinWithSep ", " authors)
80+ 1 -> text ".SH AUTHOR" $$ (text $ intercalate ", " authors)
81+ _ -> text ".SH AUTHORS" $$ (text $ intercalate ", " authors)
8282 return $ if writerStandalone options
8383 then (head', foot)
8484 else (empty, empty)
@@ -144,7 +144,7 @@ blockToMan opts (Table caption alignments widths headers rows) =
144144 modify (\(notes, preprocessors) -> (notes, "t":preprocessors))
145145 let iwidths = map (printf "w(%0.2fn)" . (70 *)) widths
146146 -- 78n default width - 8n indent = 70n
147− let coldescriptions = text $ joinWithSep " "
147+ let coldescriptions = text $ intercalate " "
148148 (zipWith (\align width -> aligncode align ++ width)
149149 alignments iwidths) ++ "."
150150 colheadings <- mapM (blockListToMan opts) headers
Text/Pandoc/Writers/Markdown.hs+2−2
@@ -34,7 +34,7 @@ import Text.Pandoc.Definition
3434import Text.Pandoc.Shared
3535import Text.Pandoc.Blocks
3636import Text.ParserCombinators.Parsec ( parse, GenParser )
37−import Data.List ( group, isPrefixOf, drop, find, intersperse )
37+import Data.List ( group, isPrefixOf, drop, find, intersperse, intercalate )
3838import Text.PrettyPrint.HughesPJ hiding ( Str )
3939import Control.Monad.State
4040
@@ -119,7 +119,7 @@ titleToMarkdown opts lst = do
119119authorsToMarkdown :: [String] -> State WriterState Doc
120120authorsToMarkdown [] = return empty
121121authorsToMarkdown lst = return $
122− text "% " <> text (joinWithSep ", " (map escapeString lst))
122+ text "% " <> text (intercalate ", " (map escapeString lst))
123123
124124dateToMarkdown :: String -> State WriterState Doc
125125dateToMarkdown [] = return empty
Text/Pandoc/Writers/OpenDocument.hs+2−1
@@ -39,6 +39,7 @@ import Control.Applicative ( (<$>) )
3939import Control.Arrow ( (***), (>>>) )
4040import Control.Monad.State hiding ( when )
4141import Data.Char (chr)
42+import Data.List (intercalate)
4243
4344-- | Auxiliary function to convert Plain block to Para.
4445plainToPara :: Block -> Block
@@ -171,7 +172,7 @@ authorToOpenDocument name =
171172 (firstname, lastname) = case lengthname of
172173 0 -> ("","")
173174 1 -> ("", name)
174− n -> (joinWithSep " " (take (n-1) namewords), last namewords)
175+ n -> (intercalate " " (take (n-1) namewords), last namewords)
175176 in inParagraphTagsWithStyle "Author" $
176177 (text $ escapeStringForXML firstname) <+>
177178 (text $ escapeStringForXML lastname)
Text/Pandoc/Writers/RTF.hs+3−3
@@ -31,7 +31,7 @@ module Text.Pandoc.Writers.RTF ( writeRTF ) where
3131import Text.Pandoc.Definition
3232import Text.Pandoc.Shared
3333import Text.Pandoc.Readers.TeXMath
34−import Data.List ( isSuffixOf )
34+import Data.List ( isSuffixOf, intercalate )
3535import Data.Char ( ord, isDigit )
3636
3737-- | Convert Pandoc to a string in rich text format.
@@ -82,7 +82,7 @@ stringToRTF = handleUnicode . escapeSpecial
8282
8383-- | Escape things as needed for code block in RTF.
8484codeStringToRTF :: String -> String
85−codeStringToRTF str = joinWithSep "\\line\n" $ lines (stringToRTF str)
85+codeStringToRTF str = intercalate "\\line\n" $ lines (stringToRTF str)
8686
8787-- | Make a paragraph with first-line indent, block indent, and space after.
8888rtfParSpaced :: Int -- ^ space after (in twips)
@@ -150,7 +150,7 @@ rtfHeader headerText (Meta title authors date) =
150150 "\\b \\fs36 " ++ inlineListToRTF title
151151 authorstext = if null authors
152152 then ""
153− else rtfPar 0 0 AlignCenter (" " ++ (joinWithSep "\\" $
153+ else rtfPar 0 0 AlignCenter (" " ++ (intercalate "\\" $
154154 map stringToRTF authors))
155155 datetext = if date == ""
156156 then ""
Text/Pandoc/Writers/S5.hs+3−2
@@ -40,12 +40,13 @@ module Text.Pandoc.Writers.S5 (
4040 writeS5String,
4141 insertS5Structure
4242 ) where
43−import Text.Pandoc.Shared ( joinWithSep, WriterOptions )
43+import Text.Pandoc.Shared ( WriterOptions )
4444import Text.Pandoc.TH ( contentsOf )
4545import Text.Pandoc.Writers.HTML ( writeHtml, writeHtmlString )
4646import Text.Pandoc.Definition
4747import Text.XHtml.Strict
4848import System.FilePath ( (</>) )
49+import Data.List ( intercalate )
4950
5051s5Meta :: String
5152s5Meta = "<!-- configuration parameters -->\n<meta name=\"defaultView\" content=\"slideshow\" />\n<meta name=\"controlVis\" content=\"hidden\" />\n"
@@ -148,7 +149,7 @@ insertS5Structure (Pandoc (Meta title' authors date) blocks) =
148149 let slides = insertSlides True blocks
149150 firstSlide = if not (null title')
150151 then [slideStart, (Header 1 title'),
151− (Header 3 [Str (joinWithSep ", " authors)]),
152+ (Header 3 [Str (intercalate ", " authors)]),
152153 (Header 4 [Str date]), slideEnd]
153154 else []
154155 newBlocks = (layoutDiv title' date) ++ presentationStart:firstSlide ++
pandoc.cabal+3−9
@@ -120,9 +120,6 @@ Extra-Source-Files:
120120Extra-Tmp-Files: man/man1/pandoc.1, man/man1/hsmarkdown.1,
121121 man/man1/html2markdown.1
122122
123−Flag splitBase
124− Description: Choose the new, smaller, split-up base package.
125− Default: True
126123Flag highlighting
127124 Description: Compile in support for syntax highlighting of code blocks.
128125 Default: False
@@ -137,10 +134,9 @@ Flag citeproc
137134 Default: False
138135
139136Library
140− if flag(splitBase)
141− Build-Depends: base >= 3, pretty, containers
142− else
143− Build-Depends: base < 3
137+ Build-Depends: base >= 3, pretty, containers, parsec < 3, xhtml, mtl, network,
138+ filepath, process, directory, template-haskell, bytestring,
139+ zip-archive, utf8-string, old-time
144140 if flag(highlighting)
145141 Build-depends: highlighting-kate
146142 cpp-options: -D_HIGHLIGHTING
@@ -148,8 +144,6 @@ Library
148144 Build-depends: citeproc-hs
149145 Exposed-Modules: Text.Pandoc.Biblio
150146 cpp-options: -D_CITEPROC
151− Build-Depends: parsec < 3, xhtml, mtl, network, filepath, process, directory,
152− template-haskell, bytestring, zip-archive, utf8-string, old-time
153147 Hs-Source-Dirs: .
154148 Exposed-Modules: Text.Pandoc,
155149 Text.Pandoc.Blocks,