43#define DB_VIS_C DB_VIS_C1(m_t)
44#define DB_VIS_C1(x) x << "<!-- DB_VIS_C " << __LINE__ << " -->\n";
45#define DB_VIS_C2(y) DB_VIS_C2a(m_t,y)
46#define DB_VIS_C2a(x,y) x << "<!-- DB_VIS_C " << __LINE__ << " " << y << " -->\n";
51#define DB_VIS_C2a(x,y)
56 if (s.
empty())
return s;
59 const char *p=s.
data();
65 case ':': result+=
"_1";
break;
66 default: result+=c;
break;
74 return (name==
"align" ||
77 name==
"cellpadding" ||
78 name==
"cellspacing" ||
90 for (
const auto &n : children)
104 if (hasCaption && !inlineImage)
113 t <<
" <informalfigure>\n";
115 t <<
" <mediaobject>\n";
116 t <<
" <imageobject>\n";
124 if (!height.
empty() && !inlineImage) t <<
" width=\"50%\"";
130 t <<
" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name <<
"\">";
131 t <<
"</imagedata>\n";
132 t <<
" </imageobject>\n";
133 if (hasCaption && !inlineImage)
142 if (hasCaption && !inlineImage)
146 t <<
" </mediaobject>\n";
147 if (hasCaption && !inlineImage)
153 t <<
" </informalfigure>\n";
232 m_t <<
"<link xlink:href=\"";
244 m_t <<
"<?linebreak?>";
253 m_t <<
"<informaltable frame='bottom'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>\n";
254 m_t <<
"</entry></row></tbody></tgroup></informaltable>\n";
264 if (s.
enable())
m_t <<
"<emphasis role=\"bold\">";
else m_t <<
"</emphasis>";
267 if (s.
enable())
m_t <<
"<emphasis>";
else m_t <<
"</emphasis>";
272 if (s.
enable())
m_t <<
"<computeroutput>";
else m_t <<
"</computeroutput>";
275 if (s.
enable())
m_t <<
"<subscript>";
else m_t <<
"</subscript>";
278 if (s.
enable())
m_t <<
"<superscript>";
else m_t <<
"</superscript>";
281 if (s.
enable())
m_t <<
"<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
282 else m_t <<
"</entry></row></tbody></tgroup></informaltable>";
287 m_t <<
"<literallayout>";
292 m_t <<
"</literallayout>";
323 m_t <<
"<literallayout><computeroutput>";
331 m_t <<
"</computeroutput></literallayout>";
334 m_t <<
"<literallayout><computeroutput>";
336 m_t <<
"</computeroutput></literallayout>";
342 m_t <<
"<computeroutput>";
344 m_t <<
"</computeroutput>";
367 if (!fileName.empty())
380 "msc {"+s.
text()+
"}",
382 if (!fileName.empty())
395 for (
const auto &baseName: baseNameVector)
404 if (
Config_getBool(MERMAID_RENDER_MODE)!=MERMAID_RENDER_MODE_t::CLIENT_SIDE)
436 m_t <<
"<literallayout><computeroutput>";
447 m_t <<
"</computeroutput></literallayout>";
451 m_t <<
"<literallayout><computeroutput>";
459 m_t <<
"</computeroutput></literallayout>";
473 m_t <<
"<literallayout>";
475 m_t <<
"</literallayout>";
479 m_t <<
"<literallayout><computeroutput>";
488 m_t <<
"</computeroutput></literallayout>";
500 m_t <<
"<programlisting linenumbering=\"unnumbered\">";
513 std::unique_ptr<FileDef> fd;
550 else m_t <<
" <mediaobject>\n";
551 m_t <<
" <imageobject>\n";
552 m_t <<
" <imagedata ";
553 m_t <<
"align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.
relPath() << f.
name() <<
".png\"/>\n";
554 m_t <<
" </imageobject>\n";
556 else m_t <<
" </mediaobject>\n";
563 m_t <<
"<indexterm><primary>";
565 m_t <<
"</primary></indexterm>\n";
589 if (!opt.noPar())
filter(
"[");
591 if (!opt.noPar())
filter(
"]");
607 m_t <<
"<orderedlist>\n";
611 m_t <<
"<itemizedlist>\n";
616 m_t <<
"</orderedlist>\n";
620 m_t <<
"</itemizedlist>\n";
631 m_t <<
"<listitem override=\"unchecked\">";
635 m_t <<
"<listitem override=\"checked\">";
642 m_t <<
"</listitem>";
833 m_t <<
"<formalpara>\n";
841 std::visit(*
this,*s.
title());
851 m_t <<
"</formalpara>\n";
859 m_t <<
"</caution>\n";
862 m_t <<
"</important>\n";
865 m_t <<
"</warning>\n";
868 m_t <<
"</formalpara>\n";
886 m_t <<
"<itemizedlist>\n";
888 m_t <<
"</itemizedlist>\n";
900 m_t <<
"</listitem>\n";
912 std::visit(*
this,*s.
title());
915 m_t <<
"</section>\n";
926 m_t <<
"<itemizedlist>\n";
929 m_t <<
"</orderedlist>\n";
931 m_t <<
"</itemizedlist>\n";
941 bool isFirst = &std::get<DocHtmlListItem>(l->
children().
front())==&s;
944 for (
const auto &opt : s.
attribs())
946 if (opt.name==
"value")
949 int val = opt.value.toInt(&ok);
954 if (value>0 || isFirst)
956 for (
const auto &opt : l->
attribs())
958 if (opt.name==
"type")
961 type =
" numeration=\"arabic\"";
962 else if (opt.value==
"a")
963 type =
" numeration=\"loweralpha\"";
964 else if (opt.value==
"A")
965 type =
" numeration=\"upperalpha\"";
966 else if (opt.value==
"i")
967 type =
" numeration=\"lowerroman\"";
968 else if (opt.value==
"I")
969 type =
" numeration=\"upperroman\"";
971 else if (value==0 && opt.name==
"start")
974 int val = opt.value.toInt(&ok);
980 if (value>0 && !isFirst)
982 m_t <<
"</orderedlist>\n";
984 if (value>0 || isFirst)
986 m_t <<
"<orderedlist";
988 if (value>0)
m_t <<
" startingnumber=\"" << value <<
"\"";
992 m_t <<
"<listitem>\n";
994 m_t <<
"</listitem>\n";
1001 m_t <<
"<variablelist>\n";
1003 m_t <<
"</variablelist>\n";
1010 m_t <<
"<varlistentry><term>";
1012 m_t <<
"</term></varlistentry>\n";
1019 m_t <<
"<listitem>";
1021 m_t <<
"</listitem>\n";
1029 m_t <<
"<informaltable frame=\"all\">\n";
1030 m_t <<
" <tgroup cols=\"" << t.
numColumns() <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1034 m_t <<
" <colspec colname='c" << i+1 <<
"'/>\n";
1038 std::visit(*
this,*t.
caption());
1043 m_t <<
" </tgroup>\n";
1044 m_t <<
"</informaltable>\n";
1067 for (
const auto &opt : tr.
attribs())
1080 m_t <<
"</thead><tbody>\n";
1092 for (
const auto &opt : c.
attribs())
1094 if (opt.name==
"colspan")
1097 int cols = opt.value.toInt();
1101 else if (opt.name==
"rowspan")
1103 int extraRows = opt.value.toInt() - 1;
1104 m_t <<
" morerows='" << extraRows <<
"'";
1106 else if (opt.name==
"class")
1108 if (opt.value.startsWith(
"markdownTable"))
1110 if (opt.value.endsWith(
"Right"))
1112 m_t <<
" align='right'";
1114 else if (opt.value.endsWith(
"Left"))
1116 m_t <<
" align='left'";
1118 else if (opt.value.endsWith(
"Center"))
1120 m_t <<
" align='center'";
1150 m_t <<
"</caption>\n";
1164 if (href.
url().
at(0) !=
'#')
1180 m_t <<
"<para><emphasis role=\"bold\">";
1182 m_t <<
"</emphasis></para>";
1193 std::visit(*
this,*summary);
1205 m_t <<
"<formalpara><title>";
1207 m_t <<
"</title></formalpara>\n";
1239 bool exists =
false;
1247 if (!fileName.empty())
1260 bool exists =
false;
1268 if (!fileName.empty())
1281 bool exists =
false;
1289 if (!fileName.empty())
1312 if (
Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE)
return;
1351 m_t <<
"<tocentry>";
1353 m_t <<
"</tocentry>\n";
1370 m_t <<
" <formalpara>\n";
1371 m_t <<
" <title>\n";
1381 m_t <<
"</title>\n";
1383 m_t <<
" <table frame=\"all\">\n";
1389 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1390 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1392 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1393 for (
int i = 1; i <= ncols; i++)
1395 if (i == ncols)
m_t <<
" <colspec colwidth=\"4*\"/>\n";
1396 else m_t <<
" <colspec colwidth=\"1*\"/>\n";
1398 m_t <<
" <tbody>\n";
1400 m_t <<
" </tbody>\n";
1401 m_t <<
" </tgroup>\n";
1402 m_t <<
" </table>\n";
1403 m_t <<
" </para>\n";
1404 m_t <<
" </formalpara>\n";
1448 std::visit(*
this,type);
1455 m_t <<
"<entry></entry>\n";
1467 std::visit(*
this,param);
1475 std::visit(*
this,par);
1477 m_t <<
"</entry>\n";
1486 m_t <<
"<para><link linkend=\"_";
1518 m_t <<
"<blockquote>";
1520 m_t <<
"</blockquote>";
1547 if (!anchor.
empty())
1600 for (
const auto &bName: baseNameVector)
1607 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1623 if (
Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE)
return;
1646 if (
Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE)
return;
1657 visitPreStart(
m_t, children, hasCaption, relPath + shortName +
"." + imgExt, width, height);
1676 int srcLine,
bool newFile
1681 baseName.prepend(
"msc_");
1685 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1714 int srcLine,
bool newFile
1719 baseName.prepend(
"dia_");
1723 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1752 int srcLine,
bool newFile
1757 baseName.prepend(
"dot_");
1762 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
"." + imgExt, width, height);
static CodeFragmentManager & instance()
void parseCodeFragment(OutputCodeList &codeOutList, const DString &fileName, const DString &blockId, const DString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
virtual void parseCode(OutputCodeList &codeOutList, const DString &scopeName, const DString &input, SrcLangExt lang, bool stripCodeComments, const CodeParserOptions &options)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
DString mid(size_t index, size_t len=npos) const
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
char & at(size_t i)
Returns a reference to the character at index i.
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
const std::string & str() const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Node representing an anchor.
Node representing an auto List.
Node representing an item of a auto list.
Node representing a citation of some bibliographic reference.
CiteInfoOption option() const
Node representing a dia file.
Node representing a dot file.
Node representing an emoji.
Node representing a Hypertext reference.
Node representing a horizontal ruler.
Node representing an HTML blockquote.
Node representing a HTML table caption.
Node representing a HTML table cell.
const HtmlAttribList & attribs() const
Node representing a HTML description data.
Node representing a Html description list.
Node representing a Html description item.
const DocNodeVariant * summary() const
Node representing a Html list.
const HtmlAttribList & attribs() const
Node representing a HTML list item.
const HtmlAttribList & attribs() const
Node representing a HTML table row.
const HtmlAttribList & attribs() const
Node representing a HTML table.
size_t numColumns() const
const DocNodeVariant * caption() const
Node representing an image.
bool isInlineImage() const
Node representing a include/dontinclude operator block.
bool stripCodeComments() const
DString exampleFile() const
DString includeFileName() const
Node representing an included text block from file.
bool stripCodeComments() const
DString exampleFile() const
DString extension() const
Node representing an entry in the index.
Node representing an internal section of documentation.
Node representing an internal reference to some item.
Node representing a line break.
Node representing a link to some item.
Node representing a word that can be linked to something.
Node representing a mermaid file.
Node representing a msc file.
DocNodeVariant * parent()
Node representing an block of paragraphs.
Node representing a paragraph in the documentation tree.
Node representing a parameter list.
const DocNodeList & parameters() const
const DocNodeList & paramTypes() const
DocParamSect::Direction direction() const
const DocNodeList & paragraphs() const
Node representing a parameter section.
bool hasInOutSpecifier() const
bool hasTypeSpecifier() const
Node representing a uml file.
Node representing a reference to some item.
DString targetTitle() const
Root node of documentation tree.
Node representing a reference to a section.
Node representing a list of section references.
Node representing a normal section.
const DocNodeVariant * title() const
Node representing a separator.
Node representing a simple list.
Node representing a simple list item.
const DocNodeVariant * paragraph() const
Node representing a simple section.
const DocNodeVariant * title() const
Node representing a separator between two simple sections of the same type.
Node representing a style change.
Node representing a special symbol.
HtmlEntityMapper::SymType symbol() const
Root node of a text fragment.
Node representing a simple section title.
Node representing a URL (or email address).
Node representing a verbatim, unparsed text fragment.
const DocNodeList & children() const
DString exampleFile() const
Node representing a VHDL flow chart.
void pushHidden(bool hide)
CodeParserInterface & getCodeParser(const DString &langExt)
Node representing some amount of white space.
Node representing a word.
Node representing an item of a cross-referenced list.
void endDiaFile(bool hasCaption)
void operator()(const DocWord &)
void startPlantUmlFile(const DString &fileName, const DString &relPath, const DString &width, const DString &height, bool hasCaption, const DocNodeList &children, const DString &srcFile, int srcLine)
void startDiaFile(const DString &fileName, const DString &relPath, const DString &width, const DString &height, bool hasCaption, const DocNodeList &children, const DString &srcFile, int srcLine, bool newFile=true)
void visitChildren(const T &t)
void visitPreStart(TextStream &t, const DocNodeList &children, bool hasCaption, const DString &name, const DString &width, const DString &height, bool inlineImage=false)
void endMermaidFile(bool hasCaption)
void writeMermaidFile(const DString &fileName, const DocVerbatim &s)
void startMermaidFile(const DString &fileName, const DString &relPath, const DString &width, const DString &height, bool hasCaption, const DocNodeList &children, const DString &srcFile, int srcLine)
void endPlantUmlFile(bool hasCaption)
void visitCaption(const DocNodeList &children)
void writeDotFile(const DString &fileName, const DocVerbatim &s, bool newFile=true)
void endDotFile(bool hasCaption)
void startDotFile(const DString &fileName, const DString &relPath, const DString &width, const DString &height, bool hasCaption, const DocNodeList &children, const DString &srcFile, int srcLine, bool newFile=true)
DocbookDocVisitor(TextStream &t, OutputCodeList &ci, const DString &langExt)
void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=false)
void startLink(const DString &file, const DString &anchor)
void endMscFile(bool hasCaption)
void startMscFile(const DString &fileName, const DString &relPath, const DString &width, const DString &height, bool hasCaption, const DocNodeList &children, const DString &srcFile, int srcLine, bool newFile=true)
void filter(const DString &str, bool retainNewLine=false, bool citeEntry=false)
void writePlantUMLFile(const DString &fileName, const DocVerbatim &s)
void writeDiaFile(const DString &fileName, const DocVerbatim &s)
void writeMscFile(const DString &fileName, const DocVerbatim &s, bool newFile=true)
static DString convertToDocbook(const DString &s, bool retainNewline=false, bool citeEntry=false)
static FileNameLinkedMap * imageNameLinkedMap
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity.
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
A model of a file symbol.
virtual DString absFilePath() const =0
Minimal replacement for QFileInfo.
std::string fileName() const
std::string dirPath(bool absPath=true) const
FileDef * findFileDef(const DString &n, bool &ambig) const
Returns the file definition in fnMap that matches the file name n.
bool empty() const
checks whether the container is empty
T & front()
access the first element
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
const char * docbook(SymType symb) const
Access routine to the docbook code of the HTML entity.
static MermaidManager & instance()
static DString imageExtension(ImageFormat imageFormat)
static ImageFormat convertToImageFormat(OutputFormat outputFormat)
void generateMermaidOutput(const DString &baseName, const DString &outDir, ImageFormat format, bool toIndex)
Register a generated Mermaid image with the index.
DString writeMermaidSource(const DString &outDirArg, const DString &fileName, const DString &content, ImageFormat format, const DString &srcFile, int srcLine)
Write a Mermaid source file and register it for CLI rendering.
Class representing a list of different code generators.
void generatePlantUMLOutput(const DString &baseName, const DString &outDir, OutputFormat format, bool toIndex)
Convert a PlantUML file to an image.
StringVector writePlantUMLSource(const DString &outDirArg, const DString &fileName, const DString &content, OutputFormat format, const DString &engine, const DString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
static PlantumlManager & instance()
Text streaming class that buffers data.
virtual DString trExceptions()=0
virtual DString trReturns()=0
virtual DString trParameters()=0
virtual DString trCopyright()=0
virtual DString trWarning()=0
virtual DString trSince()=0
virtual DString trNote()=0
virtual DString trAuthor(bool first_capital, bool singular)=0
virtual DString trReturnValues()=0
virtual DString trVersion()=0
virtual DString trTemplateParameters()=0
virtual DString trImportant()=0
virtual DString trPrecondition()=0
virtual DString trAttention()=0
virtual DString trInvariant()=0
virtual DString trRemarks()=0
virtual DString trDate()=0
virtual DString trSeeAlso()=0
virtual DString trPostcondition()=0
#define Config_getBool(name)
#define Config_getString(name)
void writeDiaGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, DiaOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
static DString filterId(const DString &s)
static bool supportedHtmlAttribute(const DString &name)
void writeDotGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, GraphOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
std::unique_ptr< FileDef > createFileDef(const DString &p, const DString &n, const DString &ref, const DString &dn)
Translator * theTranslator
void writeMscGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, MscOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
Portable versions of functions that are platform dependent.
Options to configure the code parser.
CodeParserOptions & setStartLine(int lineNr)
CodeParserOptions & setShowLineNumbers(bool enable)
CodeParserOptions & setFileDef(const FileDef *fd)
DString writeInlineGraph(const DString &baseName, const DString &extension, const DString &content, bool &exists)
DString getFileNameExtension(const DString &fn)
bool readInputFile(const DString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
bool copyFile(const DString &src, const DString &dest)
Copies the contents of file with name src to the newly created file with name dest.
DString getDotImageExtension()
DString makeBaseName(const DString &name, const DString &ext)
DString stripPath(const DString &s)
SrcLangExt getLanguageFromCodeLang(DString &fileName)
Routine to handle the language attribute of the \code command.
A bunch of utility functions.