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 672 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:352
const std::vector< long unsigned int > & getVecSecNumber() const
Gets the vecSecNumber of the PLatexObj.
Definition: PLatexObj.cpp:436
long unsigned int getId() const
Gets the id of the PLatexObj.
Definition: PLatexObj.cpp:282
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 353 of file platexobj_html.cpp.

353  {
354  PString body("");
355  if(cssClassName != ""){
356  body += "\t<"+hLevel+" id=\""+valueToString(obj.getId())+"\" class=\""+cssClassName+"\">" + getSectionTitle(outputMode, obj) + platexobj_createLabelSearchLink(obj.getLabelName())+"</"+hLevel+">\n";
357  }else{
358  body += "\t<"+hLevel+" id=\""+valueToString(obj.getId())+"\">" + getSectionTitle(outputMode, obj) + platexobj_createLabelSearchLink(obj.getLabelName())+"</"+hLevel+">\n";
359  }
360  return body;
361 }
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 558 of file platexobj_html.cpp.

558  {
559  PString body("");
560  body += "<"+baliseName + " id=\""+valueToString(obj.getId())+"\"";
561  if(cssClassName != ""){
562  body += " class=\""+cssClassName+"\"";
563  }
564  body += ">\n";
565  body += platexobj_htmlStr(outputMode, obj.getVecContent(), false, allowText);
566  body += "</"+baliseName+">"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
567  return body;
568 }
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:408
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 304 of file platexobj_html.cpp.

304  {
305  PString body("");
306  PString baseContent(obj.getName());
307  PPath fileName(baseContent);
308  if(fileName != ""){
309  if(fileName[0] != '/'){
310  fileName = PPath(obj.getText()).getParentDirectory() / fileName;
311  }
312  if(!fileName.isFileExist()){
313  fileName = PPath(LATEX_IMAGE_OUTPUT_DIR "/call_" + valueToString(obj.getId()) + ".dot");
314  fileName.saveFileContent(baseContent.eraseFirstLastChar("\n") + "\n");
315  }
316  PString outputFileName(LATEX_IMAGE_OUTPUT_DIR "/call_" + valueToString(obj.getId()) + ".png");
317  phoenix_popen("dot -T png -o " + outputFileName + " " + fileName);
318 
319  body += "<img id=\""+valueToString(obj.getId())+"\" src=\"" + outputFileName + "\"";
320  body += " alt=\"nothing\" />" + platexobj_createLabelSearchLink(obj.getLabelName());
321  }
322  return body;
323 }
#define LATEX_IMAGE_OUTPUT_DIR
Definition: PLatexObj_def.h:11
const PString & getName() const
Gets the name of the PLatexObj.
Definition: PLatexObj.cpp:324
const PString & getText() const
Gets the text of the PLatexObj.
Definition: PLatexObj.cpp:310
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:366
const PString & getAuthor() const
Gets the author of the PLatexObj.
Definition: PLatexObj.cpp:506
const PString & getDate() const
Gets the date of the PLatexObj.
Definition: PLatexObj.cpp:520

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 614 of file platexobj_html.cpp.

614  {
615  PString body("");
616  body += "<table id=\""+valueToString(obj.getId())+"\" class=\"columnsStyle\">\n";
617  body += "\t<tr>\n";
618  const PVecLatexObj & vecObj = obj.getVecContent();
619  for(PVecLatexObj::const_iterator it(vecObj.begin()); it != vecObj.end(); ++it){
620 // body += "\t\t<td>\n\t\t\t";
621  body += platexobj_htmlStr(outputMode, *it);
622 // body += "\n\t\t</td>\n";
623  }
624  body += "\t</tr>\n</table>\n";
625  return body;
626 }
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 277 of file platexobj_html.cpp.

277  {
278  PString body("");
279  body += "\n<details id=\""+valueToString(obj.getId())+"\" class=\"details\"><br />\n";
280  body += platexobj_htmlStr(outputMode, obj.getVecContent());
281  body += "</details>\n";
282  return body;
283 }

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 368 of file platexobj_html.cpp.

368  {
369  PString body("");
370  body += "<"+obj.getBalise()+" id=\""+valueToString(obj.getId())+"\" class=\"" + obj.getName() + "Style\">";
371 
373 
374  body += "</"+obj.getBalise()+">\n";
375  return body;
376 }
const PString & getBalise() const
Gets the balise of the PLatexObj.
Definition: PLatexObj.cpp:380

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 383 of file platexobj_html.cpp.

383  {
384  PString body("");
385  body += "<"+obj.getBalise()+" id=\""+valueToString(obj.getId())+"\" class=\"" + obj.getName() + "Style\">";
386 
388 
389  body += "</"+obj.getBalise()+">";
390  return body;
391 }

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 397 of file platexobj_html.cpp.

