Skip to content

Commit

Permalink
added --nocontrols flag to remove arrows from presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jdan committed Oct 9, 2012
1 parent 2e7f33f commit 63de3c9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ stylesheet:
cleaver --file=examples/basic.json --output=render.html --style=styles/dark.css
```

By default, **cleaver** will place navigation arrows in the bottom
corners of your presentation. To omit those, append a `--nocontrols`
flag to your command.

```
cleaver --file=examples/basic.json --nocontrols
```

## Header Information

**name**: A string representing the name of the document. Cleaver will
Expand Down
3 changes: 2 additions & 1 deletion lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ exports.render = function(json, options) {

fs.readFile('templates/layout.mustache', 'utf8', function(err, data) {
if (err) throw err;
var output = mustache.render(data, { slides: renders, title: json.name, styles: styles });

var output = mustache.render(data, { slides: renders, title: json.name, styles: styles, controls: !(options.nocontrols) });
if (options.debug) {
console.log(output);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cleaver",
"version": "0.0.3",
"version": "0.0.4",
"description": "plug-n-play HTML slideshows",
"author": "Jordan Scales",
"keywords":[
Expand Down
32 changes: 18 additions & 14 deletions templates/layout.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
{{{.}}}
{{/slides}}
</div>
<div id="controls">
<div id="prev">&larr;</div>
<div id="next">&rarr;</div>
</div>
{{#controls}}
<div id="controls">
<div id="prev">&larr;</div>
<div id="next">&rarr;</div>
</div>
{{/controls}}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
Expand Down Expand Up @@ -62,17 +64,19 @@
});
// clicking the next box
$('#next').on('click', function(e) {
e.preventDefault();
go_forward();
});
{{#controls}}
// clicking the next box
$('#next').on('click', function(e) {
e.preventDefault();
go_forward();
});
// clicking the prev box
$('#prev').on('click', function(e) {
e.preventDefault();
go_back();
});
// clicking the prev box
$('#prev').on('click', function(e) {
e.preventDefault();
go_back();
});
{{/controls}}
});
</script>
</body>
Expand Down

0 comments on commit 63de3c9

Please sign in to comment.