70 parser.
setExampleLongOption(
"phoenix_tex2html --input=fileInput.tex --output=\"output/Directory\"");
76 parser.
addOption(
"bibliography",
"b", bibliographyFile,
"input bibliography file");
78 parser.
addOption(
"includedirs",
"I", includeDir,
"list of include directories");
81 parser.
addOption(
"style",
"s", defaultStyle,
"set the default style to be used (base, dark)");
83 parser.
addOption(
"workinprogress",
"w",
OptionType::NONE,
false,
"propagates the Work In Progress in the titles of corresponding parts, to make them visible and see what is ongoing in an easier way");
85 parser.
addOption(
"remotemathjax",
"r",
OptionType::NONE,
false,
"enable the MathJax backend, with remote install, instead of the Latex one");
87 parser.
addOption(
"tex",
"t",
OptionType::NONE,
false,
"enable the latex backend. All input will be converted into latex files");
91 parser.
addOption(
"prefix",
"p", installPrefix,
"Installation prefix directory (/usr or /local/usr to get shared files");
93 parser.
addOption(
"theme",
"a", defaultTheme,
"base theme to be used as canevas to all generated web pages");
107 if(fileinput ==
"")
return 0;
110 parser.setDebugMode(
true);
111 bool isBibliography(inputBibliography !=
"");
115 std::cerr <<
"processAllFile : can't parse the bibliography file '"<<inputBibliography<<
"'" << std::endl;
118 std::cout <<
"Find " << mapBibio.size() <<
" entries in the bibliography" << std::endl;
121 for(PVecString::const_iterator it(listInclude.begin()); it != listInclude.end(); ++it){
122 parser.getVecIncludeDir().push_back(*it);
124 if(!parser.saveCss()){
125 std::cerr <<
"processAllFile : can't save css file" << std::endl;
128 if(!parser.load(fileinput)){
129 std::cerr <<
"processAllFile : can't load file '"<<fileinput<<
"'" << std::endl;
167 std::cout <<
"processAllFile : book mode enabled" << std::endl;
173 outputMode.
bookMail = parser.getBookMail();
180 std::cerr <<
"processAllFile : can't save bibliography" << std::endl;
186 orderLatex.
setLink(
"index.tex");
188 std::cerr <<
"processAllFile : can't save file in latex" << std::endl;
194 std::cerr <<
"processAllFile : can't files 'save html'" << std::endl;
199 std::cerr <<
"processAllFile : can't save file 'outline.html'" << std::endl;
208 int main(
int argc,
char** argv){
214 defaultMode.
getValue(inputFile,
"input");
217 defaultMode.
getValue(inputBibliography,
"bibliography");
220 defaultMode.
getValue(listInclude,
"includedirs");
240 if(fileExtention ==
"md"){
241 return processAllFile<PMarkdownParser>(inputFile, inputBibliography, listInclude, arg);
242 }
else if(fileExtention ==
"tex" || fileExtention ==
"ptex"){
243 return processAllFile<PConfigParser>(inputFile, inputBibliography, listInclude, arg);
245 std::cerr <<
"phoenix_tex2html : Unknow file extention '"<<fileExtention<<
"' of input file '"<<inputFile<<
"'" << std::endl;
std::vector< PString > PVecString
int main(int argc, char **argv)
OptionParser createOptionParser()
Create the OptionParser of this program.
void defaultParsedArg(ParsedArg &arg)
Init default values in the ParsedArg.
int processAllFile(const PPath &fileinput, const PPath &inputBibliography, const PVecString &listInclude, const ParsedArg &arg)
Process all the input files.
Describe a mode in the program arguments.
bool isOptionExist(const PString &optionName) const
Say if the given option has been passed to the program.
bool getValue(T &value, const PString &optionName) const
Get the value of the option.
Parse the options passed to a program.
void parseArgument(int argc, char **argv)
Parse the arguments passed to the program.
void addOption(const PString &longOption, const PString &shortOption, OptionType::OptionType optionType, bool isRequired, const PString &docString)
Add an option in the OptionParser.
void setExampleShortOption(const PString &example)
Set the example usage of the program.
void setExampleLongOption(const PString &example)
Set the example usage of the program.
const OptionMode & getDefaultMode() const
Get default mode.
void setLink(const PString &link)
Sets the link of the PLatexObj.
Path of a directory or a file.
PString getExtension() const
Get file extension.
static PPath getProgramPrefix()
Get the program prefix (installation directory without /bin)
bool createOutlineHtml(POutoutMode &outputMode, const PLatexObj &obj, bool isBibliography)
Create the outline.
PString pbiblio_html(const PMapBiblioEntry &mapBiblioEntry, const POutoutMode &outputMode)
Save the bibliography in string.
bool pbliblio_file(PMapBiblioEntry &mapBiblioEntry, const PPath &fileName)
Parse the full bibliography file.
std::map< PString, PBiblioEntry > PMapBiblioEntry
Describes the map for all PBiblioEntry.
bool platexobj_html(POutoutMode &outputMode, const PLatexObj &obj, bool isBibliography=false, const PString &baseInstallPrefix="")
PLatexObj platexobj_order(PLatexObj &obj)
Order the PLatexObj in part,chapter,section,subsection,subsubsection.
bool platexobj_tex(POutputTex &outputMode, const PLatexObj &obj)
Save the main PLatexObj.
POutputTex defaultPOutputTex()
Create a default POutputTex.
void platexobj_updateLink(PLatexObj &obj, const PPath &htmlFile)
Update the html link.
void platexobj_updateFileName(PLatexObj &obj)
Update the fileName of the PLatexObj part,chapter,section,subsection,subsubsection.
void platexobj_updateId(PLatexObj &obj, long unsigned int &id)
Update the id of the PLatexObj.
void platexobj_updateNumber(PLatexObj &obj, PVecNumber &vecNumber)
Update the vector number of the PLatexObj.
Output mode of the html backend.
bool isEnableBookFeedback
True to enable feedback in book mode.
bool isMathJaxMode
True to use the MathJax backend, false to use the latex backend.
PFullMenu fullMenu
Full menu for book theme.
PString bookGitlabUrl
Gitlab url of the current sources of the project.
PMapFormula mapFormula
Map of the formula which are already saved as png files.
bool isBookTheme
True to activate the book theme.
PString bookMasterProjectUrl
Master project url in book mode.
PString bookMail
Mail to be used to contact authors in book mode.
bool isBibliography
True if the generated web site has a bibliography, false otherwise.
PString bookSideBarWidth
Witdh of the book side bar.
bool isRemoteMathjax
True to activate mathjax but in remote mode (so no need to have mathjax in the generated site)
PString currentStyle
Current style to be used for the generated pages of the site.
Output mode for tex backend.
Parsed arguments passed to the program.
bool isWorkInProgress
True to propagate the Work In Progress in the titles of corresponding parts, to make them visible and...
PString themeFile
File which describes the theme of the web site.
bool useRemoteMathjax
True to use remote install of mathjax.
PString styleCss
Style to be used as the default css style.
bool isBookTheme
True to enable book theme.
bool useMathJax
True to use the MathJax backend, false to use the latex backend.
PString installPrefix
Installation prefix directory to get the program ressources (/usr or /local/usr)
bool isLatexBackEnd
True to activate the latex backend.
void updateLabelCitation(PLatexObj &obj, const PMapBiblioEntry &mapBiblioEntry)
Update the label of the references.
void updateLabelRef(PLatexObj &obj)
Update the label of the references.
void updateNextPrev(POutoutMode &outputMode, PLatexObj &obj, PLatexObj *&lastSec)
Update the next and previous section for the menu.
void updateParent(POutoutMode &outputMode, PLatexObj &obj, const PLatexMenu &parentMenu)
Update the parent of the sections.
void update_firstCss(PString &firstCss, const PLatexObj &source)
Update the firstCss style to be used.
void updateNewLine(PLatexObj &obj)
Update the new lines to ensure there are new two following.
void updateWip(PLatexObj &obj)
Update the Part/Chapter/Section/etc if they contains a work in progress.