Added a slidy writer.

Resolves Issue #122.
This commit is contained in:
John MacFarlane 2010-07-13 20:44:56 -07:00
parent a59a141906
commit 9b833e8744
7 changed files with 170 additions and 70 deletions

119
README
View file

@ -7,7 +7,9 @@ another, and a command-line tool that uses this library. It can read
[markdown] and (subsets of) [reStructuredText], [HTML], and [LaTeX]; and [markdown] and (subsets of) [reStructuredText], [HTML], and [LaTeX]; and
it can write plain text, [markdown], [reStructuredText], [HTML], [LaTeX], it can write plain text, [markdown], [reStructuredText], [HTML], [LaTeX],
[ConTeXt], [RTF], [DocBook XML], [OpenDocument XML], [ODT], [GNU Texinfo], [ConTeXt], [RTF], [DocBook XML], [OpenDocument XML], [ODT], [GNU Texinfo],
[MediaWiki markup], [EPUB], [groff man] pages, and [S5] HTML slide shows. [MediaWiki markup], [EPUB], [groff man] pages, and [Slidy] or [S5]
HTML slide shows.
Pandoc's enhanced version of markdown includes syntax for footnotes, Pandoc's enhanced version of markdown includes syntax for footnotes,
tables, flexible ordered lists, definition lists, delimited code blocks, tables, flexible ordered lists, definition lists, delimited code blocks,
superscript, subscript, strikeout, title blocks, automatic tables of superscript, subscript, strikeout, title blocks, automatic tables of
@ -25,6 +27,7 @@ or output format requires only adding a reader or writer.
[markdown]: http://daringfireball.net/projects/markdown/ [markdown]: http://daringfireball.net/projects/markdown/
[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html [reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
[S5]: http://meyerweb.com/eric/tools/s5/ [S5]: http://meyerweb.com/eric/tools/s5/
[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
[HTML]: http://www.w3.org/TR/html40/ [HTML]: http://www.w3.org/TR/html40/
[LaTeX]: http://www.latex-project.org/ [LaTeX]: http://www.latex-project.org/
[ConTeXt]: http://www.pragma-ade.nl/ [ConTeXt]: http://www.pragma-ade.nl/
@ -92,8 +95,8 @@ Supported output formats include `markdown`, `latex`, `context`
(reStructuredText), `docbook` (DocBook XML), `opendocument` (reStructuredText), `docbook` (DocBook XML), `opendocument`
(OpenDocument XML), `odt` (OpenOffice text document), `texinfo`, (GNU (OpenDocument XML), `odt` (OpenOffice text document), `texinfo`, (GNU
Texinfo), `mediawiki` (MediaWiki markup), `epub` (EPUB ebook), Texinfo), `mediawiki` (MediaWiki markup), `epub` (EPUB ebook),
`man` (groff man), and `s5` `man` (groff man), `slidy` (slidy HTML and javascript slide show), or
(which produces an HTML file that acts like powerpoint). `s5` (S5 HTML and javascript slide show).
Supported input formats include `markdown`, `html`, `latex`, and `rst`. Supported input formats include `markdown`, `html`, `latex`, and `rst`.
Note that the `rst` reader only parses a subset of reStructuredText Note that the `rst` reader only parses a subset of reStructuredText
@ -191,7 +194,7 @@ For further documentation, see the `pandoc(1)` man page.
`-t`, `--to`, `-w`, or `--write` *format* `-t`, `--to`, `-w`, or `--write` *format*
: specifies the output format -- the format Pandoc will : specifies the output format -- the format Pandoc will
be converting *to*. *format* can be `native`, `html`, `s5`, be converting *to*. *format* can be `native`, `html`, `slidy`, `s5`,
`docbook`, `opendocument`, `latex`, `context`, `markdown`, `man`, `docbook`, `opendocument`, `latex`, `context`, `markdown`, `man`,
`plain`, `rst`, and `rtf`. (`+lhs` can be appended to indicate that `plain`, `rst`, and `rtf`. (`+lhs` can be appended to indicate that
the output should be treated as literate Haskell source. See the output should be treated as literate Haskell source. See
@ -228,11 +231,12 @@ For further documentation, see the `pandoc(1)` man page.
`-R` or `--parse-raw` `-R` or `--parse-raw`
: causes the HTML and LaTeX readers to parse HTML codes and LaTeX : causes the HTML and LaTeX readers to parse HTML codes and LaTeX
environments that it can't translate as raw HTML or LaTeX. Raw HTML can environments that it can't translate as raw HTML or LaTeX. Raw HTML can
be printed in markdown, reStructuredText, HTML, and S5 output; raw LaTeX be printed in markdown, reStructuredText, HTML, Slidy, and S5
can be printed in markdown, reStructuredText, LaTeX, and ConTeXt output. output; raw LaTeX can be printed in markdown, reStructuredText,
The default is for the readers to omit untranslatable HTML codes and LaTeX, and ConTeXt output. The default is for the readers to omit
LaTeX environments. (The LaTeX reader does pass through untranslatable untranslatable HTML codes and LaTeX environments. (The LaTeX reader
LaTeX *commands*, even if `-R` is not specified.) does pass through untranslatable LaTeX *commands*, even if `-R` is
not specified.)
`-C` or `--custom-header` *filename* `-C` or `--custom-header` *filename*
: can be used to specify a custom document header. Implies `--standalone`. : can be used to specify a custom document header. Implies `--standalone`.
@ -242,7 +246,7 @@ For further documentation, see the `pandoc(1)` man page.
: includes an automatically generated table of contents (or, in the : includes an automatically generated table of contents (or, in the
case of `latex`, `context`, and `rst`, an instruction to create case of `latex`, `context`, and `rst`, an instruction to create
one) in the output document. This option has no effect with `man`, one) in the output document. This option has no effect with `man`,
`docbook`, or `s5` output formats. `docbook`, `slidy`, or `s5` output formats.
`--base-header-level` *level* `--base-header-level` *level*
: specifies the base level for headers (defaults to 1). : specifies the base level for headers (defaults to 1).
@ -263,9 +267,9 @@ For further documentation, see the `pandoc(1)` man page.
`-c` or `--css` *filename* `-c` or `--css` *filename*
: allows the user to specify a custom stylesheet that will be linked to : allows the user to specify a custom stylesheet that will be linked to
in HTML and S5 output. This option can be used repeatedly to include in HTML, Slidy, and S5 output. This option can be used repeatedly
multiple stylesheets. They will be included in the order specified. to include multiple stylesheets. They will be included in the order
Implies `--standalone`. specified. Implies `--standalone`.
`-H` or `--include-in-header` *filename* `-H` or `--include-in-header` *filename*
: includes the contents of *filename* (verbatim) at the end of the : includes the contents of *filename* (verbatim) at the end of the
@ -340,13 +344,13 @@ For further documentation, see the `pandoc(1)` man page.
`-m`*[url]* or `--latexmathml`*[=url]* `-m`*[url]* or `--latexmathml`*[=url]*
: causes `pandoc` to use the [LaTeXMathML] script to display : causes `pandoc` to use the [LaTeXMathML] script to display
TeX math in HTML or S5. If a local copy of `LaTeXMathML.js` is TeX math in HTML, Slidy, or S5. If a local copy of `LaTeXMathML.js`
available on the webserver where the page will be viewed, provide a is available on the webserver where the page will be viewed, provide
*url* and a link will be inserted in the generated HTML or S5. If a *url* and a link will be inserted in the generated HTML. If
no *url* is provided, the contents of the script will be inserted no *url* is provided, the contents of the script will be inserted
directly; this provides portability at the price of efficiency. If directly; this provides portability at the price of efficiency. If
you plan to use math on several pages, it is much better to link to you plan to use math on several pages, it is much better to link to
a copy of `LaTeXMathML.js`, which can be cached. (See `--jsmath`, a copy of `LaTeXMathML.js`, which can be cached. (See `--jsmath`,
`--gladtex`, and `--mimetex` for alternative ways of dealing with `--gladtex`, and `--mimetex` for alternative ways of dealing with
math in HTML.) math in HTML.)
@ -357,17 +361,18 @@ For further documentation, see the `pandoc(1)` man page.
`--jsmath`*=[url]* `--jsmath`*=[url]*
: causes `pandoc` to use the [jsMath] script to display : causes `pandoc` to use the [jsMath] script to display
TeX math in HTML or S5. The *url* should point to the jsMath load TeX math in HTML, Slidy, or S5. The *url* should point to the jsMath
script (e.g. `jsMath/easy/load.js`). If it is provided, a link to it load script (e.g. `jsMath/easy/load.js`). If it is provided, a link
will be included in the header of standalone HTML documents. to it will be included in the header of standalone HTML documents.
(See `--latexmathml`, `--mimetex`, and `--gladtex` for alternative (See `--latexmathml`, `--mimetex`, and `--gladtex` for alternative
ways of dealing with math in HTML.) ways of dealing with math in HTML.)
`--gladtex`*[=url]* `--gladtex`*[=url]*
: causes TeX formulas to be enclosed in `<eq>` tags in HTML or S5 output. : causes TeX formulas to be enclosed in `<eq>` tags in HTML, Slidy, or
This output can then be processed by [gladTeX] to produce links to S5 output. This output can then be processed by [gladTeX] to produce
images with the typeset formulas. (See `--latexmathml`, `--jsmath`, and links to images with the typeset formulas. (See `--latexmathml`,
`--mimetex` for alternative ways of dealing with math in HTML.) `--jsmath`, and `--mimetex` for alternative ways of dealing with
math in HTML.)
`--mimetex`*[=url]* `--mimetex`*[=url]*
: causes TeX formulas to be replaced by `<img>` tags linking to the : causes TeX formulas to be replaced by `<img>` tags linking to the
@ -376,7 +381,7 @@ For further documentation, see the `pandoc(1)` man page.
ways of dealing with math in HTML.) ways of dealing with math in HTML.)
`-i` or `--incremental` `-i` or `--incremental`
: causes all lists in S5 output to be displayed incrementally by : causes all lists in Slidy or S5 output to be displayed incrementally by
default (one item at a time). The normal default is for lists to be default (one item at a time). The normal default is for lists to be
displayed all at once. displayed all at once.
@ -1200,7 +1205,7 @@ Unknown commands and symbols, and commands that cannot be dealt with
this way (like `\frac`), will be rendered verbatim. So the results may this way (like `\frac`), will be rendered verbatim. So the results may
be a mix of raw TeX code and properly rendered unicode math. be a mix of raw TeX code and properly rendered unicode math.
In HTML and S5 output, the way math is rendered will depend on the In HTML, Slidy, and S5 output, the way math is rendered will depend on the
command-line options selected: command-line options selected:
1. The default is to render TeX math as far as possible using unicode 1. The default is to render TeX math as far as possible using unicode
@ -1260,14 +1265,14 @@ LaTeX, not as markdown.
Inline LaTeX is ignored in output formats other than Markdown, LaTeX, Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
and ConTeXt. and ConTeXt.
Producing S5 with Pandoc Producing HTML slide shows with Pandoc
======================== ======================================
Producing an [S5] web-based slide show with Pandoc is easy. A title Producing a [Slidy] or [S5] web-based slide show with Pandoc is easy. A
page is constructed automatically from the document's title block (see title page is constructed automatically from the document's title block
above). Each section (with a level-one header) produces a single slide. (see above). Each section (with a level-one header) produces a single
(Note that if the section is too big, the slide will not fit on the page; slide. (Note that if the section is too big, the slide will not fit on
S5 is not smart enough to produce multiple pages.) the page; S5 is not smart enough to produce multiple pages.)
Here's the markdown source for a simple slide show, `eating.txt`: Here's the markdown source for a simple slide show, `eating.txt`:
@ -1287,11 +1292,17 @@ Here's the markdown source for a simple slide show, `eating.txt`:
To produce the slide show, simply type To produce the slide show, simply type
pandoc -w slidy -s eating.txt > eating.html
for Slidy, or
pandoc -w s5 -s eating.txt > eating.html pandoc -w s5 -s eating.txt > eating.html
for S5.
and open up `eating.html` in a browser. and open up `eating.html` in a browser.
Note that by default, the S5 writer produces lists that display Note that by default, these writers produces lists that display
"all at once." If you want your lists to display incrementally "all at once." If you want your lists to display incrementally
(one item at a time), use the `-i` option. If you want a (one item at a time), use the `-i` option. If you want a
particular list to depart from the default (that is, to display particular list to depart from the default (that is, to display
@ -1304,26 +1315,28 @@ incrementally without the `-i` option and all at once with the
In this way incremental and nonincremental lists can be mixed in In this way incremental and nonincremental lists can be mixed in
a single document. a single document.
Note: the S5 file produced by pandoc with the `-s/--standalone` option Notes on S5:
embeds the javascript and CSS required to show the slides. Thus it
does not depend on any additional files: you can send the HTML file to
others, and they will be able to view the slide show just by opening
it. However, if you intend to produce several S5 slide shows, and you
are displaying them on your own website, it is better to keep the S5
javascript and CSS files separate from the slide shows themselves, so
that they may be cached. The best approach in this case is to use pandoc
without the `-s` option to produce the body of the S5 document, which
can then be inserted into an HTML template that links to the javascript
and CSS files required by S5. (See the instructions on the S5 website.)
Alternatively, you may use `-s` together with the `--template`
option to specify a custom template.
You can change the style of the slides by putting customized CSS files - The S5 file produced by pandoc with the `-s/--standalone`
in `$DATADIR/s5/default`, where `$DATADIR` is the user data directory option embeds the javascript and CSS required to show the slides. Thus
(see `--data-dir`, above). The originals may be found in pandoc's system it does not depend on any additional files: you can send the HTML file
data directory (generally `$CABALDIR/pandoc-VERSION/s5/default`). Pandoc to others, and they will be able to view the slide show just by opening
will look there for any files it does not find in the user data it. However, if you intend to produce several S5 slide shows, and you
directory. are displaying them on your own website, it is better to keep the S5
javascript and CSS files separate from the slide shows themselves, so
that they may be cached. The best approach in this case is to use pandoc
without the `-s` option to produce the body of the S5 document, which
can then be inserted into an HTML template that links to the javascript
and CSS files required by S5. (See the instructions on the S5 website.)
Alternatively, you may use `-s` together with the `--template` option to
specify a custom template.
- You can change the style of the slides by putting customized CSS files
in `$DATADIR/s5/default`, where `$DATADIR` is the user data directory
(see `--data-dir`, above). The originals may be found in pandoc's system
data directory (generally `$CABALDIR/pandoc-VERSION/s5/default`). Pandoc
will look there for any files it does not find in the user data
directory.
Literate Haskell support Literate Haskell support
======================== ========================

View file

@ -16,7 +16,7 @@ Pandoc converts files from one markup format to another. It can
read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and
it can write plain text, markdown, reStructuredText, HTML, LaTeX, it can write plain text, markdown, reStructuredText, HTML, LaTeX,
ConTeXt, Texinfo, groff man, MediaWiki markup, RTF, OpenDocument XML, ConTeXt, Texinfo, groff man, MediaWiki markup, RTF, OpenDocument XML,
ODT, DocBook XML, EPUB, and S5 HTML slide shows. ODT, DocBook XML, EPUB, and Slidy or S5 HTML slide shows.
If no *input-file* is specified, input is read from *stdin*. If no *input-file* is specified, input is read from *stdin*.
Otherwise, the *input-files* are concatenated (with a blank Otherwise, the *input-files* are concatenated (with a blank
@ -75,6 +75,7 @@ should pipe input and output through `iconv`:
`mediawiki` (MediaWiki markup), `texinfo` (GNU Texinfo), `mediawiki` (MediaWiki markup), `texinfo` (GNU Texinfo),
`docbook` (DocBook XML), `opendocument` (OpenDocument XML), `docbook` (DocBook XML), `opendocument` (OpenDocument XML),
`odt` (OpenOffice text document), `epub` (EPUB book), `odt` (OpenOffice text document), `epub` (EPUB book),
`slidy` (Slidy HTML and javascript slide show),
`s5` (S5 HTML and javascript slide show), or `rtf` (rich text `s5` (S5 HTML and javascript slide show), or `rtf` (rich text
format). Note that `odt` and `epub` output will not be directed to format). Note that `odt` and `epub` output will not be directed to
*stdout*; an output filename must be specified using the `-o/--output` *stdout*; an output filename must be specified using the `-o/--output`
@ -136,7 +137,7 @@ should pipe input and output through `iconv`:
it is assumed that the script is at `/cgi-bin/mimetex.cgi`. it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
-i, \--incremental -i, \--incremental
: Make list items in S5 display incrementally (one by one). : Make list items in Slidy or S5 display incrementally (one by one).
\--xetex \--xetex
: Create LaTeX outut suitable for processing by XeTeX. : Create LaTeX outut suitable for processing by XeTeX.
@ -175,7 +176,7 @@ should pipe input and output through `iconv`:
\--toc, \--table-of-contents \--toc, \--table-of-contents
: Include an automatically generated table of contents (HTML, markdown, : Include an automatically generated table of contents (HTML, markdown,
RTF) or an instruction to create one (LaTeX, reStructuredText). RTF) or an instruction to create one (LaTeX, reStructuredText).
This option has no effect on man, DocBook, or S5 output. This option has no effect on man, DocBook, Slidy, or S5 output.
\--base-header-level=*LEVEL* \--base-header-level=*LEVEL*
: Specify the base level for headers (defaults to 1). : Specify the base level for headers (defaults to 1).

View file

@ -42,6 +42,7 @@ Data-Files:
templates/man.template, templates/markdown.template, templates/man.template, templates/markdown.template,
templates/rst.template, templates/plain.template, templates/rst.template, templates/plain.template,
templates/mediawiki.template, templates/rtf.template, templates/mediawiki.template, templates/rtf.template,
templates/slidy.template,
-- data for ODT writer -- data for ODT writer
reference.odt, reference.odt,
-- stylesheet for EPUB writer -- stylesheet for EPUB writer

View file

@ -66,6 +66,7 @@ module Text.Pandoc.Shared (
-- * Writer options -- * Writer options
HTMLMathMethod (..), HTMLMathMethod (..),
ObfuscationMethod (..), ObfuscationMethod (..),
HTMLSlideVariant (..),
WriterOptions (..), WriterOptions (..),
defaultWriterOptions, defaultWriterOptions,
-- * File handling -- * File handling
@ -466,6 +467,12 @@ data ObfuscationMethod = NoObfuscation
| JavascriptObfuscation | JavascriptObfuscation
deriving (Show, Read, Eq) deriving (Show, Read, Eq)
-- | Varieties of HTML slide shows.
data HTMLSlideVariant = S5Slides
| SlidySlides
| NoSlides
deriving (Show, Read, Eq)
-- | Options for writers -- | Options for writers
data WriterOptions = WriterOptions data WriterOptions = WriterOptions
{ writerStandalone :: Bool -- ^ Include header and footer { writerStandalone :: Bool -- ^ Include header and footer
@ -474,11 +481,11 @@ data WriterOptions = WriterOptions
, writerEPUBMetadata :: String -- ^ Metadata to include in EPUB , writerEPUBMetadata :: String -- ^ Metadata to include in EPUB
, writerTabStop :: Int -- ^ Tabstop for conversion btw spaces and tabs , writerTabStop :: Int -- ^ Tabstop for conversion btw spaces and tabs
, writerTableOfContents :: Bool -- ^ Include table of contents , writerTableOfContents :: Bool -- ^ Include table of contents
, writerS5 :: Bool -- ^ We're writing S5 , writerSlideVariant :: HTMLSlideVariant -- ^ Are we writing S5 or Slidy?
, writerIncremental :: Bool -- ^ True if lists should be incremental
, writerXeTeX :: Bool -- ^ Create latex suitable for use by xetex , writerXeTeX :: Bool -- ^ Create latex suitable for use by xetex
, writerHTMLMathMethod :: HTMLMathMethod -- ^ How to print math in HTML , writerHTMLMathMethod :: HTMLMathMethod -- ^ How to print math in HTML
, writerIgnoreNotes :: Bool -- ^ Ignore footnotes (used in making toc) , writerIgnoreNotes :: Bool -- ^ Ignore footnotes (used in making toc)
, writerIncremental :: Bool -- ^ Incremental S5 lists
, writerNumberSections :: Bool -- ^ Number sections in LaTeX , writerNumberSections :: Bool -- ^ Number sections in LaTeX
, writerStrictMarkdown :: Bool -- ^ Use strict markdown syntax , writerStrictMarkdown :: Bool -- ^ Use strict markdown syntax
, writerReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst , writerReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst
@ -499,11 +506,11 @@ defaultWriterOptions =
, writerEPUBMetadata = "" , writerEPUBMetadata = ""
, writerTabStop = 4 , writerTabStop = 4
, writerTableOfContents = False , writerTableOfContents = False
, writerS5 = False , writerSlideVariant = NoSlides
, writerIncremental = False
, writerXeTeX = False , writerXeTeX = False
, writerHTMLMathMethod = PlainMath , writerHTMLMathMethod = PlainMath
, writerIgnoreNotes = False , writerIgnoreNotes = False
, writerIncremental = False
, writerNumberSections = False , writerNumberSections = False
, writerStrictMarkdown = False , writerStrictMarkdown = False
, writerReferenceLinks = False , writerReferenceLinks = False

View file

@ -197,10 +197,16 @@ elementToHtml opts (Sec level num id' title' elements) = do
innerContents <- mapM (elementToHtml opts) elements innerContents <- mapM (elementToHtml opts) elements
modify $ \st -> st{stSecNum = num} -- update section number modify $ \st -> st{stSecNum = num} -- update section number
header' <- blockToHtml opts (Header level title') header' <- blockToHtml opts (Header level title')
return $ if writerS5 opts || (writerStrictMarkdown opts && not (writerTableOfContents opts)) let stuff = header' : innerContents
-- S5 gets confused by the extra divs around sections return $ case writerSlideVariant opts of
then toHtmlFromList (header' : innerContents) SlidySlides | level == 1 ->
else thediv ! [prefixedId opts id'] << (header' : innerContents) thediv ! [prefixedId opts id', theclass "slide"] << stuff
S5Slides -> toHtmlFromList stuff
-- S5 gets confused by the extra divs around sections
_ | (writerStrictMarkdown opts &&
not (writerTableOfContents opts)) ->
toHtmlFromList stuff
_ -> thediv ! [prefixedId opts id'] << stuff
-- | Convert list of Note blocks to a footnote <div>. -- | Convert list of Note blocks to a footnote <div>.
-- Assumes notes are sorted. -- Assumes notes are sorted.
@ -296,7 +302,7 @@ blockToHtml opts (BlockQuote blocks) =
-- in S5, treat list in blockquote specially -- in S5, treat list in blockquote specially
-- if default is incremental, make it nonincremental; -- if default is incremental, make it nonincremental;
-- otherwise incremental -- otherwise incremental
if writerS5 opts if writerSlideVariant opts /= NoSlides
then let inc = not (writerIncremental opts) in then let inc = not (writerIncremental opts) in
case blocks of case blocks of
[BulletList lst] -> blockToHtml (opts {writerIncremental = inc}) [BulletList lst] -> blockToHtml (opts {writerIncremental = inc})

View file

@ -32,7 +32,7 @@ module Main where
import Text.Pandoc import Text.Pandoc
import Text.Pandoc.Writers.S5 (s5HeaderIncludes) import Text.Pandoc.Writers.S5 (s5HeaderIncludes)
import Text.Pandoc.Shared ( tabFilter, ObfuscationMethod (..), readDataFile, import Text.Pandoc.Shared ( tabFilter, ObfuscationMethod (..), readDataFile,
headerShift ) headerShift, HTMLSlideVariant(..) )
#ifdef _HIGHLIGHTING #ifdef _HIGHLIGHTING
import Text.Pandoc.Highlighting ( languages ) import Text.Pandoc.Highlighting ( languages )
#endif #endif
@ -107,6 +107,7 @@ writers = [("native" , writeNative)
,("html" , writeHtmlString) ,("html" , writeHtmlString)
,("html+lhs" , writeHtmlString) ,("html+lhs" , writeHtmlString)
,("s5" , writeS5String) ,("s5" , writeS5String)
,("slidy" , writeHtmlString)
,("docbook" , writeDocbook) ,("docbook" , writeDocbook)
,("opendocument" , writeOpenDocument) ,("opendocument" , writeOpenDocument)
,("odt" , \_ _ -> "") ,("odt" , \_ _ -> "")
@ -142,7 +143,7 @@ data Opt = Opt
, optVariables :: [(String,String)] -- ^ Template variables to set , optVariables :: [(String,String)] -- ^ Template variables to set
, optOutputFile :: String -- ^ Name of output file , optOutputFile :: String -- ^ Name of output file
, optNumberSections :: Bool -- ^ Number sections in LaTeX , optNumberSections :: Bool -- ^ Number sections in LaTeX
, optIncremental :: Bool -- ^ Use incremental lists in S5 , optIncremental :: Bool -- ^ Use incremental lists in Slidy/S5
, optXeTeX :: Bool -- ^ Format latex for xetex , optXeTeX :: Bool -- ^ Format latex for xetex
, optSmart :: Bool -- ^ Use smart typography , optSmart :: Bool -- ^ Use smart typography
, optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
@ -300,7 +301,7 @@ options =
, Option "i" ["incremental"] , Option "i" ["incremental"]
(NoArg (NoArg
(\opt -> return opt { optIncremental = True })) (\opt -> return opt { optIncremental = True }))
"" -- "Make list items display incrementally in S5" "" -- "Make list items display incrementally in Slidy/S5"
, Option "" ["xetex"] , Option "" ["xetex"]
(NoArg (NoArg
@ -733,6 +734,11 @@ main = do
then "." then "."
else takeDirectory (head sources) else takeDirectory (head sources)
let slideVariant = case writerName' of
"s5" -> S5Slides
"slidy" -> SlidySlides
_ -> NoSlides
let startParserState = let startParserState =
defaultParserState { stateParseRaw = parseRaw, defaultParserState { stateParseRaw = parseRaw,
stateTabStop = tabStop, stateTabStop = tabStop,
@ -759,10 +765,10 @@ main = do
writerTableOfContents = toc && writerTableOfContents = toc &&
writerName' /= "s5", writerName' /= "s5",
writerHTMLMathMethod = mathMethod, writerHTMLMathMethod = mathMethod,
writerS5 = (writerName' == "s5"), writerSlideVariant = slideVariant,
writerIncremental = incremental,
writerXeTeX = xetex, writerXeTeX = xetex,
writerIgnoreNotes = False, writerIgnoreNotes = False,
writerIncremental = incremental,
writerNumberSections = numberSections, writerNumberSections = numberSections,
writerStrictMarkdown = strict, writerStrictMarkdown = strict,
writerReferenceLinks = referenceLinks, writerReferenceLinks = referenceLinks,

66
templates/slidy.template Normal file
View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
$for(author)$
<meta name="author" content="$author$" />
$endfor$
<meta name="date" content="$date$" />
$if(highlighting)$
<style type="text/css">
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
td.sourceCode { padding-left: 5px; }
pre.sourceCode { }
pre.sourceCode span.Normal { }
pre.sourceCode span.Keyword { color: #007020; font-weight: bold; }
pre.sourceCode span.DataType { color: #902000; }
pre.sourceCode span.DecVal { color: #40a070; }
pre.sourceCode span.BaseN { color: #40a070; }
pre.sourceCode span.Float { color: #40a070; }
pre.sourceCode span.Char { color: #4070a0; }
pre.sourceCode span.String { color: #4070a0; }
pre.sourceCode span.Comment { color: #60a0b0; font-style: italic; }
pre.sourceCode span.Others { color: #007020; }
pre.sourceCode span.Alert { color: red; font-weight: bold; }
pre.sourceCode span.Function { color: #06287e; }
pre.sourceCode span.RegionMarker { }
pre.sourceCode span.Error { color: red; font-weight: bold; }
</style>
$endif$
$for(css)$
<link rel="stylesheet" href="$css$" type="text/css" />
$endfor$
<link rel="stylesheet" type="text/css" media="screen, projection, print"
href="http://www.w3.org/Talks/Tools/Slidy/slidy.css" />
$if(math)$
$math$
$endif$
$for(header-includes)$
$header-includes$
$endfor$
<script src="http://www.w3.org/Talks/Tools/Slidy/slidy.js"
charset="utf-8" type="text/javascript"></script>
</head>
<body>
$for(include-before)$
$include-before$
$endfor$
$if(title)$
<div class="slide cover title">
<h1 class="title">$title$</h1>
$for(author)$
<p class="author">$author$</p>
$endfor$
</div>
$endif$
$body$
$for(include-after)$
$include-after$
$endfor$
</body>
</html>