@@ -107,6 +107,7 @@ data Opt = Opt
107 , optWriter :: String -- ^ Writer format
107 , optWriter :: String -- ^ Writer format
108 , optParseRaw :: Bool -- ^ Parse unconvertable HTML and TeX
108 , optParseRaw :: Bool -- ^ Parse unconvertable HTML and TeX
109 , optCSS :: String -- ^ CSS file to link to
109 , optCSS :: String -- ^ CSS file to link to
110+ , optTableOfContents :: Bool -- ^ Include table of contents
110 , optIncludeInHeader :: String -- ^ File to include in header
111 , optIncludeInHeader :: String -- ^ File to include in header
111 , optIncludeBeforeBody :: String -- ^ File to include at top of body
112 , optIncludeBeforeBody :: String -- ^ File to include at top of body
112 , optIncludeAfterBody :: String -- ^ File to include at end of body
113 , optIncludeAfterBody :: String -- ^ File to include at end of body
@@ -133,6 +134,7 @@ defaultOpts = Opt
133 , optWriter = "" -- null for default writer
134 , optWriter = "" -- null for default writer
134 , optParseRaw = False
135 , optParseRaw = False
135 , optCSS = ""
136 , optCSS = ""
137+ , optTableOfContents = False
136 , optIncludeInHeader = ""
138 , optIncludeInHeader = ""
137 , optIncludeBeforeBody = ""
139 , optIncludeBeforeBody = ""
138 , optIncludeAfterBody = ""
140 , optIncludeAfterBody = ""
@@ -230,6 +232,11 @@ options =
231 "" -- "Link to CSS style sheet"
233 "" -- "Link to CSS style sheet"
235+ , Option "" ["toc", "table-of-contents"]
237+ (\opt -> return opt { optTableOfContents = True }))
238+ "" -- "Include table of contents"
233 , Option "H" ["include-in-header"]
240 , Option "H" ["include-in-header"]
235 (\arg opt -> do
242 (\arg opt -> do
@@ -395,6 +402,7 @@ main = do
395 , optWriter = writerName
402 , optWriter = writerName
396 , optParseRaw = parseRaw
403 , optParseRaw = parseRaw
397 , optCSS = css
404 , optCSS = css
405+ , optTableOfContents = toc
398 , optIncludeInHeader = includeHeader
406 , optIncludeInHeader = includeHeader
399 , optIncludeBeforeBody = includeBefore
407 , optIncludeBeforeBody = includeBefore
400 , optIncludeAfterBody = includeAfter
408 , optIncludeAfterBody = includeAfter
@@ -471,6 +479,8 @@ main = do
471 writerHeader = header,
479 writerHeader = header,
472 writerTitlePrefix = titlePrefix,
480 writerTitlePrefix = titlePrefix,
473 writerTabStop = tabStop,
481 writerTabStop = tabStop,
482+ writerTableOfContents = toc &&
474 writerS5 = (writerName=="s5"),
484 writerS5 = (writerName=="s5"),
475 writerIncremental = incremental,
485 writerIncremental = incremental,
476 writerNumberSections = numberSections,
486 writerNumberSections = numberSections,