PhoenixLecture  2.0.0
Set of tools to make lectures
platexobj_html.h File Reference
+ Include dependency graph for platexobj_html.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PString getHtmlFooter ()
 
PString getHtmlHeader (const PString &title, bool useMathJax, bool useRemoteMathjax, const PString &currentStyle)
 Get the html header. More...
 
PString platexobj_createLabelSearchLink (const PString &labelName)
 Create the link to the label of the current PLatexObj if it exist. More...
 
PString platexobj_createTitle (const PLatexObj &obj, const PString &baliseName, const PString &cssClassName, const PString objTitle, const PString &prefixTitle, bool addLinkLabel)
 Create a title. More...
 
bool platexobj_html (POutoutMode &outputMode, const PLatexObj &obj, bool isBibliography=false, const PString &baseInstallPrefix="")
 
PString platexobj_htmlMainTitle (const PString &title, const PString &hLevel, const PString &cssClassName)
 
PString platexobj_htmlStr (POutoutMode &outputMode, const PLatexObj &obj, bool isBibliography=false, bool allowText=true)
 
PString platexobj_htmlStr (POutoutMode &outputMode, const PVecLatexObj &vecObj, bool isBibliography=false, bool allowText=true)
 
bool platexobj_htmlStrBase (PString &body, POutoutMode &outputMode, const PLatexObj &obj, bool isBibliography, bool allowText)
 
