/** 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();
}
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())}.
*
/**
* Call {@link OutputType#valueOf(String.toUpperCase())} but return NULL
- * for NULL instead of raising exception.
+ * for NULL and empty instead of raising an exception.
*
* @param typeName
* the possible type name
* @return NULL or the type
*/
public static OutputType valueOfNullOkUC(String typeName) {
- if (typeName == null) {
+ if (typeName == null || typeName.isEmpty()) {
return null;
}
/**
* The default extension to add to the output files.
- * <p>
- * Cannot be NULL!
*
* @return the extension
*/
- protected String getDefaultExtension() {
+ public String getDefaultExtension() {
return "";
}
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());
}
return new Cbz().setType(type, infoCover, infoCover);
case LATEX:
return new LaTeX().setType(type, infoCover, infoCover);
+ case HTML:
+ return new Html().setType(type, infoCover, infoCover);
}
}