Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Templates for Statics and PDFs

* fixing positioning of a slide when using the onepage.css
  • Loading branch information...
commit ce083796685e2abf4fa90ad132d6ec8548aaec97 1 parent 04dd4eb
@grundprinzip authored
View
20 lib/showoff.rb
@@ -190,26 +190,36 @@ def process_markdown(name, content, static=false, pdf=false)
md += " class=\"slide\" data-transition=\"#{transition}\">"
+ template = "###CONTENT###"
# Template handling
if options.pres_template
# We allow specifying a new template even when default is
# not given.
if options.pres_template.include?(slide.tpl) and
File.exists?(options.pres_template[slide.tpl])
- md += File.open(options.pres_template[slide.tpl], "r").read()
+ template = File.open(options.pres_template[slide.tpl], "r").read()
end
end
+
+ # Extract the content of the slide
+ content = ""
+
if seq
- md += "<div class=\"#{content_classes.join(' ')}\" ref=\"#{name}/#{seq.to_s}\">\n"
+ content += "<div class=\"#{content_classes.join(' ')}\" ref=\"#{name}/#{seq.to_s}\">\n"
seq += 1
else
- md += "<div class=\"#{content_classes.join(' ')}\" ref=\"#{name}\">\n"
+ content += "<div class=\"#{content_classes.join(' ')}\" ref=\"#{name}\">\n"
end
sl = Markdown.new(slide.text).to_html
sl = update_image_paths(name, sl, static, pdf)
- md += sl
- md += "</div>\n"
+ content += sl
+ content += "</div>\n"
+
+ # Apply the template to the slide and replace the key with
+ # content of the slide
+ md += template.gsub(/###CONTENT###/, content)
+
md += "</div>\n"
final += update_commandline_code(md)
final = update_p_classes(final)
View
1  public/css/onepage.css
@@ -9,6 +9,7 @@
margin-left:auto;
margin-right:auto;
overflow:hidden;
+ position: relative;
border: 1px solid #333;
page-break-after: always
}
View
3  public/js/onepage.js
@@ -1,5 +1,4 @@
function setupOnePage() {
sh_highlightDocument('/js/sh_lang/', '.min.js')
-
centerSlides($("#slides > .slide"))
-}
+}
View
2  views/onepage.erb
@@ -25,10 +25,8 @@
</head>
<body>
-
<div id="slides">
<%= @slides %>
</div>
-
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.