PString platexobj_htmlStrGetEnv (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrRef (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrRendezVous (const PLatexObj &obj)
 Convert a rendez-vous into a html string. More...
 
PString platexobj_htmlStrText (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrTextBf (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrTextDebug (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrTextIt (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrUrl (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString vecMenuToHtml (const PVecMenu &vecMenu)
 Convert the vector of menu into a html string. More...
 
PString vecNumberToString (const std::vector< long unsigned int > &vecNb)
 Convert a vector of numbers into a string. More...
 

Function Documentation

◆ getHtmlFooter()

PString getHtmlFooter ( )

Referenced by createOutlineHtml(), pbiblio_entryPage(), and pbiblio_html().

+ Here is the caller graph for this function:

◆ getHtmlHeader()

PString getHtmlHeader ( const PString title,
bool  useMathJax,
bool  useRemoteMathjax,
const PString currentStyle 
)

Get the html header.

Parameters
title: page title
useMathJax: true to use MathJax, false otherwise
useRemoteMathjax: true if we use remote mathjax
currentStyle: current style to be used
Returns
output string

Definition at line 671 of file platexobj_html.cpp.

Referenced by createOutlineHtml(), pbiblio_entryPage(), and pbiblio_html().

+ Here is the caller graph for this function:

◆ platexobj_createLabelSearchLink()

PString platexobj_createLabelSearchLink ( const PString labelName)

Create the link to the label of the current PLatexObj if it exist.

Parameters
labelName: name of the label to be used
Returns
html link to search the label or empty string if there is no label

Definition at line 25 of file platexobj_html.cpp.

25  {
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 }
Extends the std::string.
Definition: PString.h:16

Referenced by platexobj_createTitle(), platexobj_htmlStrAllPart(), platexobj_htmlStrBasicEnv(), platexobj_htmlStrCallDot(), platexobj_htmlStrCaption(), platexobj_htmlStrExtraEnvironement(), platexobj_htmlStrExtraFunction(), platexobj_htmlStrExtraParser(), platexobj_htmlStrImage(), platexobj_htmlStrSvgToPng(), platexobj_htmlStrTabular(), platexobj_htmlStrTimetable(), platexobj_htmlStrTimetableWeek(), and platexobj_textExtraFunction().

+ Here is the caller graph for this function:

◆ platexobj_createTitle()

PString platexobj_createTitle ( const PLatexObj obj,
const PString baliseName,
const PString cssClassName,
const PString  objTitle,
const PString prefixTitle,
bool  addLinkLabel 
)

Create a title.

Parameters
obj: PLatexObj to be saved
baliseName: name of the title balise
cssClassName: css class to be used
objTitle: title to be printed
prefixTitle: prefix of the title (Part or Chapter)
addLinkLabel: true to add the label link in the title

Definition at line 40 of file platexobj_html.cpp.

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 }
const PString & getLabelName() const
Gets the labelName of the PLatexObj.
Definition: PLatexObj.cpp:354
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
std::string valueToString(const T &val)
Convert a type into a string.
PString platexobj_createLabelSearchLink(const PString &labelName)
Create the link to the label of the current PLatexObj if it exist.
PString vecNumberToString(const std::vector< long unsigned int > &vecNb)
Convert a vector of numbers into a string.

References PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getVecSecNumber(), platexobj_createLabelSearchLink(), valueToString(), and vecNumberToString().

Referenced by platexobj_book_createPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platexobj_html()

bool platexobj_html ( POutoutMode outputMode,
const PLatexObj obj,
bool  isBibliography = false,
const PString baseInstallPrefix = "" 
)

Referenced by processAllFile().

+ Here is the caller graph for this function:

◆ platexobj_htmlMainTitle()

PString platexobj_htmlMainTitle ( const PString title,
const PString hLevel,
const PString cssClassName 
)

Referenced by platexobj_bookIndexHtml().

+ Here is the caller graph for this function:

◆ platexobj_htmlStr() [1/2]

◆ platexobj_htmlStr() [2/2]

PString platexobj_htmlStr ( POutoutMode outputMode,
const PVecLatexObj vecObj,
bool  isBibliography = false,
bool  allowText = true 
)

◆ platexobj_htmlStrBase()

bool platexobj_htmlStrBase ( PString body,
POutoutMode outputMode,
const PLatexObj obj,
bool  isBibliography,
bool  allowText 
)

Referenced by platexobj_bookHtml().

+ Here is the caller graph for this function:

◆ platexobj_htmlStrGetEnv()

PString platexobj_htmlStrGetEnv ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 88 of file platexobj_html.cpp.

88  {
89  PString body("");
90  body += phoenix_getenv(obj.getName());
91  return body;
92 }
const PString & getName() const
Gets the name of the PLatexObj.
Definition: PLatexObj.cpp:326
PString phoenix_getenv(const PString &varName)
Get the value of the given environment variable.
Definition: phoenix_env.cpp:15

References PLatexObj::getName(), and phoenix_getenv().

Referenced by platexobj_text().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platexobj_htmlStrRef()

PString platexobj_htmlStrRef ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 108 of file platexobj_html.cpp.

108  {
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 }
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410
const PString & getLink() const
Gets the link of the PLatexObj.
Definition: PLatexObj.cpp:368
PString platexobj_text(const std::vector< PLatexObj > &vecObj)
Convert a PLatexObj in text.

References PLatexObj::getLink(), PLatexObj::getName(), PLatexObj::getVecContent(), and platexobj_text().

Referenced by platexobj_rawtext(), and platexobj_text().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platexobj_htmlStrRendezVous()

PString platexobj_htmlStrRendezVous ( const PLatexObj obj)

Convert a rendez-vous into a html string.

Parameters
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 542 of file platexobj_html.cpp.

542  {
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 }
const PString & getText() const
Gets the text of the PLatexObj.
Definition: PLatexObj.cpp:312

References PLatexObj::getId(), PLatexObj::getText(), and valueToString().

Referenced by platexobj_rawtext().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platexobj_htmlStrText()

PString platexobj_htmlStrText ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 62 of file platexobj_html.cpp.

62  {
63  return convertStrToHtml(obj.getText());
64 }
PString convertStrToHtml(const PString &str)
fonction qui converti une chaîne de caractères en html (elle remplace les caractères spéciaux)

References convertStrToHtml(), and PLatexObj::getText().

Referenced by platexobj_rawtext(), and platexobj_text().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platexobj_htmlStrTextBf()

PString platexobj_htmlStrTextBf ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 184 of file platexobj_html.cpp.

184  {
185  PString body("");
186  body += "<b>" + obj.getName() + "</b>";
187  return body;
188 }

References PLatexObj::getName().

Referenced by platexobj_text().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platexobj_htmlStrTextDebug()

PString platexobj_htmlStrTextDebug ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 204 of file platexobj_html.cpp.

204  {
205  PString body("");
206  body += "<span class=\"debug\" id=\""+valueToString(obj.getId())+"\">" + obj.getName() + "</span>";
207  return body;
208 }

References PLatexObj::getId(), PLatexObj::getName(), and valueToString().

Referenced by platexobj_rawtext(), and platexobj_text().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platexobj_htmlStrTextIt()

PString platexobj_htmlStrTextIt ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 194 of file platexobj_html.cpp.

194  {
195  PString body("");
196  body += "<em id=\""+valueToString(obj.getId())+"\">" + obj.getName() + "</em>";
197  return body;
198 }

References PLatexObj::getId(), PLatexObj::getName(), and valueToString().

Referenced by platexobj_text().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platexobj_htmlStrUrl()

PString platexobj_htmlStrUrl ( const PLatexObj obj)

Convert a PLatexObj into a string.

Parameters
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 78 of file platexobj_html.cpp.

78  {
79  PString body("");
80  body += "<a id=\""+valueToString(obj.getId())+"\" href=\"" + obj.getName() + "\">" + obj.getName() + "</a>";
81  return body;
82 }

References PLatexObj::getId(), PLatexObj::getName(), and valueToString().

Referenced by platexobj_rawtext(), and platexobj_text().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vecMenuToHtml()

PString vecMenuToHtml ( const PVecMenu vecMenu)

Convert the vector of menu into a html string.

Parameters
vecMenu: vector to be converted
Returns
output string

Definition at line 648 of file platexobj_html.cpp.

648  {
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 }
PString replace(const PString &pattern, const PString &replaceStr) const
Replace a PString into an other PString.
Definition: PString.cpp:204
PString getSecNumberFromFileName(const PPath &fileName)
Get the section number from its file name.

References getSecNumberFromFileName(), and PString::replace().

+ Here is the call graph for this function:

◆ vecNumberToString()

PString vecNumberToString ( const std::vector< long unsigned int > &  vecNb)

Convert a vector of numbers into a string.

Parameters
vecNb: vector of numbers to be converted
Returns
output string

Definition at line 631 of file platexobj_html.cpp.

631  {
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 }

References valueToString().

Referenced by createOutlineHtmlStr(), platexobj_createTitle(), platexobj_toMenuAll(), and updateMapLabel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: