mirror of
https://github.com/gitpitch/gitpitch.git
synced 2024-04-18 07:30:55 +08:00
Added print-frags setting support.
This commit is contained in:
parent
19cf18816e
commit
67b9e7d090
|
@ -26,6 +26,7 @@ package com.gitpitch.services;
|
||||||
import com.gitpitch.models.MarkdownModel;
|
import com.gitpitch.models.MarkdownModel;
|
||||||
import com.gitpitch.executors.BackEndThreads;
|
import com.gitpitch.executors.BackEndThreads;
|
||||||
import com.gitpitch.utils.PitchParams;
|
import com.gitpitch.utils.PitchParams;
|
||||||
|
import com.gitpitch.utils.YAMLOptions;
|
||||||
import com.gitpitch.policies.Runtime;
|
import com.gitpitch.policies.Runtime;
|
||||||
import play.Logger;
|
import play.Logger;
|
||||||
|
|
||||||
|
@ -152,6 +153,12 @@ public class PrintService {
|
||||||
diskService.delete(pp, pp.PDF());
|
diskService.delete(pp, pp.PDF());
|
||||||
String filePath = diskService.asFile(pp, pp.PDF()).toString();
|
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 =
|
String slideshowUrl =
|
||||||
com.gitpitch.controllers.routes.PitchController.slideshow(pp.user,
|
com.gitpitch.controllers.routes.PitchController.slideshow(pp.user,
|
||||||
pp.repo,
|
pp.repo,
|
||||||
|
@ -161,7 +168,7 @@ public class PrintService {
|
||||||
pp.pitchme,
|
pp.pitchme,
|
||||||
pp.notes,
|
pp.notes,
|
||||||
null,
|
null,
|
||||||
PRINT_NO_FRAGS,
|
Boolean.toString(printFrags),
|
||||||
null)
|
null)
|
||||||
.absoluteURL(isEncrypted(),
|
.absoluteURL(isEncrypted(),
|
||||||
hostname());
|
hostname());
|
||||||
|
@ -193,7 +200,6 @@ public class PrintService {
|
||||||
|
|
||||||
private static final String REVEAL = "reveal";
|
private static final String REVEAL = "reveal";
|
||||||
private static final String PITCHME_PDF = "PITCHME.pdf";
|
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 String GIT_PDF = "pdf";
|
||||||
private static final int STATUS_OK = 0;
|
private static final int STATUS_OK = 0;
|
||||||
|
|
||||||
|
|
|
@ -367,6 +367,10 @@ public final class YAMLOptions {
|
||||||
return fetchBooleanOption(pp, PUBLISHED_OPTION);
|
return fetchBooleanOption(pp, PUBLISHED_OPTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean printFrags(PitchParams pp) {
|
||||||
|
return fetchBooleanOption(pp, PRINT_FRAGS_OPTIONS);
|
||||||
|
}
|
||||||
|
|
||||||
private Boolean fetchBooleanOption(PitchParams pp, String option) {
|
private Boolean fetchBooleanOption(PitchParams pp, String option) {
|
||||||
return fetchBooleanOption(pp, option, false);
|
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 SLIDE_NUMBER_OPTION = "slide-number";
|
||||||
private static final String REVEALJS_VERSION = "revealjs-version";
|
private static final String REVEALJS_VERSION = "revealjs-version";
|
||||||
private static final String PUBLISHED_OPTION = "published";
|
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 HSLIDE_DELIM = "horz-delim";
|
||||||
private static final String VSLIDE_DELIM = "vert-delim";
|
private static final String VSLIDE_DELIM = "vert-delim";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user