git.iko.soy/typeable/pandoc
on master help sign in
Made -c/--css option repeatable on the command line (like -H, -A, -B).

Documented repeatability of these options in README. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1186 788f1e2b-df1e-0410-8736-df70ead52e1b

commitc453e2f7d5dc469a87a1399c9c8e7aa0aa4ed991 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateTue 8 Jan 2008, 20:21 (19 years ago) parent936465a
2 files changed+23−12
Main.hs+12−8 README+11−4
Main.hs+12−8
@@ -87,7 +87,7 @@ data Opt = Opt
8787 , optReader :: String -- ^ Reader format
8888 , optWriter :: String -- ^ Writer format
8989 , optParseRaw :: Bool -- ^ Parse unconvertable HTML and TeX
90− , optCSS :: String -- ^ CSS file to link to
90+ , optCSS :: [String] -- ^ CSS file to link to
9191 , optTableOfContents :: Bool -- ^ Include table of contents
9292 , optIncludeInHeader :: String -- ^ File to include in header
9393 , optIncludeBeforeBody :: String -- ^ File to include at top of body
@@ -116,7 +116,7 @@ defaultOpts = Opt
116116 , optReader = "" -- null for default reader
117117 , optWriter = "" -- null for default writer
118118 , optParseRaw = False
119− , optCSS = ""
119+ , optCSS = []
120120 , optTableOfContents = False
121121 , optIncludeInHeader = ""
122122 , optIncludeBeforeBody = ""
@@ -240,8 +240,10 @@ options =
240240
241241 , Option "c" ["css"]
242242 (ReqArg
243− (\arg opt -> return opt { optCSS = arg,
244− optStandalone = True })
243+ (\arg opt -> do
244+ let old = optCSS opt
245+ return opt { optCSS = old ++ [arg],
246+ optStandalone = True })
245247 "CSS")
246248 "" -- "Link to CSS style sheet"
247249
@@ -492,10 +494,12 @@ main = do
492494 ["latex", "context"],
493495 stateColumns = columns,
494496 stateStrict = strict }
495− let csslink = if (css == "")
496− then ""
497− else "<link rel=\"stylesheet\" href=\"" ++ css ++
498− "\" type=\"text/css\" media=\"all\" />\n"
497+ let csslink = if null css
498+ then ""
499+ else concatMap
500+ (\f -> "<link rel=\"stylesheet\" href=\"" ++
501+ f ++ "\" type=\"text/css\" media=\"all\" />\n")
502+ css
499503 let header = (if (customHeader == "DEFAULT")
500504 then defaultHeader
501505 else customHeader) ++ csslink ++ includeHeader
README+11−4
@@ -277,23 +277,30 @@ For further documentation, see the `pandoc(1)` man page.
277277
278278`-c` or `--css` *filename*
279279: allows the user to specify a custom stylesheet that will be linked to
280− in HTML and S5 output.
280+ in HTML and S5 output. This option can be used repeatedly to include
281+ multiple stylesheets. They will be included in the order specified.
281282
282283`-H` or `--include-in-header` *filename*
283284: includes the contents of *filename* (verbatim) at the end of the
284285 document header. This can be used, for example, to include special
285− CSS or javascript in HTML documents.
286+ CSS or javascript in HTML documents. This option can be used
287+ repeatedly to include multiple files in the header. They will be
288+ included in the order specified.
286289
287290`-B` or `--include-before-body` *filename*
288291: includes the contents of *filename* (verbatim) at the beginning of
289292 the document body (e.g. after the `<body>` tag in HTML, or the
290293 `\begin{document}` command in LaTeX). This can be used to include
291− navigation bars or banners in HTML documents.
294+ navigation bars or banners in HTML documents. This option can be
295+ used repeatedly to include multiple files. They will be included in
296+ the order specified.
292297
293298`-A` or `--include-after-body` *filename*
294299: includes the contents of *filename* (verbatim) at the end of
295300 the document body (before the `</body>` tag in HTML, or the
296− `\end{document}` command in LaTeX).
301+ `\end{document}` command in LaTeX). This option can be be used
302+ repeatedly to include multiple files. They will be included in the
303+ order specified.
297304
298305`-T` or `--title-prefix` *string*
299306: includes *string* as a prefix at the beginning of the title that