git.iko.soy/typeable/pandoc
on master help sign in
Added syntax for "pauses" in beamer or reaveljs slide shows.
6217623John MacFarlane
README+42−30
@@ -2416,9 +2416,9 @@ Producing slide shows with Pandoc
2416=================================
2416=================================
2417
2417
2418You can use Pandoc to produce an HTML + javascript slide presentation
2418You can use Pandoc to produce an HTML + javascript slide presentation
2419−that can be viewed via a web browser. There are four ways to do this,
2419+that can be viewed via a web browser. There are five ways to do this,
2420−using [S5], [DZSlides], [Slidy], or [Slideous]. You can also produce a
2420+using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
2421−PDF slide show using LaTeX [beamer].
2421+You can also produce a PDF slide show using LaTeX [beamer].
2422
2422
2423Here's the markdown source for a simple slide show, `habits.txt`:
2423Here's the markdown source for a simple slide show, `habits.txt`:
2424
2424
@@ -2454,31 +2454,31 @@ Here's the markdown source for a simple slide show, `habits.txt`:
2454 - Get in bed
2454 - Get in bed
2455 - Count sheep
2455 - Count sheep
2456
2456
2457−To produce the slide show, simply type
2457+To produce an HTML/javascript slide show, simply type
2458
2458
2459− pandoc -t s5 -s habits.txt -o habits.html
2459+ pandoc -t FORMAT -s habits.txt -o habits.html
2460
2460
2461−for S5,
2461+where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
2462
2462
2463− pandoc -t slidy -s habits.txt -o habits.html
2463+For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
2464+`-s/--standalone` option embeds a link to javascripts and CSS files, which are
2465+assumed to be available at the relative path `s5/default` (for S5), `slideous`
2466+(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
2467+`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
2468+`slideous-url`, `revealjs-url`, or `s5-url` variables; see `--variable`,
2469+above.) For DZSlides, the (relatively short) javascript and css are included in
2470+the file by default.
2464
2471
2465−for Slidy,
2472+With all HTML slide formats, the `--self-contained` option can be used to
2466−
2473+produce a single file that contains all of the data necessary to display the
2467− pandoc -t slideous -s habits.txt -o habits.html
2474+slide show, including linked scripts, stylesheets, images, and videos.
2468−
2469−for Slideous,
2470−
2471− pandoc -t dzslides -s habits.txt -o habits.html
2472
2475
2473−for DZSlides, or
2476+To produce a PDF slide show using beamer, type
2474
2477
2475 pandoc -t beamer habits.txt -o habits.pdf
2478 pandoc -t beamer habits.txt -o habits.pdf
2476
2479
2477−for beamer.
2480+Note that a reveal.js slide show can also be converted to a PDF
2478−
2481+by printing it to a file from the browser.
2479−With all HTML slide formats, the `--self-contained` option can be used to
2480−produce a single file that contains all of the data necessary to display the
2481−slide show, including linked scripts, stylesheets, images, and videos.
2482
2482
2483Structuring the slide show
2483Structuring the slide show
2484--------------------------
2484--------------------------
@@ -2514,16 +2514,6 @@ you can just use level 1 headers for all each slide. (In that case, level 1
2514will be the slide level.) But you can also structure the slide show into
2514will be the slide level.) But you can also structure the slide show into
2515sections, as in the example above.
2515sections, as in the example above.
2516
2516
2517−For Slidy, Slideous and S5, the file produced by pandoc with the
2518−`-s/--standalone`
2519−option embeds a link to javascripts and CSS files, which are assumed to
2520−be available at the relative path `s5/default` (for S5) or `slideous`
2521−(for Slideous), or at the Slidy
2522−website at `w3.org` (for Slidy). (These paths can be changed by setting
2523−the `slidy-url`, `slideous-url` or `s5-url` variables; see `--variable`,
2524−above.) For DZSlides,
2525−the (relatively short) javascript and css are included in the file by default.
2526−
2527Incremental lists
2517Incremental lists
2528-----------------
2518-----------------
2529
2519
@@ -2539,6 +2529,21 @@ all at once with the `-i` option), put it in a block quote:
2539In this way incremental and nonincremental lists can be mixed in
2529In this way incremental and nonincremental lists can be mixed in
2540a single document.
2530a single document.
2541
2531
2532+Inserting pauses
2533+----------------
2534+
2535+In reveal.js and beamer slide shows, you can add "pauses" within
2536+a slide by including a paragraph containing three dots, separated
2537+by spaces:
2538+
2539+ # Slide with a pause
2540+
2541+ content before the pause
2542+
2543+ . . .
2544+
2545+ content after the pause
2546+
2542Styling the slides
2547Styling the slides
2543------------------
2548------------------
2544
2549
@@ -2553,6 +2558,13 @@ files it does not find in the user data directory.
2553For dzslides, the CSS is included in the HTML file itself, and may
2558For dzslides, the CSS is included in the HTML file itself, and may
2554be modified there.
2559be modified there.
2555
2560
2561+For reveal.js, themes can be used by setting the `theme` variable,
2562+for example:
2563+
2564+ -V theme=moon
2565+
2566+Or you can specify a custom stylesheet using the `--css` option.
2567+
2556To style beamer slides, you can specify a beamer "theme" or "colortheme"
2568To style beamer slides, you can specify a beamer "theme" or "colortheme"
2557using the `-V` option:
2569using the `-V` option:
2558
2570
src/Text/Pandoc/Writers/HTML.hs+4
@@ -426,6 +426,10 @@ blockToHtml opts (Para [Image txt (s,'f':'i':'g':':':tit)]) = do
426 [nl opts, img, capt, nl opts]
426 [nl opts, img, capt, nl opts]
427 else H.div ! A.class_ "figure" $ mconcat
427 else H.div ! A.class_ "figure" $ mconcat
428 [nl opts, img, capt, nl opts]
428 [nl opts, img, capt, nl opts]
429+-- . . . indicates a pause in a slideshow
430+blockToHtml opts (Para [Str ".",Space,Str ".",Space,Str "."])
431+ | writerSlideVariant opts == RevealJsSlides =
432+ blockToHtml opts (RawBlock "html" "<div class=\"fragment\" />")
429blockToHtml opts (Para lst) = do
433blockToHtml opts (Para lst) = do
430 contents <- inlineListToHtml opts lst
434 contents <- inlineListToHtml opts lst
431 return $ H.p contents
435 return $ H.p contents
src/Text/Pandoc/Writers/LaTeX.hs+6
@@ -293,6 +293,12 @@ blockToLaTeX (Para [Image txt (src,'f':'i':'g':':':tit)]) = do
293 img <- inlineToLaTeX (Image txt (src,tit))
293 img <- inlineToLaTeX (Image txt (src,tit))
294 return $ "\\begin{figure}[htbp]" $$ "\\centering" $$ img $$
294 return $ "\\begin{figure}[htbp]" $$ "\\centering" $$ img $$
295 capt $$ "\\end{figure}"
295 capt $$ "\\end{figure}"
296+-- . . . indicates pause in beamer slides
297+blockToLaTeX (Para [Str ".",Space,Str ".",Space,Str "."]) = do
298+ beamer <- writerBeamer `fmap` gets stOptions
299+ if beamer
300+ then blockToLaTeX (RawBlock "latex" "\\pause")
301+ else inlineListToLaTeX [Str ".",Space,Str ".",Space,Str "."]
296blockToLaTeX (Para lst) =
302blockToLaTeX (Para lst) =
297 inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst
303 inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst
298blockToLaTeX (BlockQuote lst) = do
304blockToLaTeX (BlockQuote lst) = do