Comparing version 0.2.5 to 0.3.0
@@ -82,2 +82,10 @@ var fs = require('fs'); | ||
// maybe load an external layout | ||
if (self.metadata.layout) { | ||
promises.push(helper.loadSingle(self.metadata.layout) | ||
.then(function (data) { | ||
self.templates.loaded.layout = data; | ||
})); | ||
} | ||
return Q.all(promises); | ||
@@ -105,2 +113,3 @@ }); | ||
var putControls = this.metadata.controls || (this.metadata.controls === undefined); | ||
var putProgress = this.metadata.progress || (this.metadata.progress === undefined); | ||
@@ -111,2 +120,3 @@ // Render the slides in a template (maybe as specified by the user) | ||
controls: putControls, | ||
progress: putProgress, | ||
// TODO: uglify navigation.js? | ||
@@ -113,0 +123,0 @@ navigation: this.resources.loaded.navigation |
{ | ||
"name": "cleaver", | ||
"preferGlobal": true, | ||
"version": "0.2.5", | ||
"version": "0.3.0", | ||
"author": "Jordan Scales <scalesjordan@gmail.com>", | ||
@@ -6,0 +6,0 @@ "description": "30-second slideshows for hackers", |
@@ -42,3 +42,3 @@ # Cleaver | ||
![output](https://i.cloudup.com/hHBVUtbREK.gif) | ||
![output](https://i.cloudup.com/cIssKFjcB6.gif) | ||
@@ -84,2 +84,4 @@ ## Quick Start | ||
**Ordinary Users** | ||
* **title**: The title of the slideshow | ||
@@ -95,9 +97,16 @@ * **author** | ||
* **encoding**: A specified content encoding (default: *utf-8*) | ||
* **template**: An absolute path specifying a template in which to render the slides (default: | ||
*default.css*) | ||
* **progress*: Option whether or not to display a small progress bar at the top of the page | ||
(default: *true*) | ||
**Power Users** | ||
* **template**: Location of the template used to render the slides (default: | ||
*default.mustache*) | ||
* **layout**: Location of the layout template used to render everything (default: | ||
*layout.mustache*) | ||
If author is included, the following slide will be automatically inserted | ||
at the end of your presentation: | ||
![author slide](https://i.cloudup.com/YxgwvqVZNg-1200x1200.png) | ||
![author slide](https://i.cloudup.com/f0zVsUwqF0-3000x3000.png) | ||
@@ -142,2 +151,8 @@ ### Title slide | ||
```html | ||
{{#progress}} | ||
<div class="progress"> | ||
<div class="progress-bar"></div> | ||
</div> | ||
{{/progress}} | ||
<div id="wrapper"> | ||
@@ -149,5 +164,5 @@ {{#slides}} | ||
{{#controls}} | ||
<div id="controls"> | ||
<div id="prev">←</div> | ||
<div id="next">→</div> | ||
<div class="controls"> | ||
<div class="arrow prev"></div> | ||
<div class="arrow next"></div> | ||
</div> | ||
@@ -161,4 +176,4 @@ {{/controls}} | ||
Power users may wish to render into custom templates. To do so, simply copy the following file | ||
and specify a template (with an absolute path) like so: | ||
Power users may wish to render into custom templates. To do so, simply copy the above file | ||
somewhere, make some changes, and specify the template like so: | ||
@@ -168,5 +183,9 @@ ```yaml | ||
output: basic.html | ||
template: /Users/jordan/Slides/example/example.mustache | ||
template: example.mustache | ||
``` | ||
You can also replace the entire layout (`<head>` tags and all) with the `layout` option. Use | ||
[layout.mustache](https://github.com/jdan/cleaver/blob/master/templates/layout.mustache) as | ||
an example to note what fields you should include in your custom layout. | ||
### Contributing | ||
@@ -173,0 +192,0 @@ |
@@ -14,2 +14,3 @@ /** | ||
setCurrentProgress(); | ||
updateURL(); | ||
@@ -31,2 +32,3 @@ } | ||
setCurrentProgress(); | ||
updateURL(); | ||
@@ -71,2 +73,17 @@ } | ||
/** | ||
* Set the current progress indicator. | ||
*/ | ||
function setCurrentProgress() { | ||
var wrapper = document.querySelector('#wrapper'); | ||
var progressBar = document.querySelector('.progress-bar'); | ||
if (progressBar !== null) { | ||
var pagesNumber = wrapper.querySelectorAll('section').length; | ||
var currentNumber = parseInt(currentPage()); | ||
var currentPercent = pagesNumber === 1 ? 100 : 100 * currentNumber / (pagesNumber - 1); | ||
progressBar.style.width = currentPercent.toString() + '%'; | ||
} | ||
} | ||
/** | ||
* Go to the specified page of content. | ||
@@ -109,4 +126,4 @@ */ | ||
if (document.querySelector('#next') && document.querySelector('#prev')) { | ||
document.querySelector('#next').onclick = function (e) { | ||
if (document.querySelector('.next') && document.querySelector('.prev')) { | ||
document.querySelector('.next').onclick = function (e) { | ||
e.preventDefault(); | ||
@@ -116,3 +133,3 @@ goForward(); | ||
document.querySelector('#prev').onclick = function (e) { | ||
document.querySelector('.prev').onclick = function (e) { | ||
e.preventDefault(); | ||
@@ -119,0 +136,0 @@ goBack(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21183
467
198
16