Skip to content

Commit

Permalink
parser.js: introduce disableIncrementalSlides option
Browse files Browse the repository at this point in the history
If disableIncrementalSlides is set to true, all incremental slides are
flattened out into single slides containing the entire content. Very
useful for printouts.

Signed-off-by: Joel Porquet <joel@porquet.org>
  • Loading branch information
joel-porquet committed Dec 14, 2017
1 parent a74e72a commit 40e69d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/remark/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ Parser.prototype.parse = function (src, macros, options) {
stack.pop();
break;
case 'separator':
// Just continue on the same slide if incremental slides are disabled
if (token.text === '--' && options.disableIncrementalSlides === true) {
// If it happens that there was a note section right before, just get
// rid of it
if (stack[0].notes !== undefined)
delete(stack[0].notes);
break;
}
// Slide separator (--- or --), so add current slide to list of
// slides and re-initialize stack with new, blank slide.
slides.push(stack[0]);
Expand Down

0 comments on commit 40e69d2

Please sign in to comment.