62 if(!
p_run)
return false;
135 else if(
parseWip(parent, textObj)){}
180 else if(
parseUrl(parent, textObj)){}
270 std::cerr <<
"PMarkdownParser::parseIncludeGraphic : expect '(' after '!["+option+
"]' instead of '"<<
p_parser->
getNextChar()<<
"'" << std::endl;
287 if(buildFileName ==
""){
return true;}
335 if(buildFileName ==
""){
341 buildFileName = link;
417 vecItemLevel.push_back(std::pair<size_t, PLatexObj>(itemLevel, itemObj));
434 while(i < currentCol){
435 char ch = currentRow[i];
457 if(vecLevel.back() >= itemLevel){
458 while(vecLevel.back() > itemLevel && vecLevel.size() > 1lu){
461 if(vecLevel.size() <= 1lu){
462 return currentParent;
464 for(
size_t i(1lu); i < vecLevel.size(); ++i){
467 if(lastItemize.
getType() == listItemType){
468 currentParent = &lastItemize;
471 std::cerr <<
"PMarkdownParser::getProperParent : unextected PLatexObj of type " << lastItemize.
getType() << std::endl;
476 return currentParent;
480 for(
size_t i(1lu); i < vecLevel.size(); ++i){
483 if(lastItemize.
getType() == listItemType){
484 currentParent = &lastItemize;
487 std::cerr <<
"PMarkdownParser::getProperParent : unextected PLatexObj of type " << lastItemize.
getType() << std::endl;
493 newItemize.
setType(listItemType);
499 vecLevel.push_back(itemLevel);
500 return currentParent;
509 std::vector<size_t> parentLevel;
510 parentLevel.push_back(vecItemLevel.front().first);
511 for(std::vector<std::pair<size_t, PLatexObj> >::const_iterator it(vecItemLevel.begin()); it != vecItemLevel.end(); ++it){
514 if(currentParent == NULL){
return;}
526 if(!
isItem(
true)){
return false;}
530 std::vector<std::pair<size_t, PLatexObj> > vecItemLevel;
566 vecItemLevel.push_back(std::pair<size_t, PLatexObj>(itemLevel, itemObj));
578 if(listFigure ==
""){
588 while(i < currentCol){
589 char ch = currentRow[i];
612 std::vector<std::pair<size_t, PLatexObj> > vecItemLevel;
630 if(beginPatern !=
""){
643 std::cerr <<
"PMarkdownParser::parseVecLatexObj : the parser is stucked at the position :" << std::endl <<
"\t" <<
p_parser->
getLocation() << std::endl;
#define LATEX_IMAGE_OUTPUT_DIR
#define LATEX_RESSOURCES_OUTPUT_DIR
#define LATEX_VIDEO_OUTPUT_DIR
describe a CSS environement for latex
const PString & getBalise() const
Gets the balise of the PEnvironement.
void setSeparator(const PString &separator)
Initialise la liste des caractères séparateurs.
PString getCurrentRow() const
Get the current parsed row.
size_t getColumn() const
Fonction qui renvoie le numéro de la colonne du caractère courant.
PString getUntilKeyWithoutPatern(const PString &patern)
Renvoie la chaine de caractère du caractère courant jusqu'à patern exclu.
PString getUntilKeyWithoutPaternRecurse(const PString &patern, const PString &beginPatern, const PString &allowedCharAfterBegin)
Get the string until end sequence and take account recursive patern (embeded strings)
PString getStrComposedOf(const PString &charset)
Get string composed of the characters in the string charset.
void setWhiteSpace(const PString &whiteSpace)
Initialise la liste des caractères blancs.
bool isMatchRewind(const PString &patern)
Do a isMatch and then go back at the previous position.
bool isMatchToken(const PString &patern)
Says if the patern match with the current caracters of the PFileParser but treats the string as a tok...
bool isMatch(const PString &patern)
Says if the patern match with the current caracters of the PFileParser.
void popPosition()
Get to the last saved position of the PFileParser in the current file.
PLocation getLocation() const
Fonction qui renvoie la PLocation du PFileParser.
PPath getFileName() const
Fonction qui renvoie le nom du fichier que l'on a ouvert.
void pushPosition()
Remember the current position of the PFileParser in the current file.
size_t getCurrentCharIdx() const
Return the index of the current character.
bool isEndOfFile() const
Dit si on est à la fin du fichier.
char getNextChar()
Fonction qui renvoie le prochain caractère du fichier courant.
PMapExtraEnv p_vecExtraEnv
Vector of extra environements.
PLatexObj p_currentSource
Current completed source.
void incrementCurrentChar(PLatexObj &textObj)
Increment current char position.
PPath copyFile(const PPath &outputDir, const PPath &fileName)
Copy a file.
PLatexObj p_currentText
Current text.
bool playTextLatexObj(PLatexObj &parent, PLatexObj &textObj, bool isRemoveFirstLastSpace=false)
Play the text latex obj.
void clearLatexObj(PLatexObj &obj)
Clear a latex obj.
void addLatexObj(PLatexObj &parent, const PLatexObj &obj)
Add latex obj in parent.
std::vector< PString > p_vecNameMarkdownExtraParser
Vector of the markdown name of the extra environement.
PString getOptionStringBetweenHook()
Get optional string between hooks [...].
std::vector< PString > p_vecNameMarkdownExtraEnv
Vector of the name of the extra environement (for markdown)
bool parseGenericLatexObj(PLatexObj &parent, PLatexObj &textObj)
Parse the generic latex function which have to be used in the latex parser and the markdown parser to...
PVecParserEnv p_vecExtraParser
Vector of extra parser.
void setLink(const PString &link)
Sets the link of the PLatexObj.
void setSourceFile(const PString &sourceFile)
Sets the sourceFile of the PLatexObj.
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
void setComplexTitle(const std::vector< PLatexObj > &complexTitle)
Sets the complexTitle of the PLatexObj.
void setBalise(const PString &balise)
Sets the balise of the PLatexObj.
const PLatexType::PLatexType & getType() const
Gets the type of the PLatexObj.
const PString & getName() const
Gets the name of the PLatexObj.
void setNbline(long unsigned int nbline)
Sets the nbline of the PLatexObj.
void setName(const PString &name)
Sets the name of the PLatexObj.
void setType(const PLatexType::PLatexType &type)
Sets the type of the PLatexObj.
void setText(const PString &text)
Sets the text of the PLatexObj.
void setSourceLine(size_t sourceLine)
Sets the sourceLine of the PLatexObj.
void setSubTitle(const PString &subTitle)
Sets the subTitle of the PLatexObj.
size_t getLine() const
renvoie la ligne du PLocation
PPath getFileName() const
renvoie le fichier du PLocation
Class which parses Markdown as into for web site generator.
bool parseEnvDecoration(PLatexObj &parent, PLatexObj &textObj, const PString &patern, const PString &cssStyle, PLatexType::PLatexType type, const PString &balise)
Parse a text decoration (bold, italic, etc)
bool parseItemize(PLatexObj &parent, PLatexObj &textObj)
Parse some itemize.
bool parseSectionTitle(PLatexObj &parent, PLatexObj &textObj, const PString &functionName, PLatexType::PLatexType type)
Parse all the functions which have complex mono parameter in braces.
PLatexObj * getProperParent(PLatexObj &parent, std::vector< size_t > &vecLevel, size_t itemLevel, PLatexType::PLatexType listItemType)
Get the proper parent for the item with the given level.
void copyPMarkdownParser(const PMarkdownParser &other)
Copy function of PMarkdownParser.
bool parseItem(std::vector< std::pair< size_t, PLatexObj > > &vecItemLevel)
Parse an item in the markdown itemize.
virtual void preLoadFile()
Initialisation to be done just before loading a file.
bool parseHref(PLatexObj &parent, PLatexObj &textObj)
Parse latex Href.
bool parseUrl(PLatexObj &parent, PLatexObj &textObj)
Parse latex url.
virtual ~PMarkdownParser()
Destructor of PMarkdownParser.
bool parseExtraEnvironement(PLatexObj &parent, PLatexObj &textObj)
Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...)
bool parseEnumerateItem(std::vector< std::pair< size_t, PLatexObj > > &vecItemLevel)
Parse an item in the markdown enumerate.
bool parseTextDecoration(PLatexObj &parent, PLatexObj &textObj, const PString &patern, const PString &cssStyle, PLatexType::PLatexType type, const PString &balise)
Parse a text decoration (bold, italic, etc)
bool parseItemLatexObj(PLatexObj &parent, PLatexObj &textObj)
Parse all the latex obj in item, but in markdown style.
bool parseWip(PLatexObj &parent, PLatexObj &textObj)
Parse a work in progress.
bool parseEnvLatexObj(PLatexObj &parent, PLatexObj &textObj)
Parse all the latex obj in environement, but in markdown style.
bool parsePercent(PLatexObj &parent, PLatexObj &textObj)
Parse latex percent.
bool isItem(bool rewind=false)
Say if there is no space between the last return and the current char.
bool parseComment(PLatexObj &parent, PLatexObj &textObj)
Parse a new line.
bool parseIncludeGraphic(PLatexObj &parent, PLatexObj &textObj)
Parse the includegraphic command.
bool parseNewLine(PLatexObj &parent, PLatexObj &textObj)
Parse a new line.
bool parseComplexMonoParam(PLatexObj &parent, PLatexObj &textObj, const PString &functionName, PLatexType::PLatexType type)
Parse all the functions which have complex mono parameter in braces {...}.
virtual bool parseFile()
Parse the input file.
virtual void postLoadFile()
Initialisation to be done just after loading a file.
PMarkdownParser(const PString &installPrefix="")
Default constructor of PMarkdownParser.
bool isEnumerateItem(bool rewind=false)
Say if there is no space between the last return and the current char.
PMarkdownParser & operator=(const PMarkdownParser &other)
Definition of equal operator of PMarkdownParser.
bool parseEnumerate(PLatexObj &parent, PLatexObj &textObj)
Parse some enumerate.
void parseVecLatexObj(PLatexObj &parent, PLatexObj &textObj, const PString &beginPatern, const PString &endPatern)
Parse a vector of latex object.
bool parseAllLatexObj(PLatexObj &parent, PLatexObj &textObj)
Parse all the latex obj, but in markdown style.
void initialisationPMarkdownParser()
Initialisation function of the class PMarkdownParser.
bool parseExtraParser(PLatexObj &parent, PLatexObj &textObj)
Parse extra environement (terminal, cplusplus, cmake, conseil, attention, ...)
void insertItemInItemize(PLatexObj &parent, const std::vector< std::pair< size_t, PLatexObj > > &vecItemLevel, PLatexType::PLatexType listItemType)
Insert the item in the proper itemize.
void errorAt()
Write a parsing error.
PFileParser * p_parser
Parser helper for the config file.
bool p_run
Run the parsing if true.
void stopParsing()
Stop the parsing of all the files.
Path of a directory or a file.
PPath & eraseExtension()
Erase the extension of the PPath.
PString getExtension() const
Get file extension.
PPath getFileName() const
Get the name of the file, from last char to /.
PString eraseChar(char ch) const
Erase char ch of current string.
bool isSameBegining(const PString &beginStr) const
Say if the current PString has the same begining of beginStr.
size_t count(char ch) const
Count the number of char ch in the current PString.
PString eraseFirstLastChar(const PString &vecChar) const
Erase first and last char in a string.
PLatexType
Type of the PLatexObj.
PString parser_makeHighlighting(const PString &strContent, const PParserEnv &parser)
Do the highlighting of the input text.
PParserEnv getParserEnv(const PVecParserEnv &vecParser, const PString &nameParser)
Get the parser env.