PhoenixLecture  2.0.0
Set of tools to make lectures
platexobj_html.cpp
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #include <sys/stat.h>
8 #include <sys/types.h>
9 
10 #include "phoenix_env.h"
11 #include "phoenix_system.h"
12 #include "convertToString.h"
13 #include "parser_utils.h"
14 #include "platexobj_text.h"
15 #include "platexobj_rawtext.h"
16 
17 #include "platexobj_html_book.h"
18 
19 #include "platexobj_html.h"
20 
22 
26  if(labelName == ""){return "";}
27  PString body("<span class=\"redirectIcon\"><a href=\"redirect.html?label="+labelName+"\"><img src=\"images/iconlink_32.png\"></a></span>");
28 
29  return body;
30 }
31 
33 
40 PString platexobj_createTitle(const PLatexObj & obj, const PString & baliseName, const PString & cssClassName,
41  const PString objTitle, const PString & prefixTitle, bool addLinkLabel)
42 {
43  PString body("");
44  body += "\t\t<"+baliseName+" id=\""+valueToString(obj.getId())+"\" class=\""+cssClassName+"\">";
45  if(prefixTitle != ""){
46  body += prefixTitle + " ";
47  }
48  body += vecNumberToString(obj.getVecSecNumber());
49 
50  body += " : "+objTitle;
51  if(addLinkLabel){
53  }
54  body += "</"+baliseName+">\n";
55  return body;
56 }
57 
59 
63  return convertStrToHtml(obj.getText());
64 }
65 
67 
71  return obj.getText();
72 }
73 
75 
79  PString body("");
80  body += "<a id=\""+valueToString(obj.getId())+"\" href=\"" + obj.getName() + "\">" + obj.getName() + "</a>";
81  return body;
82 }
83 
85 
89  PString body("");
90  body += phoenix_getenv(obj.getName());
91  return body;
92 }
93 
95 
100  outputMode.currentStyle = obj.getName();
101  return "";
102 }
103 
105 
109  PString body("");
110 // const PString & linkObj = obj.getLink();
111 // replaceCharInStr(getSecNumberFromFileName(linkObj), '-', '.')
112  body += "<a href=\"" + obj.getLink() + "\">";
113  if(obj.getVecContent().size() != 0lu){
114  body += platexobj_text(obj.getVecContent());
115  }else{
116  PString textLink = obj.getName();
117  body += textLink;
118  }
119  body += "</a>";
120  return body;
121 }
122 
124 
128  PString body("");
129  body += "<br />\n";
130  return body;
131 }
132 
134 
138  PString body("");
139  body += "<br /><br />\n";
140  return body;
141 }
142 
144 
148  PString body("");
149 // body += "<b>Citation of "+obj.getName()+"</b>";
150  body += "<a class=\"biblio\" href=\"" + obj.getLink() + "\">";
151  body += "[" + obj.getText() + "]"; //Put the Id of the citation in the bibliography
152  body += "<span class=\"bibliospan\">"; //The hidden content which is revealed on hover
153  body += obj.getName(); //Title of the reference
154  if(obj.getDate() != ""){
155  body += ", "+ obj.getDate(); //Year of the reference
156  }
157  if(obj.getAuthor() != ""){
158  body += ", "+ obj.getAuthor(); //Author of the reference
159  }
160  body += "</span>";
161  body += "</a>";
162 
163 // body += "<a href=\"" + obj.getLink() + "\">" + replaceCharInStr(getSecNumberFromFileName(obj.getLink()), '-', '.') + "</a>";
164  return body;
165 }
166 
168 
173  PString body("");
174  body += "<a id=\""+valueToString(obj.getId())+"\" href=\"" + obj.getName() + "\">";
175  body += platexobj_htmlStr(outputMode, obj.getVecContent());
176  body += "</a>";
177  return body;
178 }
179 
181 
185  PString body("");
186  body += "<b>" + obj.getName() + "</b>";
187  return body;
188 }
189 
191 
195  PString body("");
196  body += "<em id=\""+valueToString(obj.getId())+"\">" + obj.getName() + "</em>";
197  return body;
198 }
199 
201 
205  PString body("");
206  body += "<span class=\"debug\" id=\""+valueToString(obj.getId())+"\">" + obj.getName() + "</span>";
207  return body;
208 }
209 
211 
216  PString body("");
217 // body += "<sup class=\"footnote\" id=\""+valueToString(obj.getId())+"\">" + obj.getName() + "</sup>";
218 
219  body += "<sup class=\"footnote\" id=\""+valueToString(obj.getId())+"\">";
220 
221  body += "<a href=\"#\">";
222  body += "note";
223  body += "<span class=\"footnotespan\">";
224 // body += obj.getName(); //Content of the footnote
225  body += platexobj_htmlStr(outputMode, obj.getVecContent()); //Content of the footnote
226  body += "</span>";
227  body += "</a>";
228  body += "</sup>";
229  return body;
230 }
231 
233 
238  PString body("");
239  body += "\n<p id=\""+valueToString(obj.getId())+"\">" + platexobj_createLabelSearchLink(obj.getLabelName()) + platexobj_htmlStr(outputMode, obj.getVecContent()) + "</p>\n";
240  return body;
241 }
242 
244 
249  PString body("");
250  body += "\n<table id=\""+valueToString(obj.getId())+"\" class=\"workinprogress\">\n";
251  body += "\t<tr><td class=\"workinprogressimage\"><img src=\"images/wip.png\" alt=\"wip\" /></td></tr>\n";
252 
253  body += "\t<tr><td class=\"workinprogresscontent\">" + platexobj_htmlStr(outputMode, obj.getVecContent()) + "</td></tr>\n";
254  body += "</table>\n";
255  return body;
256 }
257 
259 
264  PString body("");
265  body += "\n<summary id=\""+valueToString(obj.getId())+"\" class=\"summary\">\n";
266  body += platexobj_htmlStr(outputMode, obj.getVecContent());
267  body += "</summary>\n";
268  return body;
269 }
270 
272 
277  PString body("");
278  body += "\n<details id=\""+valueToString(obj.getId())+"\" class=\"details\"><br />\n";
279  body += platexobj_htmlStr(outputMode, obj.getVecContent());
280  body += "</details>\n";
281  return body;
282 }
283 
284 
286 
291  PString body("");
292  body += "\n<div id=\""+valueToString(obj.getId())+"\" class=\"quote\"><br />\n";
293  body += platexobj_htmlStr(outputMode, obj.getVecContent());
294  body += "</div>\n";
295  return body;
296 }
297 
299 
304  PString body("");
305  PString baseContent(obj.getName());
306  PPath fileName(baseContent);
307  if(fileName != ""){
308  if(fileName[0] != '/'){
309  fileName = PPath(obj.getText()).getParentDirectory() / fileName;
310  }
311  if(!fileName.isFileExist()){
312  fileName = PPath(LATEX_IMAGE_OUTPUT_DIR "/call_" + valueToString(obj.getId()) + ".dot");
313  fileName.saveFileContent(baseContent.eraseFirstLastChar("\n") + "\n");
314  }
315  PString outputFileName(LATEX_IMAGE_OUTPUT_DIR "/call_" + valueToString(obj.getId()) + ".png");
316  phoenix_popen("dot -T png -o " + outputFileName + " " + fileName);
317 
318  body += "<img id=\""+valueToString(obj.getId())+"\" src=\"" + outputFileName + "\"";
319  body += " alt=\"nothing\" />" + platexobj_createLabelSearchLink(obj.getLabelName());
320  }
321  return body;
322 }
323 
325 
330  PString body("");
331  PPath fileName(obj.getName());
332  if(fileName != ""){
333  if(fileName[0] != '/'){
334  fileName = PPath(obj.getText()).getParentDirectory() / fileName;
335  }
336  PString outputFileName(PPath(LATEX_IMAGE_OUTPUT_DIR "/") + fileName.getFileName() + PPath("_") + valueToString(obj.getId()) + PPath(".png"));
337  phoenix_popen("convert " + PString(fileName) + " " + outputFileName);
338 
339  body += "<img id=\""+valueToString(obj.getId())+"\" src=\"" + outputFileName + "\"";
340  body += " alt=\"nothing\" />" + platexobj_createLabelSearchLink(obj.getLabelName());
341  }
342  return body;
343 }
344 
346 
352 PString platexobj_htmlStrAllPart(POutoutMode & outputMode, const PLatexObj & obj, const PString & hLevel, const PString & cssClassName){
353  PString body("");
354  if(cssClassName != ""){
355  body += "\t<"+hLevel+" id=\""+valueToString(obj.getId())+"\" class=\""+cssClassName+"\">" + getSectionTitle(outputMode, obj) + platexobj_createLabelSearchLink(obj.getLabelName())+"</"+hLevel+">\n";
356  }else{
357  body += "\t<"+hLevel+" id=\""+valueToString(obj.getId())+"\">" + getSectionTitle(outputMode, obj) + platexobj_createLabelSearchLink(obj.getLabelName())+"</"+hLevel+">\n";
358  }
359  return body;
360 }
361 
363 
368  PString body("");
369  body += "<"+obj.getBalise()+" id=\""+valueToString(obj.getId())+"\" class=\"" + obj.getName() + "Style\">";
370 
372 
373  body += "</"+obj.getBalise()+">\n";
374  return body;
375 }
376 
378 
383  PString body("");
384  body += "<"+obj.getBalise()+" id=\""+valueToString(obj.getId())+"\" class=\"" + obj.getName() + "Style\">";
385 
387 
388  body += "</"+obj.getBalise()+">";
389  return body;
390 }
391 
393 
397  PString body("");
398  if(obj.getNbline() != 0lu){
399  body += "<table id=\""+valueToString(obj.getId())+"\" class=\"code\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"colLineNumbers\">\n\t\t\t\t<pre class=\"lineNumbers\">";
400  for(long unsigned int i(0lu); i < obj.getNbline(); ++i){
401  body += valueToString(i + 1lu) + "\n";
402  }
403  body += "</pre>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<pre class=\"source\">\n";
404  body += obj.getText().eraseLastChar("\n");
405  body += "</pre>\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
406  }else{
407  body += "<span id=\""+valueToString(obj.getId())+"\">";
408  body += obj.getText().eraseLastChar("\n");
409  body += "</span>";
410  }
411  return body;
412 }
413 
415 
420  PString body("");
421  body += "<table id=\""+valueToString(obj.getId())+"\" class=\"timetableStyle\">\n";
422  body += platexobj_htmlStr(outputMode, obj.getVecContent());
423  body += "</table>"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
424  return body;
425 }
426 
428 
433  PString body("");
434  //We add a row in the timetable table
435  body += "\t<tr id=\""+valueToString(obj.getId())+"\" ><td class=\"timetableWeekRowStyle\">";
436  body += platexobj_rawtext(obj.getComplexTitle());
437  body += "</td></tr>\n";
438  body += "\t<tr class=\"timetableMainWeekRowStyle\"><td class=\"timetableMainWeekRowStyle\">\n";
439  //We we put the timetable of the current week
440  body += "\t\t<table id=\""+valueToString(obj.getId())+"\" class=\"timetableWeekStyle\">\n";
441  body += platexobj_htmlStr(outputMode, obj.getVecContent());
442  body += "\t\t</table>"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
443  body += "\t</td></tr>\n";
444  return body;
445 }
446 
448 
453  PString body("");
454  body += "\t\t\t<tr id=\""+valueToString(obj.getId())+"\" class=\"timetableTimeRow\">\n";
455  body += platexobj_htmlStr(outputMode, obj.getVecContent());
456  body += "\t\t\t</tr>\n";
457  return body;
458 }
459 
461 
466  PString body("");
467  //We add a day header in the timetable table
468  body += "\t\t\t\t<td id=\""+valueToString(obj.getId());
469  if(obj.getRowSpan() != 0lu){
470  body += " rowspan=\""+valueToString(obj.getRowSpan())+"\"";
471  }
472  if(obj.getColSpan() != 0lu){
473  body += " colspan=\""+valueToString(obj.getColSpan())+"\"";
474  }
475  body += "\" class=\"timetableDayStyle\">";
476  body += platexobj_rawtext(obj.getVecContent());
477  body += "</td>\n";
478  return body;
479 }
480 
482 
487  PString body("");
488  //We add a block in the timetable table
489  body += "\t\t\t\t<td id=\""+valueToString(obj.getId()) + "\"";
490  if(obj.getRowSpan() != 0lu){
491  body += " rowspan=\""+valueToString(obj.getRowSpan())+"\"";
492  }
493  if(obj.getColSpan() != 0lu){
494  body += " colspan=\""+valueToString(obj.getColSpan())+"\"";
495  }
496  PString blockStyle("timetableBlockStyle");
497  if(obj.getText() != ""){
498  blockStyle = obj.getText();
499  }
500  body += " class=\""+blockStyle+"\">";
501  body += platexobj_htmlStr(outputMode, obj.getVecContent());
502  body += "</td>\n";
503  return body;
504 }
505 
507 
512  PString body("");
513  //We add a block in the timetable table
514  body += "\t\t\t\t<td id=\""+valueToString(obj.getId()) + "\"";
515  if(obj.getRowSpan() != 0lu){
516  body += " rowspan=\""+valueToString(obj.getRowSpan())+"\"";
517  }
518  if(obj.getColSpan() != 0lu){
519  body += " colspan=\""+valueToString(obj.getColSpan())+"\"";
520  }
521  body += " class=\"timetableEmptyBlockStyle\"></td>\n";
522  return body;
523 }
525 
530  PString body("");
531  //We add a block in the timetable table
532  body += "\t\t\t\t<td id=\""+valueToString(obj.getId())+"\" class=\"timetableTimeStyle\"><span class=\"timetableTimeTextStyle\">";
533  body += obj.getText();
534  body += "</span></td>\n";
535  return body;
536 }
537 
539 
543  PString body("");
544  //We add a block in the timetable table
545  body += "<a id=\""+valueToString(obj.getId())+"\" href=\""+obj.getText()+"\"><div class=\"rendezvousStyle\"></div></a>";
546  return body;
547 }
548 
550 
557 PString platexobj_htmlStrBasicEnv(POutoutMode & outputMode, const PLatexObj & obj, const PString & baliseName, const PString & cssClassName, bool allowText){
558  PString body("");
559  body += "<"+baliseName + " id=\""+valueToString(obj.getId())+"\"";
560  if(cssClassName != ""){
561  body += " class=\""+cssClassName+"\"";
562  }
563  body += ">\n";
564  body += platexobj_htmlStr(outputMode, obj.getVecContent(), false, allowText);
565  body += "</"+baliseName+">"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
566  return body;
567 }
568 
570 
575  PString body("");
576  body += "<table id=\""+valueToString(obj.getId())+"\" class=\"tabularStyle\">\n";
577  body += platexobj_htmlStr(outputMode, obj.getVecContent());
578  body += "</table>"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
579  return body;
580 }
581 
583 
588  PString body("");
589  body += "\t<tr>\n";
590  body += platexobj_htmlStr(outputMode, obj.getVecContent());
591  body += "\t</tr>\n";
592  return body;
593 }
594 
596 
601  PString body("");
602  body += "\t\t<td>\n";
603  body += platexobj_htmlStr(outputMode, obj.getVecContent());
604  body += "\t\t</td>\n";
605  return body;
606 }
607 
609 
614  PString body("");
615  body += "<table id=\""+valueToString(obj.getId())+"\" class=\"columnsStyle\">\n";
616  body += "\t<tr>\n";
617  const PVecLatexObj & vecObj = obj.getVecContent();
618  for(PVecLatexObj::const_iterator it(vecObj.begin()); it != vecObj.end(); ++it){
619 // body += "\t\t<td>\n\t\t\t";
620  body += platexobj_htmlStr(outputMode, *it);
621 // body += "\n\t\t</td>\n";
622  }
623  body += "\t</tr>\n</table>\n";
624  return body;
625 }
626 
628 
631 PString vecNumberToString(const std::vector<long unsigned int> & vecNb){
632  if(vecNb.size() == 0lu){return "";}
633  PString body("");
634  std::vector<long unsigned int>::const_iterator it(vecNb.begin());
635  body += valueToString(*it);
636  ++it;
637  while(it != vecNb.end()){
638  body += "." + valueToString(*it);
639  ++it;
640  }
641  return body;
642 }
643 
645 
648 PString vecMenuToHtml(const PVecMenu & vecMenu){
649  if(vecMenu.size() == 0lu){return "";}
650  PString body("");
651  body += "\t\t<ul class=\"sommaire\">\n";
652  for(PVecMenu::const_iterator it(vecMenu.begin()); it != vecMenu.end(); ++it){
653  body += "\t\t\t<li><a href=\""+it->getLink()+"\">"+getSecNumberFromFileName(it->getLink()).replace("-", ".")+") ";
654 
655 // body += convertStrToHtml(it->getText());
656  body += it->getText();
657 
658  body += "</a></li>\n";
659  }
660  body += "\t\t</ul>\n";
661  return body;
662 }
663 
665 
671 PString getHtmlHeader(const PString & title, bool useMathJax, bool useRemoteMathjax, const PString & currentStyle){
672  PString body("");
673  body += "<!DOCTYPE html>\n";
674  body += "<html lang=\"fr\">\n";
675  body += "\t<head>\n";
676  body += "\t\t<meta charset=\"utf-8\" />\n";
677  body += "\t\t<title>"+title+"</title>\n";
678  body += "\t\t<link rel=\"stylesheet\" href=\""+currentStyle+"_style.css\" />\n";
679  if(useMathJax){
680  if(useRemoteMathjax){
681  body += "\t\t<script src=\"load-mathjax.js\" async></script>\n";
682  }else{
683  body += "\t\t<script type=\"text/x-mathjax-config\">\n";
684  body += "\t\t\tMathJax.Hub.Config({\n";
685  body += "\t\t\t\textensions: [\"tex2jax.js\"],\n";
686  body += "\t\t\t\tjax: [\"input/TeX\",\"output/HTML-CSS\"],\n";
687  body += "\t\t\t\ttex2jax: {inlineMath: [[\"$\",\"$\"],[\"\\\\(\",\"\\\\)\"]]}\n";
688  body += "\t\t\t});\n";
689  body += "\t\t</script>\n";
690  body += "\t\t<script type=\"text/javascript\" src=\"MathJax.js\"></script>\n";
691  }
692  }
693  body += "\t</head>\n";
694  body += "\t<body>\n";
695  return body;
696 }
697 
699 
702  PString body("");
703  body += "\t</body>\n";
704  body += "</html>\n\n";
705  return body;
706 
707 }
708 
710 
717 void platexobj_sectionHtml(POutoutMode & outputMode, const PLatexObj & obj, const PString & baliseName, const PString & cssClassName,
718  const PString & prefixTitle, bool isBibliography)
719 {
720  PString body("");
721  const PVecLatexObj & vecObj = obj.getVecContent();
722  for(PVecLatexObj::const_iterator it(vecObj.begin()); it != vecObj.end(); ++it){
723  body += platexobj_htmlStr(outputMode, *it, isBibliography);
724  }
725  PString objTitle(getSectionTitle(outputMode, obj)); //Content of the section title
727  obj.getPrevSec().getLink(), obj.getPrevSec().getText(),
728  obj.getNextSec().getLink(), obj.getNextSec().getText(),
729  obj.getParentSec().getLink(), obj.getParentSec().getText(),
730  obj.getSourceFile(), obj.getSourceLine());
731 
732  outputMode.mapVar["${MAIN_TITLE}"] = "\t\t" + platexobj_createTitle(obj, baliseName, cssClassName, objTitle, prefixTitle, true);
733  outputMode.mapVar["${SUB_MENU}"] = vecMenuToHtml(obj.getVecMenu());
734  outputMode.mapVar["${PAGE_CONTENT}"] = body;
735 
736  PPath fileName(obj.getLink());
737  if(!fileName.saveFileContent(platexobj_theme_createPage(outputMode))){
738  std::cerr << "platexobj_sectionHtml : can't save file '"<<fileName<<"' for object '" << obj.getName() << "'" << std::endl;
739  }
740 // else{
741 // std::cout << "platexobj_sectionHtml : save file '"<<fileName<<"'" << std::endl;
742 // }
743 }
744 
746 
751 PString platexobj_htmlMainTitle(const PString & title, const PString & hLevel, const PString & cssClassName){
752  if(title == ""){return "";}
753  PString body("");
754  body += "\t<"+hLevel+" class=\""+cssClassName+"\">" + title + "</"+hLevel+">\n";
755  return body;
756 }
757 
759 
763 PString platexobj_indexHtml(POutoutMode & outputMode, const PLatexObj & obj, bool isBibliography){
764  PString body("");
765  const PVecLatexObj & vecObj = obj.getVecContent();
766  for(PVecLatexObj::const_iterator it(vecObj.begin()); it != vecObj.end(); ++it){
767  body += platexobj_htmlStr(outputMode, *it, isBibliography);
768  }
769  platexobj_theme_update_var(outputMode, obj.getLink(), obj.getName(),
770  obj.getPrevSec().getLink(), obj.getPrevSec().getText(),
771  obj.getNextSec().getLink(), obj.getNextSec().getText(),
772  obj.getParentSec().getLink(), obj.getParentSec().getText(),
773  obj.getSourceFile(), obj.getSourceLine());
774  PString bodyTitle("");
775  bodyTitle += platexobj_htmlMainTitle(obj.getName(), "h1", "mainTitle");
776  bodyTitle += platexobj_htmlMainTitle(obj.getSubTitle(), "h2", "mainSubTitle");
777  bodyTitle += platexobj_htmlMainTitle(obj.getAuthor(), "h5", "author");
778  bodyTitle += platexobj_htmlMainTitle(obj.getDate(), "h6", "date");
779  outputMode.mapVar["${MAIN_TITLE}"] = bodyTitle;
780  outputMode.mapVar["${SUB_MENU}"] = vecMenuToHtml(obj.getVecMenu());
781  outputMode.mapVar["${PAGE_CONTENT}"] = body;
782  return platexobj_theme_createPage(outputMode);
783 }
784 
786 
790 PString platexobj_htmlStrItemize(POutoutMode & outputMode, const PLatexObj & obj){
791  PString body("");
792  body += "\t\t<ul>\n";
793  body += platexobj_htmlStr(outputMode, obj.getVecContent());
794  body += "\t\t</ul>\n";
795  return body;
796 }
797 
799 
803 PString platexobj_htmlStrEnumerate(POutoutMode & outputMode, const PLatexObj & obj){
804  PString body("");
805  body += "\t\t<ol>\n";
806  body += platexobj_htmlStr(outputMode, obj.getVecContent());
807  body += "\t\t</ol>\n";
808  return body;
809 }
810 
812 
816 PString platexobj_htmlStrItem(POutoutMode & outputMode, const PLatexObj & obj){
817  PString body("");
818  body += "\t\t<li>";
819  body += platexobj_htmlStr(outputMode, obj.getVecContent());
820  body += "</li>\n";
821  return body;
822 }
823 
825 
828 PString platexobj_htmlStrVideo(const PLatexObj & obj){
829  PString body("");
830  PPath fileName(obj.getName());
831  body += "\t<video width=\""+obj.getText()+"\" controls>\n";
832  body += "\t\t<!-- Be careful, if you do not have sound, check if the video has MP3 sound and not AC3 -->\n";
833  body += "\t\t<source src=\""+fileName+"\" type=\"video/"+fileName.getExtension()+"\">\n";
834  body += "\t</video>"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
835  return body;
836 }
837 
839 
846 bool platexobj_htmlStrBase(PString & body, POutoutMode & outputMode, const PLatexObj & obj, bool isBibliography, bool allowText){
847  PLatexType::PLatexType type(obj.getType());
848  if(type == PLatexType::TEXT && allowText){body = platexobj_htmlStrText(obj);}
849  else if(type == PLatexType::URL){body = platexobj_htmlStrUrl(obj);}
850  else if(type == PLatexType::GETENV){body = platexobj_htmlStrGetEnv(obj);}
851  else if(type == PLatexType::UPDATESTYLE){body = platexobj_htmlStrUpdateStyle(outputMode, obj);}
852  else if(type == PLatexType::PERCENT){body += "%";}
853  else if(type == PLatexType::REF){body = platexobj_htmlStrRef(obj);}
854  else if(type == PLatexType::NEWLINE){body = platexobj_htmlStrNewLine(obj);}
855  else if(type == PLatexType::SPACEPARAGRAPH){body = platexobj_htmlStrSpaceParagraph(obj);}
857  else if(type == PLatexType::CITATION){body = platexobj_htmlStrCitation(obj);}
858 
859  else if(type == PLatexType::HREF){body = platexobj_htmlStrHref(outputMode, obj);}
860  else if(type == PLatexType::TEXTBF){body = platexobj_htmlStrTextBf(obj);}
861  else if(type == PLatexType::TEXTIT){body = platexobj_htmlStrTextIt(obj);}
862  else if(type == PLatexType::DEBUG){body = platexobj_htmlStrTextDebug(obj);}
863  else if(type == PLatexType::FOOTNOTE){body = platexobj_htmlStrTextFootnote(outputMode, obj);}
864  else if(type == PLatexType::CAPTION){body = platexobj_htmlStrCaption(outputMode, obj);}
865  else if(type == PLatexType::WORK_IN_PROGRESS){body = platexobj_htmlStrWip(outputMode, obj);}
866  else if(type == PLatexType::DETAILS){body = platexobj_htmlStrDetail(outputMode, obj);}
867  else if(type == PLatexType::SUMMARY){body = platexobj_htmlStrSummary(outputMode, obj);}
868  else if(type == PLatexType::QUOTE){body = platexobj_htmlStrQuote(outputMode, obj);}
869 
870  else if(type == PLatexType::IMAGE){body = platexobj_htmlStrImage(obj);}
871  else if(type == PLatexType::CALLDOT){body = platexobj_htmlStrCallDot(outputMode, obj);}
872  else if(type == PLatexType::SVGTOPNG){body = platexobj_htmlStrSvgToPng(outputMode, obj);}
873 
874  else if(type == PLatexType::PARTSTAR){body = platexobj_htmlStrAllPart(outputMode, obj, "h1", "");}
875  else if(type == PLatexType::CHAPTERSTAR){body = platexobj_htmlStrAllPart(outputMode, obj, "h2", "");}
876  else if(type == PLatexType::SECTIONSTAR){body = platexobj_htmlStrAllPart(outputMode, obj, "h3", "");}
877  else if(type == PLatexType::SUBSECTIONSTAR){body = platexobj_htmlStrAllPart(outputMode, obj, "h3", "");}
878  else if(type == PLatexType::SUBSUBSECTIONSTAR){body = platexobj_htmlStrAllPart(outputMode, obj, "h3", "");}
879 
880  else if(type == PLatexType::PARAGRAPHE){body = platexobj_htmlStrBasicEnv(outputMode, obj, "p", "paragraphStyle", true);}
881  else if(type == PLatexType::CENTER){body = platexobj_htmlStrBasicEnv(outputMode, obj, "div", "centerStyle", true);}
882  else if(type == PLatexType::COLUMN){body = platexobj_htmlStrBasicEnv(outputMode, obj, "td", "columnStyle", true);}
883 
884  else if(type == PLatexType::COLUMNS){body = platexobj_htmlStrColumns(outputMode, obj);}
885 
886  else if(type == PLatexType::TABLE){body = platexobj_htmlStrBasicEnv(outputMode, obj, "div", "tableStyle", true);}
887  else if(type == PLatexType::TABULAR){body = platexobj_htmlStrTabular(outputMode, obj);}
888  else if(type == PLatexType::TABROW){body = platexobj_htmlStrTabRow(outputMode, obj);}
889  else if(type == PLatexType::TABCELL){body = platexobj_htmlStrTabCell(outputMode, obj);}
890  else if(type == PLatexType::FIGURE){body = platexobj_htmlStrBasicEnv(outputMode, obj, "div", "figureStyle", false);}
891 
892  else if(type == PLatexType::DISPLAYMATH){body = platexobj_htmlStrLatex(outputMode, obj, "displaymath");}
893  else if(type == PLatexType::EQNARRAY){body = platexobj_htmlStrLatex(outputMode, obj, "eqnarray*");}
894  else if(type == PLatexType::INLINEMATH){body = platexobj_htmlStrInlineMath(outputMode, obj);}
895 
896  else if(type == PLatexType::ITEMIZE){body = platexobj_htmlStrItemize(outputMode, obj);}
897  else if(type == PLatexType::ENUMERATE){body = platexobj_htmlStrEnumerate(outputMode, obj);}
898  else if(type == PLatexType::ITEM){body = platexobj_htmlStrItem(outputMode, obj);}
899  else if(type == PLatexType::VIDEO){body = platexobj_htmlStrVideo(obj);}
900 
901  else if(type == PLatexType::ENVIRONEMENT){body = platexobj_htmlStrExtraEnvironement(outputMode, obj);}
902  else if(type == PLatexType::FUNCTION){body = platexobj_htmlStrExtraFunction(outputMode, obj);}
903  else if(type == PLatexType::PARSER){body = platexobj_htmlStrExtraParser(obj);}
904  else if(type == PLatexType::HTML){body = platexobj_htmlStrHtml(obj);}
905  else if(type == PLatexType::TIMETABLE){body = platexobj_htmlStrTimetable(outputMode, obj);}
906  else if(type == PLatexType::TIMETABLE_WEEK){body = platexobj_htmlStrTimetableWeek(outputMode, obj);}
907  else if(type == PLatexType::TIMETABLE_TIMEROW){body = platexobj_htmlStrTimetableTimeRow(outputMode, obj);}
908  else if(type == PLatexType::TIMETABLE_DAY){body = platexobj_htmlStrTimetableDay(outputMode, obj);}
909  else if(type == PLatexType::TIMETABLE_BLOCK){body = platexobj_htmlStrTimetableBlock(outputMode, obj);}
910  else if(type == PLatexType::TIMETABLE_EMPTYBLOCK){body = platexobj_htmlStrTimetableEmptyBlock(outputMode, obj);}
911  else if(type == PLatexType::TIMETABLE_TIME){body = platexobj_htmlStrTimetableTime(outputMode, obj);}
912  else if(type == PLatexType::RENDEZVOUS){body = platexobj_htmlStrRendezVous(obj);}
913  else{
914  return false;
915  }
916  return true;
917 }
918 
920 
926 PString platexobj_htmlStr(POutoutMode & outputMode, const PLatexObj & obj, bool isBibliography, bool allowText){
927  PString body("");
928  PLatexType::PLatexType type(obj.getType());
929  if(type == PLatexType::PART){platexobj_sectionHtml(outputMode, obj, "h1", "ptexpart", "Part", isBibliography);}
930  else if(type == PLatexType::CHAPTER){platexobj_sectionHtml(outputMode, obj, "h2", "ptexchapter", "Chapter", isBibliography);}
931  else if(type == PLatexType::SECTION){platexobj_sectionHtml(outputMode, obj, "h3", "ptexsection", "", isBibliography);}
932  else if(type == PLatexType::SUBSECTION){platexobj_sectionHtml(outputMode, obj, "h4", "ptexsubsection", "", isBibliography);}
933  else if(type == PLatexType::SUBSUBSECTION){platexobj_sectionHtml(outputMode, obj, "h5", "ptexsubsubsection", "", isBibliography);}
934  else if(type == PLatexType::FILE){body = platexobj_indexHtml(outputMode, obj, isBibliography);}
935  else if(!platexobj_htmlStrBase(body, outputMode, obj, isBibliography, allowText)){
936  body = platexobj_htmlStr(outputMode, obj.getVecContent(), isBibliography, allowText);
937  }
938  return body;
939 }
940 
942 
948 PString platexobj_htmlStr(POutoutMode & outputMode, const PVecLatexObj & vecObj, bool isBibliography, bool allowText){
949  PString body("");
950  for(PVecLatexObj::const_iterator it(vecObj.begin()); it != vecObj.end(); ++it){
951  body += platexobj_htmlStr(outputMode, *it, isBibliography, allowText);
952  }
953  return body;
954 }
955 
957 
961 bool platexobj_copyFile(const PString & inputFile, const PString & outputDir){
962  PString command("cp " + inputFile + " " + outputDir + "/");
963  if(system(command.c_str()) != 0){
964  std::cerr << "platexobj_copyFile : can't copy file '"<<inputFile<<"' into '"<<outputDir<<"' directory" << std::endl;
965  return false;
966  }
967  return true;
968 }
969 
971 
976 bool platexobj_editVaraibleFile(const PPath & inputFile, const PPath & outputDir, const POutoutMode & outputMode){
977  PString fileContent(inputFile.loadFileContent());
978  PString updateContent = fileContent.replace("--sidebar-width: 300px;", "--sidebar-width: "+outputMode.bookSideBarWidth+";");
979  PPath outputFile(outputDir / inputFile.getFileName());
980  return outputFile.saveFileContent(updateContent);
981 }
982 
984 
990 bool platexobj_html(POutoutMode & outputMode, const PLatexObj & obj, bool isBibliography, const PString & baseInstallPrefix){
991  PString fileContent("");
992  PPath indexHtml(obj.getLink());
993 
994  if(outputMode.isBookTheme){
995  fileContent = platexobj_bookHtml(outputMode, obj, isBibliography, true);
996  }else{
997  fileContent = platexobj_htmlStr(outputMode, obj, isBibliography);
998  }
999 
1000  if(!indexHtml.saveFileContent(fileContent)){
1001  std::cerr << "platexobj_html : can't save file '"<<indexHtml<<"'" << std::endl;
1002  return false;
1003  }
1004 // else{
1005 // std::cerr << "platexobj_html : save file '"<<indexHtml<<"'" << std::endl;
1006 // }
1007  //Copy the background image
1008  PPath outputImageDir(LATEX_IMAGE_OUTPUT_DIR);
1009  if(!outputImageDir.createDirectory()){
1010  std::cerr << "platexobj_htmlStrLatex : can't create directory '" << outputImageDir << "'" << std::endl;
1011  return "";
1012  }
1013 
1014  PString installPrefix(CMAKE_INSTALL_PREFIX);
1015  if(baseInstallPrefix != ""){
1016  installPrefix = baseInstallPrefix;
1017  }
1018  bool b(true);
1019 // PString fileToBeCopied(installPrefix + "/share/PhoenixTex2Html/Images/trennen.jpg");
1020  PPath fileToBeCopied(installPrefix + "/share/PhoenixTex2Html/Images/Mv83H.png");
1021  b &= platexobj_copyFile(fileToBeCopied, outputImageDir);
1022  PPath fileWipToBeCopied(installPrefix + "/share/PhoenixTex2Html/Images/wip.png");
1023  b &= platexobj_copyFile(fileWipToBeCopied, outputImageDir);
1024  PPath fileLinkToBeCopied(installPrefix + "/share/PhoenixTex2Html/Images/iconlink_32.png");
1025  b &= platexobj_copyFile(fileLinkToBeCopied, outputImageDir);
1026  PPath fileCalendarWhiteToBeCopied(installPrefix + "/share/PhoenixTex2Html/Images/caldendar-icon-white-24x24.png");
1027  b &= platexobj_copyFile(fileCalendarWhiteToBeCopied, outputImageDir);
1028  PPath fileCalendarBlackToBeCopied(installPrefix + "/share/PhoenixTex2Html/Images/caldendar-icon-black-24x24.png");
1029  b &= platexobj_copyFile(fileCalendarBlackToBeCopied, outputImageDir);
1030 
1031  if(outputMode.isBookTheme){
1032  PPath currentOutputDir("./");
1033  b &= platexobj_editVaraibleFile(PPath(installPrefix + "/share/PhoenixTex2Html/STYLE/BookTheme/variables.css"), currentOutputDir, outputMode);
1034  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/STYLE/BookTheme/general.css", currentOutputDir);
1035  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/STYLE/BookTheme/chrome.css", currentOutputDir);
1036  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/STYLE/BookTheme/ayu-highlight.css", currentOutputDir);
1037  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/STYLE/BookTheme/highlight.css", currentOutputDir);
1038  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/STYLE/BookTheme/tomorrow-night.css", currentOutputDir);
1039  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/STYLE/BookTheme/font-awesome.css", currentOutputDir);
1040  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/STYLE/BookTheme/fonts.css", currentOutputDir);
1041 
1042  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/javascript/BookTheme/clipboard.js", currentOutputDir);
1043  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/javascript/BookTheme/highlight.js", currentOutputDir);
1044  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/javascript/BookTheme/book.js", currentOutputDir);
1045 
1046  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/Images/book_edit_icon.png", outputImageDir);
1047  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/Images/book_gitlab_icon.png", outputImageDir);
1048  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/Images/book_home_icon.png", outputImageDir);
1049  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/Images/book_mail_icon.png", outputImageDir);
1050  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/Images/book_next_icon.png", outputImageDir);
1051  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/Images/book_prev_icon.png", outputImageDir);
1052  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/Images/book_theme_icon.png", outputImageDir);
1053  b &= platexobj_copyFile(installPrefix + "/share/PhoenixTex2Html/Images/book_toggle_sidebar_icon.png", outputImageDir);
1054  }
1055 
1056  if(outputMode.isRemoteMathjax){
1057  PPath fileJavascriptConfigToBeCopied(installPrefix + "/share/PhoenixTex2Html/javascript/load-mathjax.js");
1058  b &= platexobj_copyFile(fileJavascriptConfigToBeCopied, ".");
1059  }
1060  return b;
1061 }
1062 
#define LATEX_IMAGE_OUTPUT_DIR
Definition: PLatexObj_def.h:11
const PString & getText() const
Gets the text of the PLatexMenu.
Definition: PLatexObj.cpp:69
const PString & getLink() const
Gets the link of the PLatexMenu.
Definition: PLatexObj.cpp:55
Describe a latex object.
Definition: PLatexObj.h:40
const PLatexMenu & getNextSec() const
Gets the nextSec of the PLatexObj.
Definition: PLatexObj.cpp:480
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410
const std::vector< PLatexObj > & getComplexTitle() const
Gets the complexTitle of the PLatexObj.
Definition: PLatexObj.cpp:396
const PString & getBalise() const
Gets the balise of the PLatexObj.
Definition: PLatexObj.cpp:382
const std::vector< PLatexMenu > & getVecMenu() const
Gets the vecMenu of the PLatexObj.
Definition: PLatexObj.cpp:452
const PString & getLabelName() const
Gets the labelName of the PLatexObj.
Definition: PLatexObj.cpp:354
const PString & getSubTitle() const
Gets the subTitle of the PLatexObj.
Definition: PLatexObj.cpp:340
const PLatexType::PLatexType & getType() const
Gets the type of the PLatexObj.
Definition: PLatexObj.cpp:298
const PString & getName() const
Gets the name of the PLatexObj.
Definition: PLatexObj.cpp:326
const PString & getLink() const
Gets the link of the PLatexObj.
Definition: PLatexObj.cpp:368
const PLatexMenu & getParentSec() const
Gets the parentSec of the PLatexObj.
Definition: PLatexObj.cpp:494
const PString & getAuthor() const
Gets the author of the PLatexObj.
Definition: PLatexObj.cpp:508
const PString & getSourceFile() const
Gets the sourceFile of the PLatexObj.
Definition: PLatexObj.cpp:536
size_t getSourceLine() const
Gets the sourceLine of the PLatexObj.
Definition: PLatexObj.cpp:550
const std::vector< long unsigned int > & getVecSecNumber() const
Gets the vecSecNumber of the PLatexObj.
Definition: PLatexObj.cpp:438
long unsigned int getId() const
Gets the id of the PLatexObj.
Definition: PLatexObj.cpp:284
const PString & getText() const
Gets the text of the PLatexObj.
Definition: PLatexObj.cpp:312
long unsigned int getRowSpan() const
Gets the rowSpan of the PLatexObj.
Definition: PLatexObj.cpp:578
const PString & getDate() const
Gets the date of the PLatexObj.
Definition: PLatexObj.cpp:522
const PLatexMenu & getPrevSec() const
Gets the prevSec of the PLatexObj.
Definition: PLatexObj.cpp:466
long unsigned int getColSpan() const
Gets the colSpan of the PLatexObj.
Definition: PLatexObj.cpp:592
long unsigned int getNbline() const
Gets the nbline of the PLatexObj.
Definition: PLatexObj.cpp:424
Path of a directory or a file.
Definition: PPath.h:17
bool saveFileContent(const PString &content) const
Save a PString in a file.
Definition: PPath.cpp:395
PPath getParentDirectory() const
Get path of parent directory of current path.
Definition: PPath.cpp:207
bool isFileExist() const
Say if the current file path does exist.
Definition: PPath.cpp:139
PString loadFileContent() const
Get the file content in a PString.
Definition: PPath.cpp:382
PPath getFileName() const
Get the name of the file, from last char to /.
Definition: PPath.cpp:172
Extends the std::string.
Definition: PString.h:16
PString replace(const PString &pattern, const PString &replaceStr) const
Replace a PString into an other PString.
Definition: PString.cpp:204
PString eraseFirstLastChar(const PString &vecChar) const
Erase first and last char in a string.
Definition: PString.cpp:545
PString eraseLastChar(const PString &vecChar) const
Erase first and last char in a string.
Definition: PString.cpp:521
std::string valueToString(const T &val)
Convert a type into a string.
PLatexType
Type of the PLatexObj.
Definition: PLatexType.h:12
@ SUBSUBSECTION
Definition: PLatexType.h:54
@ SUBSECTIONSTAR
Definition: PLatexType.h:60
@ AUTOSPACEPARAGRAPH
Definition: PLatexType.h:28
@ TIMETABLE_EMPTYBLOCK
Definition: PLatexType.h:103
@ SPACEPARAGRAPH
Definition: PLatexType.h:27
@ ENVIRONEMENT
Definition: PLatexType.h:85
@ TIMETABLE_TIME
Definition: PLatexType.h:104
@ SUBSUBSECTIONSTAR
Definition: PLatexType.h:61
@ TIMETABLE_WEEK
Definition: PLatexType.h:99
@ WORK_IN_PROGRESS
Definition: PLatexType.h:32
@ TIMETABLE_TIMEROW
Definition: PLatexType.h:100
@ TIMETABLE_BLOCK
Definition: PLatexType.h:102
PString convertStrToHtml(const PString &str)
fonction qui converti une chaîne de caractères en html (elle remplace les caractères spéciaux)
PString phoenix_getenv(const PString &varName)
Get the value of the given environment variable.
Definition: phoenix_env.cpp:15
PString phoenix_popen(const PString &command)
Execute the given command and returns the output of this command.
PString platexobj_theme_createPage(POutoutMode &outputMode)
Create the page from variables in POutoutMode.
void platexobj_theme_update_var(POutoutMode &outputMode, const PString &pageLink, const PString &pageTitle, const PString &prevSecLink, const PString &prevSecTitle, const PString &nextSecLink, const PString &nextSecTitle, const PString &parentSecLink, const PString &parentSecTitle, const PPath &currentSourceFile, size_t currentSourceLine)
Update var of POutoutMode for current section.
PString platexobj_htmlStrLatex(POutoutMode &outputMode, const PLatexObj &obj, const PString &latexEnv)
Convert a PLatexObj into a string.
PString platexobj_htmlStrInlineMath(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrCitation(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTimetable(POutoutMode &outputMode, const PLatexObj &obj)
Convert a timetable into a html string.
PString platexobj_htmlStrHtml(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTimetableEmptyBlock(POutoutMode &outputMode, const PLatexObj &obj)
Convert a timetable block into a html string.
PString platexobj_createLabelSearchLink(const PString &labelName)
Create the link to the label of the current PLatexObj if it exist.
PString platexobj_htmlStrTextFootnote(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString vecMenuToHtml(const PVecMenu &vecMenu)
Convert the vector of menu into a html string.
PString platexobj_htmlStrNewLine(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrUpdateStyle(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrSpaceParagraph(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrWip(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrColumns(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrCallDot(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTimetableTime(POutoutMode &outputMode, const PLatexObj &obj)
Convert a timetable time into a html string.
PString platexobj_htmlStrTimetableDay(POutoutMode &outputMode, const PLatexObj &obj)
Convert a timetable day into a html string.
PString platexobj_htmlStrTabCell(POutoutMode &outputMode, const PLatexObj &obj)
Convert a tabular into a html string.
PString platexobj_htmlStrTabRow(POutoutMode &outputMode, const PLatexObj &obj)
Convert a tabular into a html string.
PString vecNumberToString(const std::vector< long unsigned int > &vecNb)
Convert a vector of numbers into a string.
PString platexobj_htmlStrUrl(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTimetableBlock(POutoutMode &outputMode, const PLatexObj &obj)
Convert a timetable block into a html string.
PString platexobj_htmlStrBasicEnv(POutoutMode &outputMode, const PLatexObj &obj, const PString &baliseName, const PString &cssClassName, bool allowText)
Convert a basic environement into a string.
PString platexobj_htmlStrExtraEnvironement(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrQuote(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTextDebug(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrExtraFunction(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTextBf(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrExtraParser(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrSvgToPng(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrHref(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrRendezVous(const PLatexObj &obj)
Convert a rendez-vous into a html string.
PString getHtmlHeader(const PString &title, bool useMathJax, bool useRemoteMathjax, const PString &currentStyle)
Get the html header.
PString platexobj_htmlStrAllPart(POutoutMode &outputMode, const PLatexObj &obj, const PString &hLevel, const PString &cssClassName)
Convert a PLatexObj into a string.
PString platexobj_htmlStrText(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrDetail(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_createTitle(const PLatexObj &obj, const PString &baliseName, const PString &cssClassName, const PString objTitle, const PString &prefixTitle, bool addLinkLabel)
Create a title.
PString platexobj_htmlStrGetEnv(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrRef(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrSummary(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrCaption(POutoutMode &outputMode, const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTimetableTimeRow(POutoutMode &outputMode, const PLatexObj &obj)
Convert a timetable time row into a html string.
PString platexobj_htmlStrTextIt(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString platexobj_htmlStrTimetableWeek(POutoutMode &outputMode, const PLatexObj &obj)
Convert a timetable week into a html string.
PString platexobj_htmlStrTabular(POutoutMode &outputMode, const PLatexObj &obj)
Convert a tabular into a html string.
PString platexobj_htmlStr(POutoutMode &outputMode, const PLatexObj &obj, bool isBibliography=false, bool allowText=true)
PString platexobj_htmlMainTitle(const PString &title, const PString &hLevel, const PString &cssClassName)
PString getHtmlFooter()
bool platexobj_htmlStrBase(PString &body, POutoutMode &outputMode, const PLatexObj &obj, bool isBibliography, bool allowText)
bool platexobj_html(POutoutMode &outputMode, const PLatexObj &obj, bool isBibliography=false, const PString &baseInstallPrefix="")
PString platexobj_bookHtml(POutoutMode &outputMode, const std::vector< PLatexObj > &vecObj, bool isBibliography, bool allowText)
Convert a PLatexObj into a string with book theme.
PString platexobj_rawtext(const std::vector< PLatexObj > &vecObj)
Convert a PLatexObj in text.
PString platexobj_text(const std::vector< PLatexObj > &vecObj)
Convert a PLatexObj in text.
PString platexobj_htmlStrImage(const PLatexObj &obj)
Convert a PLatexObj into a string.
PString getSecNumberFromFileName(const PPath &fileName)
Get the section number from its file name.
PString getSectionTitle(POutoutMode &outputMode, const PLatexObj &obj)
Get the title of a part/chapter/section etc.
std::vector< PLatexObj > PVecLatexObj
Vector of obj.
std::vector< PLatexMenu > PVecMenu
Vector of PLatexMenu.
Output mode of the html backend.
PMapKnownVar mapVar
Map of output var which are use to fill the output themes.
bool isBookTheme
True to activate the book theme.
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.