summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-07 05:43:23 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-07 05:43:23 +0000
commitfdf31cd23d85e9615c891edadb726137150c5384 (patch)
tree09209322e496fdef91f5deae79b2438e1ff60ad9 /src/Main.hs
parent98372ea277e698c44ed192d56fff68a041233315 (diff)
Added writerTableOfContents to WriterOptions, and added a
--table-of-contents/--toc command-line option to Main.hs. git-svn-id: https://pandoc.googlecode.com/svn/trunk@632 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 95b4420c1..d25e38911 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -107,6 +107,7 @@ data Opt = Opt
, optWriter :: String -- ^ Writer format
, optParseRaw :: Bool -- ^ Parse unconvertable HTML and TeX
, 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
, optIncludeAfterBody :: String -- ^ File to include at end of body
@@ -133,6 +134,7 @@ defaultOpts = Opt
, optWriter = "" -- null for default writer
, optParseRaw = False
, optCSS = ""
+ , optTableOfContents = False
, optIncludeInHeader = ""
, optIncludeBeforeBody = ""
, optIncludeAfterBody = ""
@@ -230,6 +232,11 @@ options =
"CSS")
"" -- "Link to CSS style sheet"
+ , Option "" ["toc", "table-of-contents"]
+ (NoArg
+ (\opt -> return opt { optTableOfContents = True }))
+ "" -- "Include table of contents"
+
, Option "H" ["include-in-header"]
(ReqArg
(\arg opt -> do
@@ -395,6 +402,7 @@ main = do
, optWriter = writerName
, optParseRaw = parseRaw
, optCSS = css
+ , optTableOfContents = toc
, optIncludeInHeader = includeHeader
, optIncludeBeforeBody = includeBefore
, optIncludeAfterBody = includeAfter
@@ -471,6 +479,8 @@ main = do
writerHeader = header,
writerTitlePrefix = titlePrefix,
writerTabStop = tabStop,
+ writerTableOfContents = toc &&
+ (not strict),
writerS5 = (writerName=="s5"),
writerIncremental = incremental,
writerNumberSections = numberSections,