diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-02-26 19:08:10 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-02-26 19:08:10 +0000 |
commit | 59065c103f334514e1b743fec5359d9fd4833b55 (patch) | |
tree | 08300e3ebc5b985c2abb50a84bbbcfefe451617a /src/templates/S5.hs | |
parent | e0303dfc793074f31c3ab0273fb959ad29a63545 (diff) | |
download | pandoc-59065c103f334514e1b743fec5359d9fd4833b55.tar.gz |
Modified HTML writer to use the Text.XHtml library. This results
in cleaner, faster code, and it makes it easier to use Pandoc in
other projects, like wikis, that use Text.XHtml. Two functions
are now provided, writeHtml and writeHtmlString: the former outputs
an Html structure, the latter a rendered string. The S5 writer is
also changed, in parallel ways (writeS5, writeS5String). The Html
header is now written programmatically, so it has been removed from
the 'headers' directory. The S5 header is still needed, but the
doctype and some of the meta declarations have been removed, since
they are written programatically. The INSTALL file and cabalize
have been updated to reflect the new dependency on the xhtml package.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@549 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/templates/S5.hs')
-rw-r--r-- | src/templates/S5.hs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/templates/S5.hs b/src/templates/S5.hs index 537286040..b015d8ca6 100644 --- a/src/templates/S5.hs +++ b/src/templates/S5.hs @@ -2,16 +2,22 @@ -- (See <http://meyerweb.com/eric/tools/s5/>.) module Text.Pandoc.Writers.S5 ( -- * Strings + s5Meta, s5Javascript, s5CSS, s5Links, -- * Functions writeS5, + writeS5String, insertS5Structure ) where import Text.Pandoc.Shared ( joinWithSep, WriterOptions ) -import Text.Pandoc.Writers.HTML ( writeHtml ) +import Text.Pandoc.Writers.HTML ( writeHtml, writeHtmlString ) import Text.Pandoc.Definition +import Text.XHtml.Strict + +s5Meta :: String +s5Meta = "<!-- configuration parameters -->\n<meta name=\"defaultView\" content=\"slideshow\" />\n<meta name=\"controlVis\" content=\"hidden\" />\n" s5Javascript :: String s5Javascript = "<script type=\"text/javascript\">\n@slides.js@</script>\n" @@ -40,9 +46,13 @@ s5CSS = "<style type=\"text/css\" media=\"projection\" id=\"slideProj\">\n" ++ s s5Links :: String s5Links = "<!-- style sheet links -->\n<link rel=\"stylesheet\" href=\"ui/default/slides.css\" type=\"text/css\" media=\"projection\" id=\"slideProj\" />\n<link rel=\"stylesheet\" href=\"ui/default/outline.css\" type=\"text/css\" media=\"screen\" id=\"outlineStyle\" />\n<link rel=\"stylesheet\" href=\"ui/default/print.css\" type=\"text/css\" media=\"print\" id=\"slidePrint\" />\n<link rel=\"stylesheet\" href=\"ui/default/opera.css\" type=\"text/css\" media=\"projection\" id=\"operaFix\" />\n<!-- S5 JS -->\n<script src=\"ui/default/slides.js\" type=\"text/javascript\"></script>\n" --- | Converts 'Pandoc' to an S5 HTML presentation. -writeS5 :: WriterOptions -> Pandoc -> String -writeS5 options = writeHtml options . insertS5Structure +-- | Converts Pandoc document to an S5 HTML presentation (Html structure). +writeS5 :: WriterOptions -> Pandoc -> Html +writeS5 options = (writeHtml options) . insertS5Structure + +-- | Converts Pandoc document to an S5 HTML presentation (string). +writeS5String :: WriterOptions -> Pandoc -> String +writeS5String options = (writeHtmlString options) . insertS5Structure -- | Inserts HTML needed for an S5 presentation (e.g. around slides). layoutDiv :: [Inline] -- ^ Title of document (for header or footer) |