Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Giant Merge #150

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2c06683
Allow irb prompt for commandline slides
rkh Sep 22, 2011
313aff7
update sinatra version, so we can use tilt and it's preferred markdow…
timfel Oct 8, 2011
4ddf2f4
use recent sinatra
timfel Oct 8, 2011
5b8e113
#options and #public are deprecated, use #settings and #public_folder…
timfel Oct 8, 2011
96d510d
Fixing print CSS
grundprinzip Nov 12, 2011
04dd4eb
Templates
grundprinzip Nov 13, 2011
ce08379
Templates for Statics and PDFs
grundprinzip Nov 13, 2011
a838d8c
Documentation for Templates
grundprinzip Nov 13, 2011
bad2a58
Proper formating for documentation
grundprinzip Nov 13, 2011
ea6046a
Documentation and Replacements
grundprinzip Nov 13, 2011
00f52a9
Fixing syntax highlighting in static mode and PDF output
grundprinzip Nov 13, 2011
f6a82a4
Removing old init stuff
grundprinzip Nov 13, 2011
e900701
Avoiding error if no @languages specified
grundprinzip Nov 13, 2011
2b76bc2
Fixing bad logger variable in static mode
grundprinzip Nov 14, 2011
a5abc87
Merge remote-tracking branch 'timfel/replace-bluecloth' into altmaster
grundprinzip Nov 14, 2011
53e6df7
Cleanup
grundprinzip Nov 14, 2011
e685821
Fixing failing tests
grundprinzip Nov 14, 2011
ec8122d
Merge branch 'templating' into altmaster
grundprinzip Nov 14, 2011
1792680
Merge remote-tracking branch 'rkh/patch-1' into altmaster
grundprinzip Nov 14, 2011
3a68eaf
Making PDF options configurable from the config file
grundprinzip Nov 14, 2011
8c2c10e
CSS reset for pages after full-page was shown
grundprinzip Nov 14, 2011
2f42a88
Added example to example slides as required by CONTRIB.txt
grundprinzip Nov 14, 2011
0eaf2a0
Merge branch 'templating' into altmaster
grundprinzip Nov 14, 2011
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
source :rubygems

gem "sinatra"
gem "bluecloth"
gem "nokogiri"
gem "json"
gem "gli",">= 1.2.5"
gem "parslet"

gemspec

group :development do
gem "mg"
Expand Down
97 changes: 85 additions & 12 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,23 @@ the following contents:

That represents two slides, the first contains just a large title, and the
second is faded into view showing the title and three bullets that are then
incrementally shown. In order for ShowOff to see those slides, your
incrementally shown. In addition you can configure a certain template for
this slide overriding the default one:

!SLIDE[tpl=title]

# My Presentation #

!SLIDE bullets incremental

# Bullet Points #

* first point
* second point
* third point


In order for ShowOff to see those slides, your
<tt>showoff.json</tt> file needs to look something like this:

{
Expand All @@ -95,19 +111,20 @@ incrementally shown. In order for ShowOff to see those slides, your
]
}

If you have multiple sections in your talk, you can make this json array
include all the sections you want to show in which order you want to show
them.
If you have multiple sections in your talk, you can make this json
array include all the sections you want to show in which order you
want to show them. Template configuration is done in
<tt>showoff.json</tt> as well.

Instead of a hash, you can use a plain string as an entry in the `sections`
section of `showoff.json`.

And if that plain string starts with '#' then it is interpreted not as a
filename, but as markdown. This is used for inserting interstitial slides
or notes -- for instance, Alex Chaffee's
[Ruby Notes](http://github.com/alexch/ruby_notes)
uses it to insert lab instructions between lecture slide sections, which may
vary from venue to venue.
Instead of a hash, you can use a plain string as an entry in the
`sections` section of `showoff.json`. And if that plain string starts
with '#' then it is interpreted not as a filename, but as
markdown. This is used for inserting interstitial slides or notes --
for instance, Alex Chaffee's [Ruby
Notes](http://github.com/alexch/ruby_notes) uses it to insert lab
instructions between lecture slide sections, which may vary from venue
to venue.

If you want to keep the ability to emit an HTML document from your
Markdown source file -- say, for a TextMate preview or a GitHub rendering
Expand Down Expand Up @@ -446,6 +463,62 @@ You'll then need to install a version of wkhtmltopdf available at the {wkhtmltop

Then restart showoff, and navigate to <tt>/pdf</tt> (e.g. http://localhost/pdf) of your presentation and a PDF will be generated with the browser.

= ShowOff Templates

Templates can come handy if you need more than what you can achieve
via CSS. To configure templates you'll have to specify them in the
<tt>showoff.json</tt> by adding an entry called "templates". This
entry is an object where you can specify as many templates as you
want. The default template is marked with the "default" key.

{
"name": "Something",
"description": "Example Presentation",
"templates" : {
"default" : "tpl1.tpl",
"special" : "tpl2.tpl"
},
"sections": [
{"section":"one"}
]
}

If the "default" key is not given, no template will be used for the
default slide. If you want to apply a certain layout to a slide you
have to specify it in the slide header:

!SLIDE[tpl=special]
# Header

== Template Commands

You can place content anywhere in your template, but you have to
explicitly mark the location using a special command:

[~~~CONTENT~~~] is replaced by the slide content

[~~~CURRENT_SLIDE~~~] is replaced by the current slide number

[~~~NUM_SLIDES~~~] is replaced by the total number of slides

[~~~CONFIG:*~~~] is replaced by any value (*) from the
<tt>showoff.json</tt> configuration. This can be used to
specify an author, venue etc. A simple example would be
<tt>~~~CONFIG:author~~~</tt>


The usage of these replacements is not limited to templates, but
anywhere in your slides.

== Template Hints

You can basically put everything you want into templates, but you
should make sure that the CSS is applied fine. The best way to apply a
custom layout is to create a container that uses absolute positioning
and has width and height set to 100% which are then derived from the
parent slide element.


= Completion

== ZSH completion
Expand Down
5 changes: 5 additions & 0 deletions example/four/01slide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
!SLIDE[tpl=special]

# A Template #

Really? How many slides? -- ~~~NUM_SLIDES~~~
7 changes: 6 additions & 1 deletion example/showoff.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"name": "Something",
"description": "Example Presentation",
"author": "Foo Bar John",
"templates" : {
"special" : "simple.tpl"
},
"sections": [
{"section":"one"},
{"section":"two"},
{"section":"three"}
{"section":"three"},
{"section":"four"}
]
}
2 changes: 2 additions & 0 deletions example/simple.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<div class="border">~~~CONFIG:author~~~@~~~CURRENT_SLIDE~~~</div>
<div class="main">~~~CONTENT~~~<div>
2 changes: 1 addition & 1 deletion lib/commandline_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class CommandlineParser < Parslet::Parser

rule(:prompt) do
str('$') | str('#')
str('$') | str('#') | str('>>')
end

rule(:text) do
Expand Down
Loading