PhoenixLecture  2.0.0
Set of tools to make lectures
platexobj_html.cpp File Reference
#include <sys/stat.h>
#include <sys/types.h>
#include "phoenix_env.h"
#include "phoenix_system.h"
#include "convertToString.h"
#include "parser_utils.h"
#include "platexobj_text.h"
#include "platexobj_rawtext.h"
#include "platexobj_html_book.h"
#include "platexobj_html.h"
+ Include dependency graph for platexobj_html.cpp:

Go to the source code of this file.

Functions

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...
 
PString platexobj_htmlStrAllPart (POutoutMode &outputMode, const PLatexObj &obj, const PString &hLevel, const PString &cssClassName)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrBasicEnv (POutoutMode &outputMode, const PLatexObj &obj, const PString &baliseName, const PString &cssClassName, bool allowText)
 Convert a basic environement into a string. More...
 
PString platexobj_htmlStrCallDot (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrCaption (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrCitation (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrColumns (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrDetail (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrExtraEnvironement (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrExtraFunction (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrExtraParser (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrGetEnv (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrHref (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrHtml (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrNewLine (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrQuote (POutoutMode &outputMode, 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_htmlStrSpaceParagraph (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrSummary (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrSvgToPng (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrTabCell (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a tabular into a html string. More...
 
PString platexobj_htmlStrTabRow (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a tabular into a html string. More...
 
PString platexobj_htmlStrTabular (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a tabular 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_htmlStrTextFootnote (POutoutMode &outputMode, 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_htmlStrTimetable (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a timetable into a html string. More...
 
PString platexobj_htmlStrTimetableBlock (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a timetable block into a html string. More...
 
PString platexobj_htmlStrTimetableDay (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a timetable day into a html string. More...
 
PString platexobj_htmlStrTimetableEmptyBlock (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a timetable block into a html string. More...
 
PString platexobj_htmlStrTimetableTime (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a timetable time into a html string. More...
 
PString platexobj_htmlStrTimetableTimeRow (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a timetable time row into a html string. More...
 
PString platexobj_htmlStrTimetableWeek (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a timetable week into a html string. More...
 
PString platexobj_htmlStrUpdateStyle (POutoutMode &outputMode, const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrUrl (const PLatexObj &obj)
 Convert a PLatexObj into a string. More...
 
PString platexobj_htmlStrWip (POutoutMode &outputMode, 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

◆ 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_htmlStrAllPart()

PString platexobj_htmlStrAllPart ( POutoutMode outputMode,
const PLatexObj obj,
const PString hLevel,
const PString cssClassName 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
hLevel: h balise
cssClassName: name of the css class to be used
Returns
output string which contains the PLatexObj

Definition at line 352 of file platexobj_html.cpp.

352  {
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 }
PString getSectionTitle(POutoutMode &outputMode, const PLatexObj &obj)
Get the title of a part/chapter/section etc.

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

+ Here is the call graph for this function:

◆ platexobj_htmlStrBasicEnv()

PString platexobj_htmlStrBasicEnv ( POutoutMode outputMode,
const PLatexObj obj,
const PString baliseName,
const PString cssClassName,
bool  allowText 
)

Convert a basic environement into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
baliseName: name of the balise environement
cssClassName: name of the css class to be used
allowText: true if the TEXT PLatexObj are allowed, false if not
Returns
html string

Definition at line 557 of file platexobj_html.cpp.

557  {
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 }
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410
PString platexobj_htmlStr(POutoutMode &outputMode, const PLatexObj &obj, bool isBibliography=false, bool allowText=true)

References PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getVecContent(), platexobj_createLabelSearchLink(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrCallDot()

PString platexobj_htmlStrCallDot ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 303 of file platexobj_html.cpp.

303  {
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 }
#define LATEX_IMAGE_OUTPUT_DIR
Definition: PLatexObj_def.h:11
const PString & getName() const
Gets the name of the PLatexObj.
Definition: PLatexObj.cpp:326
const PString & getText() const
Gets the text of the PLatexObj.
Definition: PLatexObj.cpp:312
Path of a directory or a file.
Definition: PPath.h:17
PPath getParentDirectory() const
Get path of parent directory of current path.
Definition: PPath.cpp:207
PString phoenix_popen(const PString &command)
Execute the given command and returns the output of this command.

References PString::eraseFirstLastChar(), PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getName(), PPath::getParentDirectory(), PLatexObj::getText(), PPath::isFileExist(), LATEX_IMAGE_OUTPUT_DIR, phoenix_popen(), platexobj_createLabelSearchLink(), PPath::saveFileContent(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrCaption()

PString platexobj_htmlStrCaption ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 237 of file platexobj_html.cpp.

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

References PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getVecContent(), platexobj_createLabelSearchLink(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrCitation()

PString platexobj_htmlStrCitation ( 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 147 of file platexobj_html.cpp.

147  {
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 }
const PString & getLink() const
Gets the link of the PLatexObj.
Definition: PLatexObj.cpp:368
const PString & getAuthor() const
Gets the author of the PLatexObj.
Definition: PLatexObj.cpp:508
const PString & getDate() const
Gets the date of the PLatexObj.
Definition: PLatexObj.cpp:522

References PLatexObj::getAuthor(), PLatexObj::getDate(), PLatexObj::getLink(), PLatexObj::getName(), and PLatexObj::getText().

+ Here is the call graph for this function:

◆ platexobj_htmlStrColumns()

PString platexobj_htmlStrColumns ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 613 of file platexobj_html.cpp.

613  {
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 }
std::vector< PLatexObj > PVecLatexObj
Vector of obj.

References PLatexObj::getId(), PLatexObj::getVecContent(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrDetail()

PString platexobj_htmlStrDetail ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 276 of file platexobj_html.cpp.

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

References PLatexObj::getId(), PLatexObj::getVecContent(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrExtraEnvironement()

PString platexobj_htmlStrExtraEnvironement ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 367 of file platexobj_html.cpp.

367  {
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 }
const PString & getBalise() const
Gets the balise of the PLatexObj.
Definition: PLatexObj.cpp:382

References PLatexObj::getBalise(), PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getName(), PLatexObj::getVecContent(), platexobj_createLabelSearchLink(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrExtraFunction()

PString platexobj_htmlStrExtraFunction ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 382 of file platexobj_html.cpp.

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

References PLatexObj::getBalise(), PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getName(), PLatexObj::getVecContent(), platexobj_createLabelSearchLink(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrExtraParser()

PString platexobj_htmlStrExtraParser ( 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 396 of file platexobj_html.cpp.

396  {
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 }
long unsigned int getNbline() const
Gets the nbline of the PLatexObj.
Definition: PLatexObj.cpp:424
PString eraseLastChar(const PString &vecChar) const
Erase first and last char in a string.
Definition: PString.cpp:521

References PString::eraseLastChar(), PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getNbline(), PLatexObj::getText(), platexobj_createLabelSearchLink(), and valueToString().

+ Here is the call 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 }
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_htmlStrHref()

PString platexobj_htmlStrHref ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 172 of file platexobj_html.cpp.

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

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

+ Here is the call graph for this function:

◆ platexobj_htmlStrHtml()

PString platexobj_htmlStrHtml ( 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 70 of file platexobj_html.cpp.

70  {
71  return obj.getText();
72 }

References PLatexObj::getText().

+ Here is the call graph for this function:

◆ platexobj_htmlStrNewLine()

PString platexobj_htmlStrNewLine ( 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 127 of file platexobj_html.cpp.

127  {
128  PString body("");
129  body += "<br />\n";
130  return body;
131 }

◆ platexobj_htmlStrQuote()

PString platexobj_htmlStrQuote ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 290 of file platexobj_html.cpp.

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

References PLatexObj::getId(), PLatexObj::getVecContent(), platexobj_htmlStr(), and valueToString().

+ Here is the call 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 }
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 }

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_htmlStrSpaceParagraph()

PString platexobj_htmlStrSpaceParagraph ( 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 137 of file platexobj_html.cpp.

137  {
138  PString body("");
139  body += "<br /><br />\n";
140  return body;
141 }

◆ platexobj_htmlStrSummary()

PString platexobj_htmlStrSummary ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 263 of file platexobj_html.cpp.

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

References PLatexObj::getId(), PLatexObj::getVecContent(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrSvgToPng()

PString platexobj_htmlStrSvgToPng ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 329 of file platexobj_html.cpp.

329  {
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 }
PPath getFileName() const
Get the name of the file, from last char to /.
Definition: PPath.cpp:172

References PPath::getFileName(), PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getName(), PPath::getParentDirectory(), PLatexObj::getText(), LATEX_IMAGE_OUTPUT_DIR, phoenix_popen(), platexobj_createLabelSearchLink(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrTabCell()

PString platexobj_htmlStrTabCell ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a tabular into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 600 of file platexobj_html.cpp.

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

References PLatexObj::getVecContent(), and platexobj_htmlStr().

+ Here is the call graph for this function:

◆ platexobj_htmlStrTabRow()

PString platexobj_htmlStrTabRow ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a tabular into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 587 of file platexobj_html.cpp.

587  {
588  PString body("");
589  body += "\t<tr>\n";
590  body += platexobj_htmlStr(outputMode, obj.getVecContent());
591  body += "\t</tr>\n";
592  return body;
593 }

References PLatexObj::getVecContent(), and platexobj_htmlStr().

+ Here is the call graph for this function:

◆ platexobj_htmlStrTabular()

PString platexobj_htmlStrTabular ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a tabular into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 574 of file platexobj_html.cpp.

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

References PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getVecContent(), platexobj_createLabelSearchLink(), platexobj_htmlStr(), and valueToString().

+ Here is the call 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_htmlStrTextFootnote()

PString platexobj_htmlStrTextFootnote ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 215 of file platexobj_html.cpp.

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

References PLatexObj::getId(), PLatexObj::getVecContent(), platexobj_htmlStr(), and valueToString().

+ Here is the call 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_htmlStrTimetable()

PString platexobj_htmlStrTimetable ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a timetable into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 419 of file platexobj_html.cpp.

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

References PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getVecContent(), platexobj_createLabelSearchLink(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrTimetableBlock()

PString platexobj_htmlStrTimetableBlock ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a timetable block into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 486 of file platexobj_html.cpp.

486  {
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 }
long unsigned int getRowSpan() const
Gets the rowSpan of the PLatexObj.
Definition: PLatexObj.cpp:578
long unsigned int getColSpan() const
Gets the colSpan of the PLatexObj.
Definition: PLatexObj.cpp:592

References PLatexObj::getColSpan(), PLatexObj::getId(), PLatexObj::getRowSpan(), PLatexObj::getText(), PLatexObj::getVecContent(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrTimetableDay()

PString platexobj_htmlStrTimetableDay ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a timetable day into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 465 of file platexobj_html.cpp.

465  {
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 }
PString platexobj_rawtext(const std::vector< PLatexObj > &vecObj)
Convert a PLatexObj in text.

References PLatexObj::getColSpan(), PLatexObj::getId(), PLatexObj::getRowSpan(), PLatexObj::getVecContent(), platexobj_rawtext(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrTimetableEmptyBlock()

PString platexobj_htmlStrTimetableEmptyBlock ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a timetable block into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 511 of file platexobj_html.cpp.

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

References PLatexObj::getColSpan(), PLatexObj::getId(), PLatexObj::getRowSpan(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrTimetableTime()

PString platexobj_htmlStrTimetableTime ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a timetable time into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 529 of file platexobj_html.cpp.

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

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

+ Here is the call graph for this function:

◆ platexobj_htmlStrTimetableTimeRow()

PString platexobj_htmlStrTimetableTimeRow ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a timetable time row into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 452 of file platexobj_html.cpp.

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

References PLatexObj::getId(), PLatexObj::getVecContent(), platexobj_htmlStr(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrTimetableWeek()

PString platexobj_htmlStrTimetableWeek ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a timetable week into a html string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted in html
Returns
html string

Definition at line 432 of file platexobj_html.cpp.

432  {
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 }
const std::vector< PLatexObj > & getComplexTitle() const
Gets the complexTitle of the PLatexObj.
Definition: PLatexObj.cpp:396

References PLatexObj::getComplexTitle(), PLatexObj::getId(), PLatexObj::getLabelName(), PLatexObj::getVecContent(), platexobj_createLabelSearchLink(), platexobj_htmlStr(), platexobj_rawtext(), and valueToString().

+ Here is the call graph for this function:

◆ platexobj_htmlStrUpdateStyle()

PString platexobj_htmlStrUpdateStyle ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 99 of file platexobj_html.cpp.

99  {
100  outputMode.currentStyle = obj.getName();
101  return "";
102 }
PString currentStyle
Current style to be used for the generated pages of the site.

References POutoutMode::currentStyle, and PLatexObj::getName().

+ Here is the call 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:

◆ platexobj_htmlStrWip()

PString platexobj_htmlStrWip ( POutoutMode outputMode,
const PLatexObj obj 
)

Convert a PLatexObj into a string.

Parameters
[out]outputMode: output mode of the html backend
obj: PLatexObj to be converted into a string
Returns
output string which contains the PLatexObj

Definition at line 248 of file platexobj_html.cpp.

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

References PLatexObj::getId(), PLatexObj::getVecContent(), platexobj_htmlStr(), and valueToString().

+ Here is the call 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: