X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Foutput%2FBasicOutput.java;h=9b53859a199c05aa7742b8cd259a310230f5167d;hb=a7d266e6616349169d03e93780fb656754089dd0;hp=2e77eaebdc6d13de7d24bd42e19061b28131bc41;hpb=08fe2e33007063e30fe22dc1d290f8afaa18eb1d;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/output/BasicOutput.java b/src/be/nikiroo/fanfix/output/BasicOutput.java index 2e77eae..9b53859 100644 --- a/src/be/nikiroo/fanfix/output/BasicOutput.java +++ b/src/be/nikiroo/fanfix/output/BasicOutput.java @@ -36,7 +36,12 @@ public abstract class BasicOutput { /** ZIP with (PNG) images */ CBZ, /** LaTeX file with "book" template */ - LATEX; + LATEX, + /** HTML files in a dedicated directory */ + HTML, + + ; + public String toString() { return super.toString().toLowerCase(); } @@ -58,6 +63,20 @@ public abstract class BasicOutput { return desc; } + /** + * The default extension to add to the output files. + * + * @return the extension + */ + public String getDefaultExtension() { + BasicOutput output = BasicOutput.getOutput(this, false); + if (output != null) { + return output.getDefaultExtension(); + } + + return null; + } + /** * Call {@link OutputType#valueOf(String.toUpperCase())}. * @@ -208,12 +227,10 @@ public abstract class BasicOutput { /** * The default extension to add to the output files. - *

- * Cannot be NULL! * * @return the extension */ - protected String getDefaultExtension() { + public String getDefaultExtension() { return ""; } @@ -240,6 +257,10 @@ public abstract class BasicOutput { String paragraphNumber = String.format("%04d", 0); imageName = paragraphNumber + "_" + chapterNameNum + ".png"; + if (story.getMeta() != null) { + story.getMeta().setType("" + getType()); + } + if (writeCover) { InfoCover.writeCover(targetDir, targetName, story.getMeta()); } @@ -419,6 +440,8 @@ public abstract class BasicOutput { return new Cbz().setType(type, infoCover, infoCover); case LATEX: return new LaTeX().setType(type, infoCover, infoCover); + case HTML: + return new Html().setType(type, false, false); } }