reveal.jsでmarkdownが簡単に使えるので忘れないように備忘録。
■GitHub
https://github.com/hakimel/reveal.js/#installation
■デモ
http://lab.hakim.se/reveal-js/#/
■使い方
1. Githubからzipをダウンロード
2. Webサーバ(Apacheなど)上のドキュメントルート配下にでもアーカイブを解凍
3. 解凍したディレクトリの中にあるindex.htmlを以下(langとsection部分)のような感じに書き換える
※ハイライト部分
<!doctype html> <html lang="ja"> <head> <meta charset="utf-8"> <title>reveal.js - The HTML Presentation Framework</title> <meta name="description" content="A framework for easily creating beautiful presentations using HTML"> <meta name="author" content="Hakim El Hattab"> <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="css/reveal.min.css"> <link rel="stylesheet" href="css/theme/default.css" id="theme"> <!-- For syntax highlighting --> <link rel="stylesheet" href="lib/css/zenburn.css"> <!-- If the query includes 'print-pdf', include the PDF print sheet --> <script> if( window.location.search.match( /print-pdf/gi ) ) { var link = document.createElement( 'link' ); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'css/print/pdf.css'; document.getElementsByTagName( 'head' )[0].appendChild( link ); } </script> <!--[if lt IE 9]> <script src="lib/js/html5shiv.js"></script> <![endif]--> </head> <body> <div class="reveal"> <!-- Any section element inside of this container is displayed as a slide --> <div class="slides"> <section data-markdown> <script type="text/template"> ## タイトル 文字 </script> </section> </div> </div> <script src="lib/js/head.min.js"></script> <script src="js/reveal.min.js"></script> <script> // Full list of configuration options available here: // https://github.com/hakimel/reveal.js#configuration Reveal.initialize({ controls: true, progress: true, history: true, center: true, theme: Reveal.getQueryHash().theme, // available themes are in /css/theme transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none // Parallax scrolling // parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg', // parallaxBackgroundSize: '2100px 900px', // Optional libraries used to extend on reveal.js dependencies: [ { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } } ] }); </script> </body> </html>
4. 終わり :-)
■参考文献
1. http://slidedeck.io/budougumi0617/reveal.js-myMaster
2. http://qiita.com/siguremon/items/c717eca388070215712c
3. http://webbeginner.hatenablog.com/entry/2014/03/30/012720