397  {
398  PString body("");
399  if(obj.getNbline() != 0lu){
400  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\">";
401  for(long unsigned int i(0lu); i < obj.getNbline(); ++i){
402  body += valueToString(i + 1lu) + "\n";
403  }
404  body += "</pre>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<pre class=\"source\">\n";
405  body += obj.getText().eraseLastChar("\n");
406  body += "</pre>\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
407  }else{
408  body += "<span id=\""+valueToString(obj.getId())+"\">";
409  body += obj.getText().eraseLastChar("\n");
410  body += "</span>";
411  }
412  return body;
413 }
long unsigned int getNbline() const
Gets the nbline of the PLatexObj.
Definition: PLatexObj.cpp:422
PString eraseLastChar(const PString &vecChar) const
Erase first and last char in a string.
Definition: PString.cpp:599

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 291 of file platexobj_html.cpp.

291  {
292  PString body("");
293  body += "\n<div id=\""+valueToString(obj.getId())+"\" class=\"quote\"><br />\n";
294  body += platexobj_htmlStr(outputMode, obj.getVecContent());
295  body += "</div>\n";
296  return body;
297 }

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 543 of file platexobj_html.cpp.

543  {
544  PString body("");
545  //We add a block in the timetable table
546  body += "<a id=\""+valueToString(obj.getId())+"\" href=\""+obj.getText()+"\"><div class=\"rendezvousStyle\"></div></a>";
547  return body;
548 }

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 264 of file platexobj_html.cpp.

264  {
265  PString body("");
266  body += "\n<summary id=\""+valueToString(obj.getId())+"\" class=\"summary\">\n";
267  body += platexobj_htmlStr(outputMode, obj.getVecContent());
268  body += "</summary>\n";
269  return body;
270 }

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 330 of file platexobj_html.cpp.

330  {
331  PString body("");
332  PPath fileName(obj.getName());
333  if(fileName != ""){
334  if(fileName[0] != '/'){
335  fileName = PPath(obj.getText()).getParentDirectory() / fileName;
336  }
337  PString outputFileName(PPath(LATEX_IMAGE_OUTPUT_DIR "/") + fileName.getFileName() + PPath("_") + valueToString(obj.getId()) + PPath(".png"));
338  phoenix_popen("convert " + PString(fileName) + " " + outputFileName);
339 
340  body += "<img id=\""+valueToString(obj.getId())+"\" src=\"" + outputFileName + "\"";
341  body += " alt=\"nothing\" />" + platexobj_createLabelSearchLink(obj.getLabelName());
342  }
343  return body;
344 }
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 601 of file platexobj_html.cpp.

601  {
602  PString body("");
603  body += "\t\t<td>\n";
604  body += platexobj_htmlStr(outputMode, obj.getVecContent());
605  body += "\t\t</td>\n";
606  return body;
607 }

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 588 of file platexobj_html.cpp.

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

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 575 of file platexobj_html.cpp.

575  {
576  PString body("");
577  body += "<table id=\""+valueToString(obj.getId())+"\" class=\"tabularStyle\">\n";
578  body += platexobj_htmlStr(outputMode, obj.getVecContent());
579  body += "</table>"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
580  return body;
581 }

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 420 of file platexobj_html.cpp.

420  {
421  PString body("");
422  body += "<table id=\""+valueToString(obj.getId())+"\" class=\"timetableStyle\">\n";
423  body += platexobj_htmlStr(outputMode, obj.getVecContent());
424  body += "</table>"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
425  return body;
426 }

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 487 of file platexobj_html.cpp.

487  {
488  PString body("");
489  //We add a block in the timetable table
490  body += "\t\t\t\t<td id=\""+valueToString(obj.getId()) + "\"";
491  if(obj.getRowSpan() != 0lu){
492  body += " rowspan=\""+valueToString(obj.getRowSpan())+"\"";
493  }
494  if(obj.getColSpan() != 0lu){
495  body += " colspan=\""+valueToString(obj.getColSpan())+"\"";
496  }
497  PString blockStyle("timetableBlockStyle");
498  if(obj.getText() != ""){
499  blockStyle = obj.getText();
500  }
501  body += " class=\""+blockStyle+"\">";
502  body += platexobj_htmlStr(outputMode, obj.getVecContent());
503  body += "</td>\n";
504  return body;
505 }
long unsigned int getRowSpan() const
Gets the rowSpan of the PLatexObj.
Definition: PLatexObj.cpp:576
long unsigned int getColSpan() const
Gets the colSpan of the PLatexObj.
Definition: PLatexObj.cpp:590

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 466 of file platexobj_html.cpp.

