Skip to content

Instantly share code, notes, and snippets.

@Tagirijus
Forked from ritalin/slides.md
Last active September 7, 2018 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tagirijus/837abb01ceca40cc02ad7b5a56f12e67 to your computer and use it in GitHub Desktop.
Save Tagirijus/837abb01ceca40cc02ad7b5a56f12e67 to your computer and use it in GitHub Desktop.
Customized Pandoc (http://johnmacfarlane.net/pandoc/) template for reveal.js (http://lab.hakim.se/reveal-js/#/)Add the feature displaying fragment.Add the feature changing background color.

% Title % Name % Date

My first slide { fragment=fade-in target=li }

Displaying fragment for specified target element.

List

  • this
  • is
  • cool

Variables

The following variables can be defined from the command line:

  • theme
  • transition
pandoc -t html5 --template=template-revealjs.html \
	--standalone --section-divs \
  --variable theme="beige" \
  --variable transition="linear" \
  slides.md -o slides.html

Background color { bg_color=coral }

Change background color.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>$title$</title>
<meta name="description" content="$title$">
$for(author)$
<meta name="author" content="$author$" />
$endfor$
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="$revealjs-url$/css/reveal.css">
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
$if(theme)$
<link rel="stylesheet" href="$revealjs-url$/css/theme/$theme$.css" id="theme">
$else$
<link rel="stylesheet" href="$revealjs-url$/css/theme/black.css" id="theme">
$endif$
<!-- For syntax highlighting -->
$if(highlight-style)$
<link rel="stylesheet" href="$revealjs-url$/lib/css/$highlight-style$.css">
$else$
<link rel="stylesheet" href="$revealjs-url$/lib/css/zenburn.css">
$endif$
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="$revealjs-url$/css/print/' +
( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) +
'.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="$revealjs-url$/lib/js/html5shiv.js"></script>
<![endif]-->
$for(header-includes)$
$header-includes$
$endfor$
</head>
<body>
$for(include-before)$
$include-before$
$endfor$
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>$title$</h1>
$for(author)$<h3>$author$</h3>$endfor$
<p>
<h4>$date$</h4>
</p>
</section>
$if(toc)$
<section>
<h2>Outline</h2>
<nav id="$idprefix$TOC">
$toc$
</nav>
</section>
$endif$
$body$
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="$revealjs-url$/lib/js/head.min.js"></script>
<script src="$revealjs-url$/js/reveal.js"></script>
<script>
jQuery('section').removeAttr('id');
jQuery('section[target]')
.map(function(i, el) {
jQuery(el).find(el.attributes.target.value)
.map(function() {
jQuery(this).addClass('fragment ' + el.attributes['data-fragment'].value)
});
});
jQuery('section[data-bg_color]')
.map(function(i, el) {
jQuery(el).attr('data-background', el.attributes['data-bg_color'].value);
});
</script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
// Push each slide change to the browser history
history: true,
// Optional reveal.js plugins
dependencies: [
{ src: '$revealjs-url$/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: '$revealjs-url$/plugin/zoom-js/zoom.js', async: true },
{ src: '$revealjs-url$/plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment