public class Converter extends Object
Modifier and Type | Field and Description |
---|---|
private boolean |
debugMarkupOutput
if true debug markup will be generated including latex, mathml + html
Does not affect logging in any way
|
private boolean |
exportMarkup
if this flag is true, the resulting html + css
will be saved to an extra folder
|
private static String |
FILE_EXTENSION |
private String |
filename
the filename of the result file, if it already exists, a number will automatically be added to this string
|
private FormulaConverter |
formulaConverter |
private HtmlToMobiConverter |
htmlToMobiConverter |
private List<Path> |
inputPaths
ArrayList of input paths, only the first gets read
|
private LatexToHtmlConverter |
latexToHtmlConverter |
private static org.apache.log4j.Logger |
logger |
private static String |
MAIN_CSS_FILENAME |
private boolean |
noMobiConversion
if this flag is true, the converter will stop after generating the
html markup without generating the mobi result file
and this will force exportMarkup to be always true!
|
private Path |
outputPath
the directory path where the result will be written to
|
private boolean |
replaceWithPictures
if true, the formulas will get replaced with png pictures
else the will be represented with html
|
private String |
title
The eBook's title (i.e. for the Kindle device library),
does not affect the filename!
|
private Path |
workingDirectory |
Constructor and Description |
---|
Converter() |
Modifier and Type | Method and Description |
---|---|
Path |
convert()
Converts a single input file from LaTeX to Mobi
|
private Path |
exportMarkup(Path tempFilepath)
This will save the HTML markup + css file to a specified folder
|
String |
getFilename() |
FormulaConverter |
getFormulaConverter() |
HtmlToMobiConverter |
getHtmlToMobiConverter() |
List<Path> |
getInputPaths() |
LatexToHtmlConverter |
getLatexToHtmlConverter() |
Path |
getOutputPath() |
String |
getTitle() |
Path |
getWorkingDirectory() |
boolean |
isDebugMarkupOutput() |
boolean |
isExportMarkup() |
boolean |
isNoMobiConversion() |
boolean |
isReplaceWithPictures() |
private File |
saveHtmlFile(org.jdom2.Document document)
Saves the html document to a file with .html extension
|
void |
setDebugMarkupOutput(boolean debugMarkupOutput) |
void |
setExportMarkup(boolean exportMarkup) |
void |
setFilename(String filename) |
void |
setFormulaConverter(FormulaConverter formulaConverter) |
void |
setHtmlToMobiConverter(HtmlToMobiConverter htmlToMobiConverter) |
void |
setInputPaths(List<Path> inputPaths) |
void |
setLatexToHtmlConverter(LatexToHtmlConverter latexToHtmlConverter) |
void |
setNoMobiConversion(boolean noMobiConversion) |
void |
setOutputPath(Path outputPath) |
void |
setReplaceWithPictures(boolean replaceWithPictures) |
void |
setTitle(String title) |
void |
setWorkingDirectory(Path workingDirectory) |
private static final org.apache.log4j.Logger logger
private static final String MAIN_CSS_FILENAME
private static final String FILE_EXTENSION
private LatexToHtmlConverter latexToHtmlConverter
private HtmlToMobiConverter htmlToMobiConverter
private FormulaConverter formulaConverter
private Path workingDirectory
private boolean replaceWithPictures
private boolean debugMarkupOutput
private boolean exportMarkup
private boolean noMobiConversion
private Path outputPath
private String filename
private String title
public Path getWorkingDirectory()
public void setWorkingDirectory(Path workingDirectory)
public LatexToHtmlConverter getLatexToHtmlConverter()
public void setLatexToHtmlConverter(LatexToHtmlConverter latexToHtmlConverter)
public HtmlToMobiConverter getHtmlToMobiConverter()
public void setHtmlToMobiConverter(HtmlToMobiConverter htmlToMobiConverter)
public FormulaConverter getFormulaConverter()
public void setFormulaConverter(FormulaConverter formulaConverter)
public boolean isExportMarkup()
public void setExportMarkup(boolean exportMarkup)
public String getTitle()
public void setTitle(String title)
public boolean isReplaceWithPictures()
public void setReplaceWithPictures(boolean replaceWithPictures)
public boolean isDebugMarkupOutput()
public void setDebugMarkupOutput(boolean debugMarkupOutput)
public Path getOutputPath()
public void setOutputPath(Path outputPath)
public String getFilename()
public void setFilename(String filename)
public boolean isNoMobiConversion()
public void setNoMobiConversion(boolean noMobiConversion)
public Path convert() throws FileNotFoundException
FileNotFoundException
- when there's no file at the inputPath locationprivate File saveHtmlFile(org.jdom2.Document document)
document
- JDOM Document representing the HTMLCopyright © 2015 Vienna University of Technology. All rights reserved.