Added print-frags setting support.

This commit is contained in:
David Russell 2018-06-30 10:48:08 +07:00
parent 19cf18816e
commit 67b9e7d090
2 changed files with 13 additions and 2 deletions

View File

@ -26,6 +26,7 @@ package com.gitpitch.services;
import com.gitpitch.models.MarkdownModel;
import com.gitpitch.executors.BackEndThreads;
import com.gitpitch.utils.PitchParams;
import com.gitpitch.utils.YAMLOptions;
import com.gitpitch.policies.Runtime;
import play.Logger;
@ -152,6 +153,12 @@ public class PrintService {
diskService.delete(pp, pp.PDF());
String filePath = diskService.asFile(pp, pp.PDF()).toString();
boolean printFrags = false;
try {
printFrags =
YAMLOptions.build(pp, null, diskService).printFrags(pp);
} catch(Exception ex) {}
String slideshowUrl =
com.gitpitch.controllers.routes.PitchController.slideshow(pp.user,
pp.repo,
@ -161,7 +168,7 @@ public class PrintService {
pp.pitchme,
pp.notes,
null,
PRINT_NO_FRAGS,
Boolean.toString(printFrags),
null)
.absoluteURL(isEncrypted(),
hostname());
@ -193,7 +200,6 @@ public class PrintService {
private static final String REVEAL = "reveal";
private static final String PITCHME_PDF = "PITCHME.pdf";
private static final String PRINT_NO_FRAGS = "false";
private static final String GIT_PDF = "pdf";
private static final int STATUS_OK = 0;

View File

@ -367,6 +367,10 @@ public final class YAMLOptions {
return fetchBooleanOption(pp, PUBLISHED_OPTION);
}
public Boolean printFrags(PitchParams pp) {
return fetchBooleanOption(pp, PRINT_FRAGS_OPTIONS);
}
private Boolean fetchBooleanOption(PitchParams pp, String option) {
return fetchBooleanOption(pp, option, false);
}
@ -460,6 +464,7 @@ public final class YAMLOptions {
private static final String SLIDE_NUMBER_OPTION = "slide-number";
private static final String REVEALJS_VERSION = "revealjs-version";
private static final String PUBLISHED_OPTION = "published";
private static final String PRINT_FRAGS_OPTIONS = "print-frags";
private static final String HSLIDE_DELIM = "horz-delim";
private static final String VSLIDE_DELIM = "vert-delim";