Skip to content

Commit

Permalink
Aligned document template with latest reveal.js index.html
Browse files Browse the repository at this point in the history
Dropped a lot of old cruft that accumulated
  • Loading branch information
obilodeau committed Jan 29, 2020
1 parent a5ec12f commit d7a139c
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions templates/document.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ doctype 5
html lang=(attr :lang, 'en' unless attr? :nolang)
head
meta charset="utf-8"
meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"

title=(doctitle sanitize: true, use_fallback: true)

- if RUBY_ENGINE == 'opal' && JAVASCRIPT_PLATFORM == 'node'
- revealjsdir = (attr :revealjsdir, 'node_modules/reveal.js')
- else
Expand All @@ -13,11 +17,9 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
- if attr? key
meta name=key content=(attr key)
- linkcss = (attr? 'linkcss')
title=(doctitle sanitize: true, use_fallback: true)
meta content="yes" name="apple-mobile-web-app-capable"
meta content="black-translucent" name="apple-mobile-web-app-status-bar-style"
meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" name="viewport"
link href="#{revealjsdir}/css/reveal.css" rel="stylesheet"
link rel="stylesheet" href="#{revealjsdir}/css/reset.css"
link rel="stylesheet" href="#{revealjsdir}/css/reveal.css"

/ Default theme required even when using custom theme
- if attr? :revealjs_customtheme
link rel='stylesheet' href=(attr :revealjs_customtheme) id='theme'
Expand Down Expand Up @@ -53,15 +55,15 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
- syntax_hl = self.syntax_highlighter
- if syntax_hl && (syntax_hl.docinfo? :head)
=syntax_hl.docinfo :head, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/'
/ If the query includes 'print-pdf', use the PDF print sheet

/! Printing and PDF exports
javascript:
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? "#{revealjsdir}/css/print/pdf.css" : "#{revealjsdir}/css/print/paper.css";
document.getElementsByTagName( 'head' )[0].appendChild( link );
/[if lt IE 9]
<script src="#{revealjsdir}/lib/js/html5shiv.js"></script>
- unless (docinfo_content = docinfo :header, '.html').empty?
=docinfo_content
- if attr? :customcss
Expand Down Expand Up @@ -100,8 +102,8 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
- unless author.nil?
p.author: small=author
=content
// FIXME we need to sync with upstream now, see changes in https://github.com/hakimel/reveal.js/blame/master/index.html
script src="#{revealjsdir}/js/reveal.js"
/ Supports easy AsciiDoc syntax for background color
javascript:
Array.prototype.slice.call(document.querySelectorAll('.slides section')).forEach(function(slide) {
if (slide.getAttribute('data-background-color')) return;
Expand All @@ -114,7 +116,9 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
}
})
// See https://github.com/hakimel/reveal.js#configuration for a full list of configuration options
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
// Display presentation control arrows
controls: #{to_boolean(attr 'revealjs_controls', true)},
Expand Down Expand Up @@ -242,13 +246,11 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: '#{revealjsdir}/lib/js/classList.js', condition: function() { return !document.body.classList; } },
#{(document.attr? 'source-highlighter', 'highlightjs') ? "{ src: '#{revealjsdir}/plugin/highlight/highlight.js', async: true }," : nil}
#{(attr? 'revealjs_plugin_zoom', 'disabled') ? "" : "{ src: '#{revealjsdir}/plugin/zoom-js/zoom.js', async: true }," }
#{(attr? 'revealjs_plugin_notes', 'disabled') ? "" : "{ src: '#{revealjsdir}/plugin/notes/notes.js', async: true }," }
#{(attr? 'revealjs_plugin_marked', 'enabled') ? "{ src: '#{revealjsdir}/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }," : "" }
#{(attr? 'revealjs_plugin_markdown', 'enabled') ? "{ src: '#{revealjsdir}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }," : "" }
#{(attr? 'revealjs_plugin_pdf', 'enabled') ? "{ src: '#{revealjsdir}/plugin/print-pdf/print-pdf.js', async: true }," : "" }
#{(attr? 'revealjs_plugin_marked', 'enabled') ? "{ src: '#{revealjsdir}/plugin/markdown/marked.js' }," : "" }
#{(attr? 'revealjs_plugin_markdown', 'enabled') ? "{ src: '#{revealjsdir}/plugin/markdown/markdown.js' }," : "" }
#{(attr? 'revealjs_plugins') ? File.read(attr('revealjs_plugins', '')) : ""}
],
Expand Down

0 comments on commit d7a139c

Please sign in to comment.