Skip to content

Commit

Permalink
removed agenda slide functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
jdan committed Feb 3, 2014
1 parent 57f469f commit ade2655
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 48 deletions.
7 changes: 0 additions & 7 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ Displays a small progress bar at the top of your document.

**Default**: true

### agenda

Inserts an agenda (table of contents) slide at the beginning of your
presentation, based on the titles of your individual slides.

**Default**: false

### encoding

Content encoding to use on the rendered document.
Expand Down
36 changes: 1 addition & 35 deletions lib/cleaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function Cleaver(file) {
this.templates = {
layout: 'templates/layout.mustache',
author: 'templates/author.mustache',
agenda: 'templates/agenda.mustache',
slides: 'templates/default.mustache'
};

Expand Down Expand Up @@ -79,12 +78,8 @@ Cleaver.prototype.renderSlides = function () {
!this.metadata.author.twitter.match(/^@/)) {
this.metadata.author.twitter = '@' + this.metadata.author.twitter;
}
this.slides.push(this.renderAuthorSlide(this.metadata.author));
}

// insert an agenda slide (if necessary) as our second slide
if (this.metadata.agenda) {
this.slides.splice(1, 0, this.renderAgendaSlide(slices));
this.slides.push(this.renderAuthorSlide(this.metadata.author));
}

return Q.resolve(true);
Expand Down Expand Up @@ -223,35 +218,6 @@ Cleaver.prototype.renderAuthorSlide = function (content) {
};


/**
* Renders the agenda slide.
*
* @param {string} slices The set of slices that had been loaded from the input file
* @return {string} The formatted agenda slide
*/
Cleaver.prototype.renderAgendaSlide = function (slices) {
var titles = [];
var firstLine, lastTitle, matches;

for (var i = 1; i < slices.length; i++) {
firstLine = slices[i].split(/(\n|\r)+/)[0];
matches = /^(#{3,})\s+(.+)$/.exec(firstLine);

// Only index non-title slides (begins with 3 ###)
if (!matches) {
continue;
}

if (lastTitle !== matches[2]) {
lastTitle = matches[2];
titles.push(lastTitle);
}
}

return mustache.render(this.templates.loaded.agenda, titles);
};


/**
* Returns a chopped up document that's easy to parse.
*
Expand Down
6 changes: 0 additions & 6 deletions templates/agenda.mustache

This file was deleted.

0 comments on commit ade2655

Please sign in to comment.