466  {
467  PString body("");
468  //We add a day header in the timetable table
469  body += "\t\t\t\t<td id=\""+valueToString(obj.getId());
470  if(obj.getRowSpan() != 0lu){
471  body += " rowspan=\""+valueToString(obj.getRowSpan())+"\"";
472  }
473  if(obj.getColSpan() != 0lu){
474  body += " colspan=\""+valueToString(obj.getColSpan())+"\"";
475  }
476  body += "\" class=\"timetableDayStyle\">";
477  body += platexobj_rawtext(obj.getVecContent());
478  body += "</td>\n";
479  return body;
480 }
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 512 of file platexobj_html.cpp.

512  {
513  PString body("");
514  //We add a block in the timetable table
515  body += "\t\t\t\t<td id=\""+valueToString(obj.getId()) + "\"";
516  if(obj.getRowSpan() != 0lu){
517  body += " rowspan=\""+valueToString(obj.getRowSpan())+"\"";
518  }
519  if(obj.getColSpan() != 0lu){
520  body += " colspan=\""+valueToString(obj.getColSpan())+"\"";
521  }
522  body += " class=\"timetableEmptyBlockStyle\"></td>\n";
523  return body;
524 }

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 530 of file platexobj_html.cpp.

530  {
531  PString body("");
532  //We add a block in the timetable table
533  body += "\t\t\t\t<td id=\""+valueToString(obj.getId())+"\" class=\"timetableTimeStyle\"><span class=\"timetableTimeTextStyle\">";
534  body += obj.getText();
535  body += "</span></td>\n";
536  return body;
537 }

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 453 of file platexobj_html.cpp.

453  {
454  PString body("");
455  body += "\t\t\t<tr id=\""+valueToString(obj.getId())+"\" class=\"timetableTimeRow\">\n";
456  body += platexobj_htmlStr(outputMode, obj.getVecContent());
457  body += "\t\t\t</tr>\n";
458  return body;
459 }

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 433 of file platexobj_html.cpp.

433  {
434  PString body("");
435  //We add a row in the timetable table
436  body += "\t<tr id=\""+valueToString(obj.getId())+"\" ><td class=\"timetableWeekRowStyle\">";
437  body += platexobj_rawtext(obj.getComplexTitle());
438  body += "</td></tr>\n";
439  body += "\t<tr class=\"timetableMainWeekRowStyle\"><td class=\"timetableMainWeekRowStyle\">\n";
440  //We we put the timetable of the current week
441  body += "\t\t<table id=\""+valueToString(obj.getId())+"\" class=\"timetableWeekStyle\">\n";
442  body += platexobj_htmlStr(outputMode, obj.getVecContent());
443  body += "\t\t</table>"+platexobj_createLabelSearchLink(obj.getLabelName())+"\n";
444  body += "\t</td></tr>\n";
445  return body;
446 }
const std::vector< PLatexObj > & getComplexTitle() const
Gets the complexTitle of the PLatexObj.
Definition: PLatexObj.cpp:394

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  if(!outputMode.isWorkInProgress){return "";}
250  PString body("");
251  body += "\n<table id=\""+valueToString(obj.getId())+"\" class=\"workinprogress\">\n";
252  body += "\t<tr><td class=\"workinprogressimage\"><img src=\"images/wip.png\" alt=\"wip\" /></td></tr>\n";
253 
254  body += "\t<tr><td class=\"workinprogresscontent\">" + platexobj_htmlStr(outputMode, obj.getVecContent()) + "</td></tr>\n";
255  body += "</table>\n";
256  return body;
257 }
bool isWorkInProgress
True to enable work in progress.

References PLatexObj::getId(), PLatexObj::getVecContent(), POutoutMode::isWorkInProgress, 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 649 of file platexobj_html.cpp.

649  {
650  if(vecMenu.size() == 0lu){return "";}
651  PString body("");
652  body += "\t\t<ul class=\"sommaire\">\n";
653  for(PVecMenu::const_iterator it(vecMenu.begin()); it != vecMenu.end(); ++it){
654  body += "\t\t\t<li><a href=\""+it->getLink()+"\">"+getSecNumberFromFileName(it->getLink()).replace("-", ".")+") ";
655 
656 // body += convertStrToHtml(it->getText());
657  body += it->getText();
658 
659  body += "</a></li>\n";
660  }
661  body += "\t\t</ul>\n";
662  return body;
663 }
PString replace(const PString &pattern, const PString &replaceStr) const
Replace a PString into an other PString.
Definition: PString.cpp:267
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 632 of file platexobj_html.cpp.

632  {
633  if(vecNb.size() == 0lu){return "";}
634  PString body("");
635  std::vector<long unsigned int>::const_iterator it(vecNb.begin());
636  body += valueToString(*it);
637  ++it;
638  while(it != vecNb.end()){
639  body += "." + valueToString(*it);
640  ++it;
641  }
642  return body;
643 }

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: