git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #521 from jonassmedegaard/master

Slidy lang support, and new Slideous writer

commit81be8fbf77dc61288fb615582d998c9475b2f7a8 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 30 May 2012, 18:21 (14 years ago) parentd0d2edd491d789
11 files changed+479−23
COPYRIGHT+16 INSTALL+1 README+32−17 pandoc.cabal+5−1 slideous/slideous.css+95 slideous/slideous.js+321 src/Text/Pandoc.hs+1 src/Text/Pandoc/Shared.hs+2−1 src/Text/Pandoc/Slides.hs+1−1 src/Text/Pandoc/Writers/HTML.hs+1 src/pandoc.hs+4−3
COPYRIGHT+16
@@ -85,6 +85,22 @@ by Eric A. Meyer
8585
8686Released under an explicit Public Domain License
8787
88+----------------------------------------------------------------------
89+slidy/default
90+Slidy javascript and CSS
91+by Dave Raggett
92+http://www.w3.org/Talks/Tools/Slidy2
93+
94+Released under W3C document and software licenses
95+
96+----------------------------------------------------------------------
97+slideous/default
98+Slideous javascript and CSS
99+by Stefan Gössner
100+http://goessner.net/
101+
102+Released under Creative Commons GNU LGPL License
103+
88104------------------------------------------------------------------------
89105windows/modpath.iss
90106Copyright (c) 2007 Jared Breland
INSTALL+1
@@ -119,6 +119,7 @@ you please, and copy the following data files to the same place:
119119 data/
120120 s5/
121121 slidy/
122+ slideous/
122123 dzslides/
123124 pcre-license.txt
124125 pcre3.dll
README+32−17
@@ -18,8 +18,8 @@ another, and a command-line tool that uses this library. It can read
1818slide shows), [ConTeXt], [RTF], [DocBook XML], [OpenDocument XML],
1919[ODT], [Word docx], [GNU Texinfo], [MediaWiki markup], [EPUB],
2020[Textile], [groff man] pages, [Emacs Org-Mode], [AsciiDoc], and [Slidy],
21−[DZSlides], or [S5] HTML slide shows. It can also produce [PDF] output
22−on systems where LaTeX is installed.
21+[Slideous], [DZSlides], or [S5] HTML slide shows. It can also produce
22+[PDF] output on systems where LaTeX is installed.
2323
2424Pandoc's enhanced version of markdown includes syntax for footnotes,
2525tables, flexible ordered lists, definition lists, delimited code blocks,
@@ -153,6 +153,7 @@ General options
153153 `docbook` (DocBook XML), `opendocument` (OpenDocument XML), `odt`
154154 (OpenOffice text document), `docx` (Word docx), `epub` (EPUB book),
155155 `asciidoc` (AsciiDoc), `slidy` (Slidy HTML and javascript slide show),
156+ `slideous` (Slideous HTML and javascript slide show),
156157 `dzslides` (HTML5 + javascript slide show), `s5` (S5 HTML and javascript
157158 slide show), or `rtf` (rich text format). Note that `odt` and `epub`
158159 output will not be directed to *stdout*; an output filename must
@@ -178,8 +179,8 @@ General options
178179 C:\Documents And Settings\USERNAME\Application Data\pandoc
179180
180181 in Windows. A `reference.odt`, `reference.docx`, `default.csl`,
181− `epub.css`, `templates`, `slidy`, or `s5` directory placed in this
182− directory will override pandoc's normal defaults.
182+ `epub.css`, `templates`, `slidy`, `slideous`, or `s5` directory
183+ placed in this directory will override pandoc's normal defaults.
183184
184185`-v`, `--version`
185186: Print version.
@@ -199,7 +200,8 @@ Reader options
199200`-R`, `--parse-raw`
200201: Parse untranslatable HTML codes and LaTeX environments as raw HTML
201202 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
202− input. Raw HTML can be printed in markdown, reStructuredText, HTML, Slidy,
203+ input. Raw HTML can be printed in markdown, reStructuredText, HTML,
204+ Slidy, Slideous,
203205 DZSlides, and S5 output; raw LaTeX can be printed in markdown,
204206 reStructuredText, LaTeX, and ConTeXt output. The default is for the
205207 readers to omit untranslatable HTML codes and LaTeX environments.
@@ -280,7 +282,7 @@ General writer options
280282: Include an automatically generated table of contents (or, in
281283 the case of `latex`, `context`, and `rst`, an instruction to create
282284 one) in the output document. This option has no effect on `man`,
283− `docbook`, `slidy`, or `s5` output.
285+ `docbook`, `slidy`, `slideous`, or `s5` output.
284286
285287`--no-highlight`
286288: Disables syntax highlighting for code blocks and inlines, even when
@@ -323,7 +325,8 @@ Options affecting specific writers
323325 in the sense that it needs no external files and no net access to be
324326 displayed properly by a browser. This option works only with HTML output
325327 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
326− `slidy`, and `dzslides`. Scripts, images, and stylesheets at absolute URLs
328+ `slidy`, `slideous`,
329+ and `dzslides`. Scripts, images, and stylesheets at absolute URLs
327330 will be downloaded; those at relative URLs will be sought first relative
328331 to the working directory, then relative to the user data directory (see
329332 `--data-dir`), and finally relative to pandoc's default data directory.
@@ -378,7 +381,7 @@ Options affecting specific writers
378381
379382`--slide-level`=*NUMBER*
380383: Specifies that headers with the specified level create
381− slides (for `beamer`, `s5`, `slidy`, `dzslides`). Headers
384+ slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers
382385 above this level in the hierarchy are used to divide the
383386 slide show into sections; headers below this level create
384387 subheads within a slide. The default is to set the slide level
@@ -683,6 +686,8 @@ depending on the output format, but include:
683686`slidy-url`
684687: base URL for Slidy documents (defaults to
685688 `http://www.w3.org/Talks/Tools/Slidy2`)
689+`slideous-url`
690+: base URL for Slideous documents (defaults to `default`)
686691`s5-url`
687692: base URL for S5 documents (defaults to `ui/default`)
688693`fontsize`
@@ -1698,7 +1703,7 @@ Docbook
16981703Docx
16991704 ~ It will be rendered using OMML math markup.
17001705
1701−HTML, Slidy, DZSlides, S5, EPUB
1706+HTML, Slidy, Slideous, DZSlides, S5, EPUB
17021707 ~ The way math is rendered in HTML will depend on the
17031708 command-line options selected:
17041709
@@ -1749,7 +1754,8 @@ Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
17491754(except verbatim contexts, where `<`, `>`, and `&` are interpreted
17501755literally).
17511756
1752−The raw HTML is passed through unchanged in HTML, S5, Slidy, DZSlides, EPUB,
1757+The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
1758+DZSlides, EPUB,
17531759Markdown, and Textile output, and suppressed in other formats.
17541760
17551761*Pandoc extension*.
@@ -2070,9 +2076,9 @@ Producing slide shows with Pandoc
20702076=================================
20712077
20722078You can use Pandoc to produce an HTML + javascript slide presentation
2073−that can be viewed via a web browser. There are three ways to do this,
2074−using [S5], [DZSlides], or [Slidy]. You can also produce a PDF slide
2075−show using LaTeX [beamer].
2079+that can be viewed via a web browser. There are four ways to do this,
2080+using [S5], [DZSlides], [Slidy], or [Slideous]. You can also produce a
2081+PDF slide show using LaTeX [beamer].
20762082
20772083Here's the markdown source for a simple slide show, `habits.txt`:
20782084
@@ -2118,6 +2124,10 @@ for S5,
21182124
21192125for Slidy,
21202126
2127+ pandoc -t slideous -s habits.txt -o habits.html
2128+
2129+for Slideous,
2130+
21212131 pandoc -t dzslides -s habits.txt -o habits.html
21222132
21232133for DZSlides, or
@@ -2164,11 +2174,14 @@ you can just use level 1 headers for all each slide. (In that case, level 1
21642174will be the slide level.) But you can also structure the slide show into
21652175sections, as in the example above.
21662176
2167−For Slidy and S5, the file produced by pandoc with the `-s/--standalone`
2177+For Slidy, Slideous and S5, the file produced by pandoc with the
2178+`-s/--standalone`
21682179option embeds a link to javascripts and CSS files, which are assumed to
2169−be available at the relative path `s5/default` (for S5) or at the Slidy
2180+be available at the relative path `s5/default` (for S5) or `slideous`
2181+(for Slideous), or at the Slidy
21702182website at `w3.org` (for Slidy). (These paths can be changed by setting
2171−the `slidy-url` or `s5-url` variables; see `--variable`, above.) For DZSlides,
2183+the `slidy-url`, `slideous-url` or `s5-url` variables; see `--variable`,
2184+above.) For DZSlides,
21722185the (relatively short) javascript and css are included in the file by default.
21732186
21742187Incremental lists
@@ -2190,7 +2203,8 @@ Styling the slides
21902203------------------
21912204
21922205You can change the style of HTML slides by putting customized CSS files
2193−in `$DATADIR/s5/default` (for S5) or `$DATADIR/slidy` (for Slidy),
2206+in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
2207+or `$DATADIR/slideous` (for Slideous),
21942208where `$DATADIR` is the user data directory (see `--data-dir`, above).
21952209The originals may be found in pandoc's system data directory (generally
21962210`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
@@ -2267,6 +2281,7 @@ Latter, Ralf Stephan, Eric Seidel, B. Scott Michel.
22672281[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
22682282[S5]: http://meyerweb.com/eric/tools/s5/
22692283[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
2284+[Slideous]: http://goessner.net/articles/slideous/
22702285[HTML]: http://www.w3.org/TR/html40/
22712286[HTML 5]: http://www.w3.org/TR/html5/
22722287[XHTML]: http://www.w3.org/TR/xhtml1/
pandoc.cabal+5−1
@@ -20,7 +20,7 @@ Description: Pandoc is a Haskell library for converting from one markup
2020 markdown, reStructuredText, HTML, LaTeX, ConTeXt, Docbook,
2121 OpenDocument, ODT, Word docx, RTF, MediaWiki, Textile,
2222 groff man pages, plain text, Emacs Org-Mode, AsciiDoc, EPUB,
23− and S5 and Slidy HTML slide shows.
23+ and S5, Slidy and Slideous HTML slide shows.
2424 .
2525 Pandoc extends standard markdown syntax with footnotes,
2626 embedded LaTeX, definition lists, tables, and other
@@ -45,6 +45,7 @@ Data-Files:
4545 templates/default.rst, templates/default.plain,
4646 templates/default.mediawiki, templates/default.rtf,
4747 templates/default.s5, templates/default.slidy,
48+ templates/default.slideous,
4849 templates/default.dzslides, templates/default.asciidoc,
4950 templates/default.textile, templates/default.org,
5051 templates/epub-titlepage.html, templates/epub-page.html,
@@ -78,6 +79,9 @@ Data-Files:
7879 slidy/graphics/nofold-dim.gif,
7980 slidy/graphics/unfold-dim.gif,
8081 slidy/graphics/fold-dim.gif,
82+ -- data for slideous writer
83+ slideous/slideous.css,
84+ slideous/slideous.js,
8185 -- data for dzslides writer
8286 dzslides/template.html,
8387 -- data for citeproc
slideous/slideous.cssnew file+95
@@ -0,0 +1,95 @@
1+/* This work is licensed under Creative Commons GNU LGPL License.
2+
3+ License: http://creativecommons.org/licenses/LGPL/2.1/
4+ Version: 1.0
5+
6+ Author: Stefan Goessner/2005
7+ Web: http://goessner.net/
8+*/
9+@media screen, projection {
10+body {
11+ background-color: #e3eee7;
12+ padding: 0;
13+ margin: 0;
14+ color: #132;
15+ border-color: #678;
16+ font-size: 125%;
17+}
18+#statusbar {
19+ display: none;
20+ position: absolute; z-index: 10;
21+ top: auto; bottom: 0; left: 0; right: 0;
22+ height: 2em;
23+ background-color: #f0fff8;
24+ color: #132;
25+ font-size: 75%;
26+ padding: 0.5em 0.5em 0 2px;
27+ border-top: solid 1px #000;
28+}
29+#statusbar button, #tocbox {
30+ cursor: pointer;
31+ color: #031;
32+ background-color: #e0eee7;
33+ margin: 1px;
34+ padding: 0 0.5em;
35+ border: inset 1px black;
36+}
37+#statusbar button:hover, #tocbox:hover {
38+ color: #031;
39+ background-color: #c0ccc6;
40+ border: outset 1px black;
41+}
42+#tocbox {
43+ width: 15em;
44+}
45+#eos {
46+ visibility: hidden;
47+ color: #021;
48+ background-color: #fffafa;
49+ border: inset 1px black;
50+ font-size: 120%;
51+}
52+div.slide {
53+ display: block;
54+ margin: 0 0 2em 0;
55+ padding: 0 150px;
56+}
57+
58+div.slide h1 {
59+ background: #a0aaa4;
60+ color: #f0fff8;
61+ padding: 0 0.5em 0 0.5em;
62+ margin: 0 -150px;
63+ font-size: 120%;
64+ border-bottom: solid 1px black;
65+}
66+
67+div.slide h1:before { content: "# "; }
68+div.handout { display: block; }
69+
70+body>#statusbar { /* ie6 hack for fixing the statusbar - in quirks mode */
71+ position: fixed; /* thanks to Anne van Kesteren and Arthur Steiner */
72+} /* see http://limpid.nl/lab/css/fixed/footer */
73+* html body {
74+ overflow: hidden;
75+}
76+* html div.slide {
77+ height: 100%;
78+ padding-bottom: 2em;
79+ overflow: auto;
80+} /* end ie6-hack */
81+
82+} /* @media screen, projection */
83+
84+@media print {
85+body {
86+ color: black;
87+ font-family: sans-serif;
88+ font-size: 11pt;
89+}
90+
91+#statusbar { display: none; }
92+div.slide { page-break-after: always; }
93+div.handout { display: block; }
94+
95+} /* @media print */
slideous/slideous.jsnew file+321
@@ -0,0 +1,321 @@
1+/* This work is licensed under Creative Commons GNU LGPL License.
2+
3+ License: http://creativecommons.org/licenses/LGPL/2.1/
4+
5+ Author: Stefan Goessner/2005-2006
6+ Web: http://goessner.net/
7+*/
8+var Slideous = {
9+ version: 1.0,
10+ // == user customisable ===
11+ clickables: { a: true, button: true, img: true, input: true, object: true, textarea: true, select: true, option: true },
12+ incrementables: { blockquote: { filter: "self, parent" },
13+ dd: { filter: "self, parent" },
14+ dt: { filter: "self, parent" },
15+ h2: { filter: "self, parent" },
16+ h3: { filter: "self, parent" },
17+ h4: { filter: "self, parent" },
18+ h5: { filter: "self, parent" },
19+ h6: { filter: "self, parent" },
20+ li: { filter: "self, parent" },
21+ p: { filter: "self" },
22+ pre: { filter: "self" },
23+ img: { filter: "self, parent" },
24+ object: { filter: "self, parent" },
25+ table: { filter: "self, parent" },
26+ td: { filter: "self, parent" },
27+ th: { filter: "self, parent" },
28+ tr: { filter: "parent, grandparent" }
29+ },
30+ autoincrementables: { ol: true, ul: true, dl: true },
31+ autoincrement: false,
32+ statusbar: true,
33+ navbuttons: { incfontbutton: function(){Slideous.changefontsize(+Slideous.fontdelta);},
34+ decfontbutton: function(){Slideous.changefontsize(-Slideous.fontdelta);},
35+ contentbutton: function(){Slideous.gotoslide(Slideous.tocidx(), true, true);},
36+ homebutton: function(){Slideous.gotoslide(1, true, true);},
37+ prevslidebutton: function(){Slideous.previous(false);},
38+ previtembutton: function(){Slideous.previous(true);},
39+ nextitembutton: function(){Slideous.next(true);},
40+ nextslidebutton: function(){Slideous.next(false);},
41+ endbutton: function(){Slideous.gotoslide(Slideous.count,true,true);} },
42+ fontsize: 125, // in percent, corresponding to body.font-size in css file
43+ fontdelta: 5, // increase/decrease fontsize by this value
44+ mousesensitive: true,
45+ tocidx: 0,
46+ tocitems: { toc: "<li><a href=\"#s{\$slideidx}\">{\$slidetitle}</a></li>",
47+ tocbox: "<option value=\"#s{\$slideidx}\" title=\"{\$slidetitle}\">{\$slidetitle}</option>" },
48+ keydown: function(evt) {
49+ evt = evt || window.event;
50+ var key = evt.keyCode || evt.which;
51+ if (key && !evt.ctrlKey && !evt.altKey) {
52+ switch (key) {
53+ case 33: // page up ... previous slide
54+ Slideous.previous(false); evt.cancel = !Slideous.showall; break;
55+ case 37: // left arrow ... previous item
56+ Slideous.previous(true); evt.cancel = !Slideous.showall; break;
57+ case 32: // space bar
58+ case 39: // right arrow
59+ Slideous.next(true); evt.cancel = !Slideous.showall; break;
60+ case 13: // carriage return ... next slide
61+ case 34: // page down
62+ Slideous.next(false); evt.cancel = !Slideous.showall; break;
63+ case 35: // end ... last slide (not recognised by opera)
64+ Slideous.gotoslide(Slideous.count, true, true); evt.cancel = !Slideous.showall; break;
65+ case 36: // home ... first slide (not recognised by opera)
66+ Slideous.gotoslide(1, true, true); evt.cancel = !Slideous.showall; break;
67+ case 65: // A ... show All
68+ case 80: // P ... Print mode
69+ Slideous.toggleshowall(!Slideous.showall); evt.cancel = true; break;
70+ case 67: // C ... goto contents
71+ Slideous.gotoslide(Slideous.tocidx, true, true); evt.cancel = true; break;
72+ case 77: // M ... toggle mouse sensitivity
73+ Slideous.mousenavigation(Slideous.mousesensitive = !Slideous.mousesensitive); evt.cancel = true; break;
74+ case 83: // S ... toggle statusbar
75+ Slideous.togglestatusbar(); evt.cancel = true; break;
76+ case 61: // + ... increase fontsize
77+ case 107:
78+ Slideous.changefontsize(+Slideous.fontdelta); evt.cancel = true; break;
79+ case 109: // - ... decrease fontsize
80+ Slideous.changefontsize(-Slideous.fontdelta); evt.cancel = true; break;
81+ default: break;
82+ }
83+ if (evt.cancel) evt.returnValue = false;
84+ }
85+ return !evt.cancel;
86+ },
87+
88+ // == program logic ===
89+ count: 0, // # of slides ..
90+ curidx: 0, // current slide index ..
91+ mousedownpos: null, // last mouse down position ..
92+ contentselected: false, // indicates content selection ..
93+ showall: true,
94+ init: function() {
95+ Slideous.curidx = 1;
96+ Slideous.importproperties();
97+ Slideous.registerslides();
98+ document.body.innerHTML = Slideous.injectproperties(document.body.innerHTML);
99+ Slideous.buildtocs();
100+ Slideous.registeranchors();
101+ Slideous.toggleshowall(false);
102+ Slideous.updatestatus();
103+ document.body.style.fontSize = Slideous.fontsize+"%";
104+ document.getElementById("s1").style.display = "block";
105+ document.onkeydown = Slideous.keydown;
106+ Slideous.mousenavigation(Slideous.mousesensitive);
107+ Slideous.registerbuttons();
108+ if (window.location.hash)
109+ Slideous.gotoslide(window.location.hash.substr(2), true, true);
110+ },
111+ registerslides: function() {
112+ var div = document.getElementsByTagName("div");
113+ Slideous.count = 0;
114+ for (var i in div)
115+ if (Slideous.hasclass(div[i], "slide"))
116+ div[i].setAttribute("id", "s"+(++Slideous.count));
117+ },
118+ registeranchors: function() {
119+ var a = document.getElementsByTagName("a"),
120+ loc = (window.location.hostname+window.location.pathname).replace(/\\/g, "/");
121+ for (var i in a) {
122+ if (a[i].href && a[i].href.indexOf(loc) >= 0 && a[i].href.lastIndexOf("#") >= 0) {
123+ a[i].href = "javascript:Slideous.gotoslide(" + a[i].href.substr(a[i].href.lastIndexOf("#")+2)+",true,true)";
124+ }
125+ }
126+ },
127+ registerbuttons: function() {
128+ var button;
129+ for (var b in Slideous.navbuttons)
130+ if (button = document.getElementById(b))
131+ button.onclick = Slideous.navbuttons[b];
132+ },
133+ importproperties: function() { // from html meta section ..
134+ var meta = document.getElementsByTagName("meta"), elem;
135+ for (var i in meta)
136+ if (meta[i].attributes && meta[i].attributes["name"] && meta[i].attributes["name"].value in Slideous)
137+ switch (typeof(Slideous[meta[i].attributes["name"].value])) {
138+ case "number": Slideous[meta[i].attributes["name"].value] = parseInt(meta[i].attributes["content"].value); break;
139+ case "boolean": Slideous[meta[i].attributes["name"].value] = meta[i].attributes["content"].value == "true" ? true : false; break;
140+ default: Slideous[meta[i].attributes["name"].value] = meta[i].attributes["content"].value; break;
141+ }
142+ },
143+ injectproperties: function(str) {
144+ var meta = document.getElementsByTagName("meta"), elem;
145+ for (var i in meta) {
146+ if (meta[i].attributes && meta[i].attributes["name"])
147+ str = str.replace(new RegExp("{\\$"+meta[i].attributes["name"].value+"}","g"), meta[i].attributes["content"].value);
148+ }
149+ return str = str.replace(/{\$generator}/g, "Slideous")
150+ .replace(/{\$version}/g, Slideous.version)
151+ .replace(/{\$title}/g, document.title)
152+ .replace(/{\$slidecount}/g, Slideous.count);
153+ },
154+ buildtocs: function() {
155+ var toc = document.getElementById("toc"), list = "",
156+ tocbox = document.getElementById("tocbox");
157+ if (toc) {
158+ for (var i=0; i<Slideous.count; i++)
159+ list += Slideous.tocitems.toc.replace(/{\$slideidx}/g, i+1).replace(/{\$slidetitle}/, document.getElementById("s"+(i+1)).getElementsByTagName("h1")[0].innerHTML);
160+ toc.innerHTML = list;
161+ while (toc && !Slideous.hasclass(toc, "slide")) toc = toc.parentNode;
162+ if (toc) Slideous.tocidx = toc.getAttribute("id").substr(1);
163+ }
164+ if (tocbox) {
165+ tocbox.innerHTML = "";
166+ for (var i=0; i<Slideous.count; i++)
167+ tocbox.options[tocbox.length] = new Option((i+1)+". "+document.getElementById("s"+(i+1)).getElementsByTagName("h1")[0].innerHTML, "#s"+(i+1));
168+ tocbox.onchange = function() { Slideous.gotoslide(this.selectedIndex+1, true, true); };
169+ }
170+ },
171+ next: function(deep) {
172+ if (!Slideous.showall) {
173+ var slide = document.getElementById("s"+Slideous.curidx),
174+ item = Slideous.firstitem(slide, Slideous.isitemhidden);
175+ if (deep) { // next item
176+ if (item)
177+ Slideous.displayitem(item, true);
178+ else
179+ Slideous.gotoslide(Slideous.curidx+1, false, false);
180+ }
181+ else if (item) // complete slide ..
182+ while (item = Slideous.firstitem(slide, Slideous.isitemhidden))
183+ Slideous.displayitem(item, true);
184+ else // next slide
185+ Slideous.gotoslide(Slideous.curidx+1, true, false);
186+ Slideous.updatestatus();
187+ }
188+ },
189+ previous: function(deep) {
190+ if (!Slideous.showall) {
191+ var slide = document.getElementById("s"+Slideous.curidx);
192+ if (deep) {
193+ var item = Slideous.lastitem(slide, Slideous.isitemvisible);
194+ if (item)
195+ Slideous.displayitem(item, false);
196+ else
197+ Slideous.gotoslide(Slideous.curidx-1, true, false);
198+ }
199+ else
200+ Slideous.gotoslide(Slideous.curidx-1, true, false);
201+ Slideous.updatestatus();
202+ }
203+ },
204+ gotoslide: function(i, showitems, updatestatus) {
205+ if (!Slideous.showall && i > 0 && i <= Slideous.count && i != Slideous.curidx) {
206+ document.getElementById("s"+Slideous.curidx).style.display = "none";
207+ var slide = document.getElementById("s"+(Slideous.curidx=i)), item;
208+ while (item = Slideous.firstitem(slide, showitems ? Slideous.isitemhidden : Slideous.isitemvisible))
209+ Slideous.displayitem(item, showitems);
210+ slide.style.display = "block";
211+ if (updatestatus)
212+ Slideous.updatestatus();
213+ }
214+ },
215+ firstitem: function(root, filter) {
216+ var found = filter(root);
217+ for (var node=root.firstChild; node!=null && !found; node = node.nextSibling)
218+ found = Slideous.firstitem(node, filter);
219+ return found;
220+ },
221+ lastitem: function(root, filter) {
222+ var found = null;
223+ for (var node=root.lastChild; node!=null && !found; node = node.previousSibling)
224+ found = Slideous.lastitem(node, filter);
225+ return found || filter(root);
226+ },
227+ isitem: function(node, visible) {
228+ var nodename;
229+ return node && node.nodeType == 1 // elements only ..
230+ && (nodename=node.nodeName.toLowerCase()) in Slideous.incrementables
231+ && ( Slideous.incrementables[nodename].filter.match("\\bself\\b") && (Slideous.hasclass(node, "incremental") || (Slideous.autoincrement && nodename in Slideous.autoincrementables))
232+ || Slideous.incrementables[nodename].filter.match("\\bparent\\b") && (Slideous.hasclass(node.parentNode, "incremental") || (Slideous.autoincrement && node.parentNode.nodeName.toLowerCase() in Slideous.autoincrementables))
233+ || Slideous.incrementables[nodename].filter.match("\\bgrandparent\\b") && (Slideous.hasclass(node.parentNode.parentNode, "incremental") || (Slideous.autoincrement && node.parentNode.parentNode.nodeName.toLowerCase() in Slideous.autoincrementables))
234+ )
235+ && (visible ? (node.style.visibility != "hidden")
236+ : (node.style.visibility == "hidden"))
237+ ? node : null;
238+ },
239+ isitemvisible: function(node) { return Slideous.isitem(node, true); },
240+ isitemhidden: function(node) { return Slideous.isitem(node, false); },
241+ displayitem: function(item, show) {
242+ if (item) item.style.visibility = (show ? "visible" : "hidden");
243+ },
244+ updatestatus: function() {
245+ if (Slideous.statusbar) {
246+ var eos = document.getElementById("eos"),
247+ idx = document.getElementById("slideidx"),
248+ tocbox = document.getElementById("tocbox");
249+ if (eos)
250+ eos.style.visibility = Slideous.firstitem(document.getElementById("s"+Slideous.curidx), Slideous.isitemhidden) != null
251+ ? "visible" : "hidden";
252+ if (idx)
253+ idx.innerHTML = Slideous.curidx;
254+ if (tocbox)
255+ tocbox.selectedIndex = Slideous.curidx-1;
256+ }
257+ },
258+ changefontsize: function(delta) {
259+ document.body.style.fontSize = (Slideous.fontsize+=delta)+"%";
260+ },
261+ togglestatusbar: function() {
262+ document.getElementById("statusbar").style.display = (Slideous.statusbar = !Slideous.statusbar) ? "block" : "none";
263+ },
264+ toggleshowall: function(showall) {
265+ var slide, item;
266+ for (var i=0; i<Slideous.count; i++) {
267+ slide = document.getElementById("s"+(i+1));
268+ slide.style.display = showall ? "block" : "none";
269+ while (item = Slideous.firstitem(slide, showall ? Slideous.isitemhidden : Slideous.isitemvisible))
270+ Slideous.displayitem(item, showall);
271+ var divs = slide.getElementsByTagName("div");
272+ for (var j in divs)
273+ if (Slideous.hasclass(divs[j], "handout"))
274+ divs[j].style.display = showall ? "block" : "none";
275+ }
276+ if (!showall)
277+ document.getElementById("s"+Slideous.curidx).style.display = "block";
278+ if (Slideous.statusbar)
279+ document.getElementById("statusbar").style.display = showall ? "none" : "block";
280+ Slideous.showall = showall;
281+ },
282+ hasclass: function(elem, classname) {
283+ var classattr = null;
284+ return (classattr=(elem.attributes && elem.attributes["class"]))
285+ && classattr.nodeValue.match("\\b"+classname+"\\b");
286+ },
287+ selectedcontent: function() {
288+ return window.getSelection ? window.getSelection().toString()
289+ : document.getSelection ? document.getSelection()
290+ : document.selection ? document.selection.createRange().text
291+ : "";
292+ },
293+ mousenavigation: function(on) {
294+ if (on) {
295+ document.onmousedown = Slideous.mousedown;
296+ document.onmouseup = Slideous.mouseup;
297+ }
298+ else
299+ document.onmousedown = document.onmouseup = null;
300+ },
301+ mousepos: function(e) {
302+ return e.pageX ? {x: e.pageX, y: e.pageY}
303+ : {x: e.x+document.body.scrollLeft, y: e.y+document.body.scrollTop};
304+ },
305+ mousedown: function(evt) {
306+ evt = evt||window.event;
307+ Slideous.mousedownpos = Slideous.mousepos(evt);
308+ Slideous.contentselected = !!Slideous.selectedcontent() || ((evt.target || evt.srcElement).nodeName.toLowerCase() in Slideous.clickables);
309+ return true;
310+ },
311+ mouseup: function(evt) {
312+ evt = evt||window.event;
313+ var pos = Slideous.mousepos(evt);
314+ if (pos.x == Slideous.mousedownpos.x && pos.y == Slideous.mousedownpos.y && !Slideous.contentselected) {
315+ Slideous.next(true);
316+ return evt.returnValue = !(evt.cancel = true);
317+ }
318+ return false;
319+ }
320+};
321+window.onload = Slideous.init;
src/Text/Pandoc.hs+1
@@ -187,6 +187,7 @@ writers = [("native" , writeNative)
187187 writerHtml5 = True })
188188 ,("s5" , writeHtmlString)
189189 ,("slidy" , writeHtmlString)
190+ ,("slideous" , writeHtmlString)
190191 ,("dzslides" , writeHtmlString)
191192 ,("docbook" , writeDocbook)
192193 ,("opendocument" , writeOpenDocument)
src/Text/Pandoc/Shared.hs+2−1
@@ -482,6 +482,7 @@ data ObfuscationMethod = NoObfuscation
482482-- | Varieties of HTML slide shows.
483483data HTMLSlideVariant = S5Slides
484484 | SlidySlides
485+ | SlideousSlides
485486 | DZSlides
486487 | NoSlides
487488 deriving (Show, Read, Eq)
@@ -494,7 +495,7 @@ data WriterOptions = WriterOptions
494495 , writerEPUBMetadata :: String -- ^ Metadata to include in EPUB
495496 , writerTabStop :: Int -- ^ Tabstop for conversion btw spaces and tabs
496497 , writerTableOfContents :: Bool -- ^ Include table of contents
497− , writerSlideVariant :: HTMLSlideVariant -- ^ Are we writing S5 or Slidy?
498+ , writerSlideVariant :: HTMLSlideVariant -- ^ Are we writing S5, Slidy or Slideous?
498499 , writerIncremental :: Bool -- ^ True if lists should be incremental
499500 , writerXeTeX :: Bool -- ^ Create latex suitable for use by xetex
500501 , writerHTMLMathMethod :: HTMLMathMethod -- ^ How to print math in HTML
src/Text/Pandoc/Slides.hs+1−1
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2626 Portability : portable
2727
2828Utility functions for splitting documents into slides for slide
29−show formats (dzslides, s5, slidy, beamer).
29+show formats (dzslides, s5, slidy, slideous, beamer).
3030-}
3131module Text.Pandoc.Slides ( getSlideLevel, prepSlides ) where
3232import Text.Pandoc.Definition
src/Text/Pandoc/Writers/HTML.hs+1
@@ -199,6 +199,7 @@ inTemplate opts tit auths authsMeta date toc body' newvars =
199199 , ("date", date')
200200 , ("idprefix", writerIdentifierPrefix opts)
201201 , ("slidy-url", "http://www.w3.org/Talks/Tools/Slidy2")
202+ , ("slideous-url", "slideous")
202203 , ("s5-url", "s5/default") ] ++
203204 [ ("html5","true") | writerHtml5 opts ] ++
204205 (case toc of
src/pandoc.hs+4−3
@@ -101,7 +101,7 @@ data Opt = Opt
101101 , optOutputFile :: String -- ^ Name of output file
102102 , optNumberSections :: Bool -- ^ Number sections in LaTeX
103103 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
104− , optIncremental :: Bool -- ^ Use incremental lists in Slidy/S5
104+ , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
105105 , optSelfContained :: Bool -- ^ Make HTML accessible offline
106106 , optSmart :: Bool -- ^ Use smart typography
107107 , optOldDashes :: Bool -- ^ Parse dashes like pandoc <=1.8.2.1
@@ -454,7 +454,7 @@ options =
454454 , Option "i" ["incremental"]
455455 (NoArg
456456 (\opt -> return opt { optIncremental = True }))
457− "" -- "Make list items display incrementally in Slidy/S5"
457+ "" -- "Make list items display incrementally in Slidy/Slideous/S5"
458458
459459 , Option "" ["slide-level"]
460460 (ReqArg
@@ -887,6 +887,7 @@ main = do
887887 let slideVariant = case writerName' of
888888 "s5" -> S5Slides
889889 "slidy" -> SlidySlides
890+ "slideous" -> SlideousSlides
890891 "dzslides" -> DZSlides
891892 _ -> NoSlides
892893
@@ -1052,7 +1053,7 @@ main = do
10521053 where result = w writerOptions doc2 ++ ['\n' | not standalone']
10531054 htmlFormat = writerName' `elem`
10541055 ["html","html+lhs","html5","html5+lhs",
1055− "s5","slidy","dzslides"]
1056+ "s5","slidy","slideous","dzslides"]
10561057 selfcontain = if selfContained && htmlFormat
10571058 then makeSelfContained datadir
10581059 else return