git.iko.soy/typeable/pandoc
on master help sign in
Merge branch 'master' into tests
5da2d1eJohn MacFarlane
README+12−4
@@ -208,6 +208,10 @@ Options
208 `markdown` or `textile`. It is selected automatically when the input
208 `markdown` or `textile`. It is selected automatically when the input
209 format is `textile` or the output format is `latex` or `context`.)
209 format is `textile` or the output format is `latex` or `context`.)
210
210
211+`-5`, `--html5`
212+: Produce HTML5 instead of HTML4. This option has no effect for writers
213+ other than `html`.
214+
211`-m` *URL*, `--latexmathml=`*URL*
215`-m` *URL*, `--latexmathml=`*URL*
212: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
216: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
213 To insert a link to a local copy of the `LaTeXMathML.js` script,
217 To insert a link to a local copy of the `LaTeXMathML.js` script,
@@ -262,8 +266,9 @@ Options
262 By default, sections are not numbered.
266 By default, sections are not numbered.
263
267
264`--section-divs`
268`--section-divs`
269+: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
265−: Wrap sections in `<div>` tags, and attach identifiers to the
270+ and attach identifiers to the enclosing `<div>` (or `<section>`)
266− enclosing `<div>` rather than the header itself.
271+ rather than the header itself.
267 See [Section identifiers](#header-identifiers-in-html), below.
272 See [Section identifiers](#header-identifiers-in-html), below.
268
273
269`--no-wrap`
274`--no-wrap`
@@ -504,6 +509,8 @@ depending on the output format, but include:
504 multiple values)
509 multiple values)
505`date`
510`date`
506: date of document, as specified in title block
511: date of document, as specified in title block
512+`lang`
513+: language code for HTML documents
507
514
508Variables may be set at the command line using the `-V/--variable`
515Variables may be set at the command line using the `-V/--variable`
509option. This allows users to include custom variables in their
516option. This allows users to include custom variables in their
@@ -1143,8 +1150,9 @@ Note, however, that this method of providing links to sections works
1143only in HTML.
1150only in HTML.
1144
1151
1145If the `--section-divs` option is specified, then each section will
1152If the `--section-divs` option is specified, then each section will
1153+be wrapped in a `div` (or a `section`, if `--html5` was specified),
1146−be wrapped in a `div`, and the identifier will be attached to the
1154+and the identifier will be attached to the enclosing `<div>`
1147−enclosing `<div>` tag rather than the header itself. This allows entire
1155+(or `<section>`) tag rather than the header itself. This allows entire
1148sections to be manipulated using javascript or treated differently in
1156sections to be manipulated using javascript or treated differently in
1149CSS.
1157CSS.
1150
1158
Setup.hs+3−3
@@ -9,7 +9,7 @@ import Distribution.Verbosity ( Verbosity, silent )
9import Distribution.Simple.InstallDirs (mandir, bindir, CopyDest (NoCopyDest))
9import Distribution.Simple.InstallDirs (mandir, bindir, CopyDest (NoCopyDest))
10import Distribution.Simple.Utils (copyFiles)
10import Distribution.Simple.Utils (copyFiles)
11import Control.Exception ( bracket_ )
11import Control.Exception ( bracket_ )
12−import Control.Monad ( unless, when )
12+import Control.Monad ( unless )
13import System.Process ( rawSystem, runCommand, runProcess, waitForProcess )
13import System.Process ( rawSystem, runCommand, runProcess, waitForProcess )
14import System.FilePath ( (</>), (<.>) )
14import System.FilePath ( (</>), (<.>) )
15import System.Directory
15import System.Directory
@@ -50,8 +50,8 @@ runTestSuite args _ pkg lbi = do
50
50
51-- | Build man pages from markdown sources in man/man1/.
51-- | Build man pages from markdown sources in man/man1/.
52makeManPages :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
52makeManPages :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
53−makeManPages _ flags _ buildInfo = do
53+makeManPages _ flags _ bi = do
54− let pandocPath = (buildDir buildInfo) </> "pandoc" </> "pandoc"
54+ let pandocPath = (buildDir bi) </> "pandoc" </> "pandoc"
55 makeManPage pandocPath (fromFlag $ buildVerbosity flags) "markdown2pdf.1"
55 makeManPage pandocPath (fromFlag $ buildVerbosity flags) "markdown2pdf.1"
56 let testCmd = "runghc -package-conf=dist/package.conf.inplace MakeManPage.hs" -- makes pandoc.1 from README
56 let testCmd = "runghc -package-conf=dist/package.conf.inplace MakeManPage.hs" -- makes pandoc.1 from README
57 runCommand testCmd >>= waitForProcess >>= exitWith
57 runCommand testCmd >>= waitForProcess >>= exitWith
src/Text/Pandoc.hs+12−6
@@ -146,13 +146,15 @@ readers :: [(String, ParserState -> String -> Pandoc)]
146readers = [("native" , \_ -> read)
146readers = [("native" , \_ -> read)
147 ,("json" , \_ -> decodeJSON)
147 ,("json" , \_ -> decodeJSON)
148 ,("markdown" , readMarkdown)
148 ,("markdown" , readMarkdown)
149− ,("markdown+lhs" , readMarkdown)
149+ ,("markdown+lhs" , \st ->
150+ readMarkdown st{ stateLiterateHaskell = True})
150 ,("rst" , readRST)
151 ,("rst" , readRST)
151 ,("textile" , readTextile) -- TODO : textile+lhs
152 ,("textile" , readTextile) -- TODO : textile+lhs
152 ,("rst+lhs" , readRST)
153 ,("rst+lhs" , readRST)
153 ,("html" , readHtml)
154 ,("html" , readHtml)
154 ,("latex" , readLaTeX)
155 ,("latex" , readLaTeX)
155− ,("latex+lhs" , readLaTeX)
156+ ,("latex+lhs" , \st ->
157+ readLaTeX st{ stateLiterateHaskell = True})
156 ]
158 ]
157
159
158-- | Association list of formats and writers (omitting the
160-- | Association list of formats and writers (omitting the
@@ -161,21 +163,25 @@ writers :: [ ( String, WriterOptions -> Pandoc -> String ) ]
161writers = [("native" , writeNative)
163writers = [("native" , writeNative)
162 ,("json" , \_ -> encodeJSON)
164 ,("json" , \_ -> encodeJSON)
163 ,("html" , writeHtmlString)
165 ,("html" , writeHtmlString)
166+ ,("html+lhs" , \o ->
164− ,("html+lhs" , writeHtmlString)
167+ writeHtmlString o{ writerLiterateHaskell = True })
165 ,("s5" , writeHtmlString)
168 ,("s5" , writeHtmlString)
166 ,("slidy" , writeHtmlString)
169 ,("slidy" , writeHtmlString)
167 ,("docbook" , writeDocbook)
170 ,("docbook" , writeDocbook)
168 ,("opendocument" , writeOpenDocument)
171 ,("opendocument" , writeOpenDocument)
169 ,("latex" , writeLaTeX)
172 ,("latex" , writeLaTeX)
170− ,("latex+lhs" , writeLaTeX)
173+ ,("latex+lhs" , \o ->
174+ writeLaTeX o{ writerLiterateHaskell = True })
171 ,("context" , writeConTeXt)
175 ,("context" , writeConTeXt)
172 ,("texinfo" , writeTexinfo)
176 ,("texinfo" , writeTexinfo)
173 ,("man" , writeMan)
177 ,("man" , writeMan)
174 ,("markdown" , writeMarkdown)
178 ,("markdown" , writeMarkdown)
175− ,("markdown+lhs" , writeMarkdown)
179+ ,("markdown+lhs" , \o ->
180+ writeMarkdown o{ writerLiterateHaskell = True })
176 ,("plain" , writePlain)
181 ,("plain" , writePlain)
177 ,("rst" , writeRST)
182 ,("rst" , writeRST)
178− ,("rst+lhs" , writeRST)
183+ ,("rst+lhs" , \o ->
184+ writeRST o{ writerLiterateHaskell = True })
179 ,("mediawiki" , writeMediaWiki)
185 ,("mediawiki" , writeMediaWiki)
180 ,("textile" , writeTextile)
186 ,("textile" , writeTextile)
181 ,("rtf" , writeRTF)
187 ,("rtf" , writeRTF)
src/Text/Pandoc/Shared.hs+2
@@ -481,6 +481,7 @@ data WriterOptions = WriterOptions
481 , writerUserDataDir :: Maybe FilePath -- ^ Path of user data directory
481 , writerUserDataDir :: Maybe FilePath -- ^ Path of user data directory
482 , writerCiteMethod :: CiteMethod -- ^ How to print cites
482 , writerCiteMethod :: CiteMethod -- ^ How to print cites
483 , writerBiblioFiles :: [FilePath] -- ^ Biblio files to use for citations
483 , writerBiblioFiles :: [FilePath] -- ^ Biblio files to use for citations
484+ , writerHtml5 :: Bool -- ^ Produce HTML5
484 } deriving Show
485 } deriving Show
485
486
486-- | Default writer options.
487-- | Default writer options.
@@ -510,6 +511,7 @@ defaultWriterOptions =
510 , writerUserDataDir = Nothing
511 , writerUserDataDir = Nothing
511 , writerCiteMethod = Citeproc
512 , writerCiteMethod = Citeproc
512 , writerBiblioFiles = []
513 , writerBiblioFiles = []
514+ , writerHtml5 = False
513 }
515 }
514
516
515--
517--
src/Text/Pandoc/Writers/HTML.hs+40−14
@@ -170,6 +170,7 @@ inTemplate opts tit auths date toc body' newvars =
170 , ("pagetitle", topTitle')
170 , ("pagetitle", topTitle')
171 , ("title", renderHtmlFragment tit)
171 , ("title", renderHtmlFragment tit)
172 , ("date", date') ] ++
172 , ("date", date') ] ++
173+ [ ("html5","true") | writerHtml5 opts ] ++
173 (case toc of
174 (case toc of
174 Just t -> [ ("toc", renderHtmlFragment t)]
175 Just t -> [ ("toc", renderHtmlFragment t)]
175 Nothing -> []) ++
176 Nothing -> []) ++
@@ -189,7 +190,12 @@ tableOfContents opts sects = do
189 let tocList = catMaybes contents
190 let tocList = catMaybes contents
190 return $ if null tocList
191 return $ if null tocList
191 then Nothing
192 then Nothing
193+ else Just $
194+ if writerHtml5 opts
195+ then tag "nav" ! [prefixedId opts' "TOC"] $
196+ unordList tocList
192− else Just $ thediv ! [prefixedId opts' "TOC"] $ unordList tocList
197+ else thediv ! [prefixedId opts' "TOC"] $
198+ unordList tocList
193
199
194-- | Convert section number to string
200-- | Convert section number to string
195showSecNum :: [Int] -> String
201showSecNum :: [Int] -> String
@@ -226,7 +232,9 @@ elementToHtml opts (Sec level num id' title' elements) = do
226 return $ if slides -- S5 gets confused by the extra divs around sections
232 return $ if slides -- S5 gets confused by the extra divs around sections
227 then toHtmlFromList stuff
233 then toHtmlFromList stuff
228 else if writerSectionDivs opts
234 else if writerSectionDivs opts
235+ then if writerHtml5 opts
236+ then tag "section" << stuff
229− then thediv ! [prefixedId opts id'] << stuff
237+ else thediv ! [prefixedId opts id'] << stuff
230 else toHtmlFromList stuff
238 else toHtmlFromList stuff
231
239
232-- | Convert list of Note blocks to a footnote <div>.
240-- | Convert list of Note blocks to a footnote <div>.
@@ -296,8 +304,11 @@ blockToHtml opts (Plain lst) = inlineListToHtml opts lst
296blockToHtml opts (Para [Image txt (s,tit)]) = do
304blockToHtml opts (Para [Image txt (s,tit)]) = do
297 img <- inlineToHtml opts (Image txt (s,tit))
305 img <- inlineToHtml opts (Image txt (s,tit))
298 capt <- inlineListToHtml opts txt
306 capt <- inlineListToHtml opts txt
307+ return $ if writerHtml5 opts
308+ then tag "figure" <<
309+ [img, tag "figcaption" << capt]
299− return $ thediv ! [theclass "figure"] <<
310+ else thediv ! [theclass "figure"] <<
300− [img, paragraph ! [theclass "caption"] << capt]
311+ [img, paragraph ! [theclass "caption"] << capt]
301blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph)
312blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph)
302blockToHtml _ (RawHtml str) = return $ primHtml str
313blockToHtml _ (RawHtml str) = return $ primHtml str
303blockToHtml _ (HorizontalRule) = return $ hr
314blockToHtml _ (HorizontalRule) = return $ hr
@@ -368,7 +379,17 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do
368 then [start startnum]
379 then [start startnum]
369 else []) ++
380 else []) ++
370 (if numstyle /= DefaultStyle
381 (if numstyle /= DefaultStyle
382+ then if writerHtml5 opts
383+ then [strAttr "type" $
384+ case numstyle of
385+ Decimal -> "1"
386+ LowerAlpha -> "a"
387+ UpperAlpha -> "A"
388+ LowerRoman -> "i"
389+ UpperRoman -> "I"
390+ _ -> "1"]
371− then [thestyle $ "list-style-type: " ++ numstyle' ++ ";"]
391+ else [thestyle $ "list-style-type: " ++
392+ numstyle']
372 else [])
393 else [])
373 return $ ordList ! attribs $ contents
394 return $ ordList ! attribs $ contents
374blockToHtml opts (DefinitionList lst) = do
395blockToHtml opts (DefinitionList lst) = do
@@ -381,28 +402,30 @@ blockToHtml opts (DefinitionList lst) = do
381 else []
402 else []
382 return $ dlist ! attribs << concat contents
403 return $ dlist ! attribs << concat contents
383blockToHtml opts (Table capt aligns widths headers rows') = do
404blockToHtml opts (Table capt aligns widths headers rows') = do
384− let alignStrings = map alignmentToString aligns
385 captionDoc <- if null capt
405 captionDoc <- if null capt
386 then return noHtml
406 then return noHtml
387 else inlineListToHtml opts capt >>= return . caption
407 else inlineListToHtml opts capt >>= return . caption
388 let percent w = show (truncate (100*w) :: Integer) ++ "%"
408 let percent w = show (truncate (100*w) :: Integer) ++ "%"
409+ let widthAttrs w = if writerHtml5 opts
410+ then [thestyle $ "width: " ++ percent w]
411+ else [width $ percent w]
389 let coltags = if all (== 0.0) widths
412 let coltags = if all (== 0.0) widths
390 then noHtml
413 then noHtml
391 else concatHtml $ map
414 else concatHtml $ map
392− (\w -> col ! [width $ percent w] $ noHtml) widths
415+ (\w -> col ! (widthAttrs w) $ noHtml) widths
393 head' <- if all null headers
416 head' <- if all null headers
394 then return noHtml
417 then return noHtml
395− else liftM (thead <<) $ tableRowToHtml opts alignStrings 0 headers
418+ else liftM (thead <<) $ tableRowToHtml opts aligns 0 headers
396 body' <- liftM (tbody <<) $
419 body' <- liftM (tbody <<) $
397− zipWithM (tableRowToHtml opts alignStrings) [1..] rows'
420+ zipWithM (tableRowToHtml opts aligns) [1..] rows'
398 return $ table $ captionDoc +++ coltags +++ head' +++ body'
421 return $ table $ captionDoc +++ coltags +++ head' +++ body'
399
422
400tableRowToHtml :: WriterOptions
423tableRowToHtml :: WriterOptions
401− -> [String]
424+ -> [Alignment]
402 -> Int
425 -> Int
403 -> [[Block]]
426 -> [[Block]]
404 -> State WriterState Html
427 -> State WriterState Html
405−tableRowToHtml opts alignStrings rownum cols' = do
428+tableRowToHtml opts aligns rownum cols' = do
406 let mkcell = if rownum == 0 then th else td
429 let mkcell = if rownum == 0 then th else td
407 let rowclass = case rownum of
430 let rowclass = case rownum of
408 0 -> "header"
431 0 -> "header"
@@ -410,7 +433,7 @@ tableRowToHtml opts alignStrings rownum cols' = do
410 _ -> "even"
433 _ -> "even"
411 cols'' <- sequence $ zipWith
434 cols'' <- sequence $ zipWith
412 (\alignment item -> tableItemToHtml opts mkcell alignment item)
435 (\alignment item -> tableItemToHtml opts mkcell alignment item)
413− alignStrings cols'
436+ aligns cols'
414 return $ tr ! [theclass rowclass] $ toHtmlFromList cols''
437 return $ tr ! [theclass rowclass] $ toHtmlFromList cols''
415
438
416alignmentToString :: Alignment -> [Char]
439alignmentToString :: Alignment -> [Char]
@@ -422,12 +445,15 @@ alignmentToString alignment = case alignment of
422
445
423tableItemToHtml :: WriterOptions
446tableItemToHtml :: WriterOptions
424 -> (Html -> Html)
447 -> (Html -> Html)
425− -> [Char]
448+ -> Alignment
426 -> [Block]
449 -> [Block]
427 -> State WriterState Html
450 -> State WriterState Html
428tableItemToHtml opts tag' align' item = do
451tableItemToHtml opts tag' align' item = do
429 contents <- blockListToHtml opts item
452 contents <- blockListToHtml opts item
453+ let alignAttrs = if writerHtml5 opts
454+ then [thestyle $ "align: " ++ alignmentToString align']
455+ else [align $ alignmentToString align']
430− return $ tag' ! [align align'] $ contents
456+ return $ tag' ! alignAttrs $ contents
431
457
432blockListToHtml :: WriterOptions -> [Block] -> State WriterState Html
458blockListToHtml :: WriterOptions -> [Block] -> State WriterState Html
433blockListToHtml opts lst =
459blockListToHtml opts lst =
src/pandoc.hs+12−2
@@ -41,7 +41,7 @@ import System.Exit ( exitWith, ExitCode (..) )
41import System.FilePath
41import System.FilePath
42import System.Console.GetOpt
42import System.Console.GetOpt
43import Data.Char ( toLower )
43import Data.Char ( toLower )
44−import Data.List ( intercalate, isSuffixOf )
44+import Data.List ( intercalate, isSuffixOf, isPrefixOf )
45import System.Directory ( getAppUserDataDirectory, doesFileExist )
45import System.Directory ( getAppUserDataDirectory, doesFileExist )
46import System.IO ( stdout, stderr )
46import System.IO ( stdout, stderr )
47import qualified Text.Pandoc.UTF8 as UTF8
47import qualified Text.Pandoc.UTF8 as UTF8
@@ -102,6 +102,7 @@ data Opt = Opt
102 , optOffline :: Bool -- ^ Make slideshow accessible offline
102 , optOffline :: Bool -- ^ Make slideshow accessible offline
103 , optXeTeX :: Bool -- ^ Format latex for xetex
103 , optXeTeX :: Bool -- ^ Format latex for xetex
104 , optSmart :: Bool -- ^ Use smart typography
104 , optSmart :: Bool -- ^ Use smart typography
105+ , optHtml5 :: Bool -- ^ Produce HTML5 in HTML
105 , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
106 , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
106 , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt
107 , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt
107 , optEPUBStylesheet :: Maybe String -- ^ EPUB stylesheet
108 , optEPUBStylesheet :: Maybe String -- ^ EPUB stylesheet
@@ -142,6 +143,7 @@ defaultOpts = Opt
142 , optOffline = False
143 , optOffline = False
143 , optXeTeX = False
144 , optXeTeX = False
144 , optSmart = False
145 , optSmart = False
146+ , optHtml5 = False
145 , optHTMLMathMethod = PlainMath
147 , optHTMLMathMethod = PlainMath
146 , optReferenceODT = Nothing
148 , optReferenceODT = Nothing
147 , optEPUBStylesheet = Nothing
149 , optEPUBStylesheet = Nothing
@@ -226,6 +228,11 @@ options =
226 (\opt -> return opt { optSmart = True }))
228 (\opt -> return opt { optSmart = True }))
227 "" -- "Use smart quotes, dashes, and ellipses"
229 "" -- "Use smart quotes, dashes, and ellipses"
228
230
231+ , Option "5" ["html5"]
232+ (NoArg
233+ (\opt -> return opt { optHtml5 = True }))
234+ "" -- "Produce HTML5 in HTML output"
235+
229 , Option "m" ["latexmathml", "asciimathml"]
236 , Option "m" ["latexmathml", "asciimathml"]
230 (OptArg
237 (OptArg
231 (\arg opt ->
238 (\arg opt ->
@@ -629,6 +636,7 @@ main = do
629 , optOffline = offline
636 , optOffline = offline
630 , optXeTeX = xetex
637 , optXeTeX = xetex
631 , optSmart = smart
638 , optSmart = smart
639+ , optHtml5 = html5
632 , optHTMLMathMethod = mathMethod
640 , optHTMLMathMethod = mathMethod
633 , optReferenceODT = referenceODT
641 , optReferenceODT = referenceODT
634 , optEPUBStylesheet = epubStylesheet
642 , optEPUBStylesheet = epubStylesheet
@@ -771,7 +779,9 @@ main = do
771 else obfuscationMethod,
779 else obfuscationMethod,
772 writerIdentifierPrefix = idPrefix,
780 writerIdentifierPrefix = idPrefix,
773 writerSourceDirectory = sourceDir,
781 writerSourceDirectory = sourceDir,
774− writerUserDataDir = datadir }
782+ writerUserDataDir = datadir,
783+ writerHtml5 = html5 &&
784+ "html" `isPrefixOf` writerName' }
775
785
776 when (isNonTextOutput writerName' && outputFile == "-") $
786 when (isNonTextOutput writerName' && outputFile == "-") $
777 do UTF8.hPutStrLn stderr ("Error: Cannot write " ++ writerName ++ " output to stdout.\n" ++
787 do UTF8.hPutStrLn stderr ("Error: Cannot write " ++ writerName ++ " output to stdout.\n" ++
templates/html.template+26−3
@@ -1,14 +1,28 @@
1+$if(html5)$
2+<!DOCTYPE html>
3+<html$if(lang)$ lang="$lang$"$endif$>
4+$else$
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2−<html xmlns="http://www.w3.org/1999/xhtml">
6+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>
7+$endif$
3<head>
8<head>
4− <title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
9+$if(html5)$
10+ <meta charset="utf-8" />
11+$else$
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
13+$endif$
6 <meta name="generator" content="pandoc" />
14 <meta name="generator" content="pandoc" />
7$for(author)$
15$for(author)$
8 <meta name="author" content="$author$" />
16 <meta name="author" content="$author$" />
9$endfor$
17$endfor$
10$if(date)$
18$if(date)$
11 <meta name="date" content="$date$" />
19 <meta name="date" content="$date$" />
20+$endif$
21+ <title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
22+$if(html5)$
23+ <!--[if lt IE 9]>
24+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
25+ <![endif]-->
12$endif$
26$endif$
13$if(highlighting-css)$
27$if(highlighting-css)$
14 <style type="text/css">
28 <style type="text/css">
@@ -16,11 +30,14 @@ $highlighting-css$
16 </style>
30 </style>
17$endif$
31$endif$
18$for(css)$
32$for(css)$
19− <link rel="stylesheet" href="$css$" type="text/css" />
33+ <link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
20$endfor$
34$endfor$
21$if(math)$
35$if(math)$
36+$if(html5)$
37+$else$
22 $math$
38 $math$
23$endif$
39$endif$
40+$endif$
24$for(header-includes)$
41$for(header-includes)$
25 $header-includes$
42 $header-includes$
26$endfor$
43$endfor$
@@ -30,7 +47,13 @@ $for(include-before)$
30$include-before$
47$include-before$
31$endfor$
48$endfor$
32$if(title)$
49$if(title)$
50+$if(html5)$
51+<header>
52+$endif$
33<h1 class="title">$title$</h1>
53<h1 class="title">$title$</h1>
54+$if(html5)$
55+</header>
56+$endif$
34$endif$
57$endif$
35$if(toc)$
58$if(toc)$
36$toc$
59$toc$
templates/s5.template+1−1
@@ -1,7 +1,6 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
3<head>
4− <title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="pandoc" />
5 <meta name="generator" content="pandoc" />
7$for(author)$
6$for(author)$
@@ -10,6 +9,7 @@ $endfor$
10$if(date)$
9$if(date)$
11 <meta name="date" content="$date$" />
10 <meta name="date" content="$date$" />
12$endif$
11$endif$
12+ <title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
13 <!-- configuration parameters -->
13 <!-- configuration parameters -->
14 <meta name="defaultView" content="slideshow" />
14 <meta name="defaultView" content="slideshow" />
15 <meta name="controlVis" content="hidden" />
15 <meta name="controlVis" content="hidden" />
templates/slidy.template+1−1
@@ -3,7 +3,6 @@
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5<head>
5<head>
6− <title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8 <meta name="generator" content="pandoc" />
7 <meta name="generator" content="pandoc" />
9$for(author)$
8$for(author)$
@@ -13,6 +12,7 @@ $if(date)$
13 <meta name="date" content="$date$" />
12 <meta name="date" content="$date$" />
14$endif$
13$endif$
15$if(highlighting-css)$
14$if(highlighting-css)$
15+ <title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
16 <style type="text/css">
16 <style type="text/css">
17$highlighting-css$
17$highlighting-css$
18 </style>
18 </style>
tests/s5.basic.html+1−1
@@ -1,12 +1,12 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
3<head>
4− <title>My S5 Document</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="pandoc" />
5 <meta name="generator" content="pandoc" />
7 <meta name="author" content="Sam Smith" />
6 <meta name="author" content="Sam Smith" />
8 <meta name="author" content="Jen Jones" />
7 <meta name="author" content="Jen Jones" />
9 <meta name="date" content="July 15, 2006" />
8 <meta name="date" content="July 15, 2006" />
9+ <title>My S5 Document</title>
10 <!-- configuration parameters -->
10 <!-- configuration parameters -->
11 <meta name="defaultView" content="slideshow" />
11 <meta name="defaultView" content="slideshow" />
12 <meta name="controlVis" content="hidden" />
12 <meta name="controlVis" content="hidden" />
tests/s5.fancy.html+1−1
@@ -1,12 +1,12 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
3<head>
4− <title>My S5 Document</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="pandoc" />
5 <meta name="generator" content="pandoc" />
7 <meta name="author" content="Sam Smith" />
6 <meta name="author" content="Sam Smith" />
8 <meta name="author" content="Jen Jones" />
7 <meta name="author" content="Jen Jones" />
9 <meta name="date" content="July 15, 2006" />
8 <meta name="date" content="July 15, 2006" />
9+ <title>My S5 Document</title>
10 <!-- configuration parameters -->
10 <!-- configuration parameters -->
11 <meta name="defaultView" content="slideshow" />
11 <meta name="defaultView" content="slideshow" />
12 <meta name="controlVis" content="hidden" />
12 <meta name="controlVis" content="hidden" />
tests/s5.inserts.html+1−1
@@ -1,12 +1,12 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
3<head>
4− <title>My S5 Document</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="pandoc" />
5 <meta name="generator" content="pandoc" />
7 <meta name="author" content="Sam Smith" />
6 <meta name="author" content="Sam Smith" />
8 <meta name="author" content="Jen Jones" />
7 <meta name="author" content="Jen Jones" />
9 <meta name="date" content="July 15, 2006" />
8 <meta name="date" content="July 15, 2006" />
9+ <title>My S5 Document</title>
10 <link rel="stylesheet" href="main.css" type="text/css" />
10 <link rel="stylesheet" href="main.css" type="text/css" />
11 STUFF INSERTED
11 STUFF INSERTED
12</head>
12</head>
tests/writer.html+18−18
@@ -1,12 +1,12 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
3<head>
4− <title>Pandoc Test Suite</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="pandoc" />
5 <meta name="generator" content="pandoc" />
7 <meta name="author" content="John MacFarlane" />
6 <meta name="author" content="John MacFarlane" />
8 <meta name="author" content="Anonymous" />
7 <meta name="author" content="Anonymous" />
9 <meta name="date" content="July 17, 2006" />
8 <meta name="date" content="July 17, 2006" />
9+ <title>Pandoc Test Suite</title>
10</head>
10</head>
11<body>
11<body>
12<h1 class="title">Pandoc Test Suite</h1>
12<h1 class="title">Pandoc Test Suite</h1>
@@ -74,7 +74,7 @@
74 ></pre
74 ></pre
75 ><p
75 ><p
76 >A list:</p
76 >A list:</p
77− ><ol style="list-style-type: decimal;"
77+ ><ol style="list-style-type: decimal"
78 ><li
78 ><li
79 >item one</li
79 >item one</li
80 ><li
80 ><li
@@ -207,7 +207,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
207>Ordered</h2
207>Ordered</h2
208><p
208><p
209>Tight:</p
209>Tight:</p
210−><ol style="list-style-type: decimal;"
210+><ol style="list-style-type: decimal"
211><li
211><li
212 >First</li
212 >First</li
213 ><li
213 ><li
@@ -217,7 +217,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
217 ></ol
217 ></ol
218><p
218><p
219>and:</p
219>and:</p
220−><ol style="list-style-type: decimal;"
220+><ol style="list-style-type: decimal"
221><li
221><li
222 >One</li
222 >One</li
223 ><li
223 ><li
@@ -227,7 +227,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
227 ></ol
227 ></ol
228><p
228><p
229>Loose using tabs:</p
229>Loose using tabs:</p
230−><ol style="list-style-type: decimal;"
230+><ol style="list-style-type: decimal"
231><li
231><li
232 ><p
232 ><p
233 >First</p
233 >First</p
@@ -243,7 +243,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
243 ></ol
243 ></ol
244><p
244><p
245>and using spaces:</p
245>and using spaces:</p
246−><ol style="list-style-type: decimal;"
246+><ol style="list-style-type: decimal"
247><li
247><li
248 ><p
248 ><p
249 >One</p
249 >One</p
@@ -259,7 +259,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
259 ></ol
259 ></ol
260><p
260><p
261>Multiple paragraphs:</p
261>Multiple paragraphs:</p
262−><ol style="list-style-type: decimal;"
262+><ol style="list-style-type: decimal"
263><li
263><li
264 ><p
264 ><p
265 >Item 1, graf one.</p
265 >Item 1, graf one.</p
@@ -291,7 +291,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
291 ></ul
291 ></ul
292><p
292><p
293>Here’s another:</p
293>Here’s another:</p
294−><ol style="list-style-type: decimal;"
294+><ol style="list-style-type: decimal"
295><li
295><li
296 >First</li
296 >First</li
297 ><li
297 ><li
@@ -309,7 +309,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
309 ></ol
309 ></ol
310><p
310><p
311>Same thing but with paragraphs:</p
311>Same thing but with paragraphs:</p
312−><ol style="list-style-type: decimal;"
312+><ol style="list-style-type: decimal"
313><li
313><li
314 ><p
314 ><p
315 >First</p
315 >First</p
@@ -355,7 +355,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
355 ></ul
355 ></ul
356><h2 id="fancy-list-markers"
356><h2 id="fancy-list-markers"
357>Fancy list markers</h2
357>Fancy list markers</h2
358−><ol start="2" style="list-style-type: decimal;"
358+><ol start="2" style="list-style-type: decimal"
359><li
359><li
360 >begins with 2</li
360 >begins with 2</li
361 ><li
361 ><li
@@ -363,11 +363,11 @@ These should not be escaped: \$ \\ \&gt; \[ \{
363 >and now 3</p
363 >and now 3</p
364 ><p
364 ><p
365 >with a continuation</p
365 >with a continuation</p
366− ><ol start="4" style="list-style-type: lower-roman;"
366+ ><ol start="4" style="list-style-type: lower-roman"
367 ><li
367 ><li
368 >sublist with roman numerals, starting with 4</li
368 >sublist with roman numerals, starting with 4</li
369 ><li
369 ><li
370− >more items<ol style="list-style-type: upper-alpha;"
370+ >more items<ol style="list-style-type: upper-alpha"
371 ><li
371 ><li
372 >a subsublist</li
372 >a subsublist</li
373 ><li
373 ><li
@@ -379,13 +379,13 @@ These should not be escaped: \$ \\ \&gt; \[ \{
379 ></ol
379 ></ol
380><p
380><p
381>Nesting:</p
381>Nesting:</p
382−><ol style="list-style-type: upper-alpha;"
382+><ol style="list-style-type: upper-alpha"
383><li
383><li
384− >Upper Alpha<ol style="list-style-type: upper-roman;"
384+ >Upper Alpha<ol style="list-style-type: upper-roman"
385 ><li
385 ><li
386− >Upper Roman.<ol start="6" style="list-style-type: decimal;"
386+ >Upper Roman.<ol start="6" style="list-style-type: decimal"
387 ><li
387 ><li
388− >Decimal start with 6<ol start="3" style="list-style-type: lower-alpha;"
388+ >Decimal start with 6<ol start="3" style="list-style-type: lower-alpha"
389 ><li
389 ><li
390 >Lower alpha with paren</li
390 >Lower alpha with paren</li
391 ></ol
391 ></ol
@@ -559,7 +559,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
559 ><dd
559 ><dd
560 ><p
560 ><p
561 >orange fruit</p
561 >orange fruit</p
562− ><ol style="list-style-type: decimal;"
562+ ><ol style="list-style-type: decimal"
563 ><li
563 ><li
564 >sublist</li
564 >sublist</li
565 ><li
565 ><li
@@ -1110,7 +1110,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
1110 ></sup
1110 ></sup
1111 ></p
1111 ></p
1112 ></blockquote
1112 ></blockquote
1113−><ol style="list-style-type: decimal;"
1113+><ol style="list-style-type: decimal"
1114><li
1114><li
1115 >And in list items.<sup
1115 >And in list items.<sup
1116 ><a href="#fn5" class="footnoteRef" id="fnref5"
1116 ><a href="#fn5" class="footnoteRef" id="fnref5"