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
This commit is contained in:
fiddlosopher 2008-01-08 20:21:28 +00:00
parent 936465ade0
commit c453e2f7d5
2 changed files with 23 additions and 12 deletions

20
Main.hs
View file

@ -87,7 +87,7 @@ data Opt = Opt
, optReader :: String -- ^ Reader format
, optWriter :: String -- ^ Writer format
, optParseRaw :: Bool -- ^ Parse unconvertable HTML and TeX
, optCSS :: String -- ^ CSS file to link to
, optCSS :: [String] -- ^ CSS file to link to
, optTableOfContents :: Bool -- ^ Include table of contents
, optIncludeInHeader :: String -- ^ File to include in header
, optIncludeBeforeBody :: String -- ^ File to include at top of body
@ -116,7 +116,7 @@ defaultOpts = Opt
, optReader = "" -- null for default reader
, optWriter = "" -- null for default writer
, optParseRaw = False
, optCSS = ""
, optCSS = []
, optTableOfContents = False
, optIncludeInHeader = ""
, optIncludeBeforeBody = ""
@ -240,8 +240,10 @@ options =
, Option "c" ["css"]
(ReqArg
(\arg opt -> return opt { optCSS = arg,
optStandalone = True })
(\arg opt -> do
let old = optCSS opt
return opt { optCSS = old ++ [arg],
optStandalone = True })
"CSS")
"" -- "Link to CSS style sheet"
@ -492,10 +494,12 @@ main = do
["latex", "context"],
stateColumns = columns,
stateStrict = strict }
let csslink = if (css == "")
then ""
else "<link rel=\"stylesheet\" href=\"" ++ css ++
"\" type=\"text/css\" media=\"all\" />\n"
let csslink = if null css
then ""
else concatMap
(\f -> "<link rel=\"stylesheet\" href=\"" ++
f ++ "\" type=\"text/css\" media=\"all\" />\n")
css
let header = (if (customHeader == "DEFAULT")
then defaultHeader
else customHeader) ++ csslink ++ includeHeader

15
README
View file

@ -277,23 +277,30 @@ For further documentation, see the `pandoc(1)` man page.
`-c` or `--css` *filename*
: allows the user to specify a custom stylesheet that will be linked to
in HTML and S5 output.
in HTML and S5 output. This option can be used repeatedly to include
multiple stylesheets. They will be included in the order specified.
`-H` or `--include-in-header` *filename*
: includes the contents of *filename* (verbatim) at the end of the
document header. This can be used, for example, to include special
CSS or javascript in HTML documents.
CSS or javascript in HTML documents. This option can be used
repeatedly to include multiple files in the header. They will be
included in the order specified.
`-B` or `--include-before-body` *filename*
: includes the contents of *filename* (verbatim) at the beginning of
the document body (e.g. after the `<body>` tag in HTML, or the
`\begin{document}` command in LaTeX). This can be used to include
navigation bars or banners in HTML documents.
navigation bars or banners in HTML documents. This option can be
used repeatedly to include multiple files. They will be included in
the order specified.
`-A` or `--include-after-body` *filename*
: includes the contents of *filename* (verbatim) at the end of
the document body (before the `</body>` tag in HTML, or the
`\end{document}` command in LaTeX).
`\end{document}` command in LaTeX). This option can be be used
repeatedly to include multiple files. They will be included in the
order specified.
`-T` or `--title-prefix` *string*
: includes *string* as a prefix at the beginning of the title that