41#define DB_VIS_C DB_VIS_C1(m_t)
42#define DB_VIS_C1(x) x << "<!-- DB_VIS_C " << __LINE__ << " -->\n";
43#define DB_VIS_C2(y) DB_VIS_C2a(m_t,y)
44#define DB_VIS_C2a(x,y) x << "<!-- DB_VIS_C " << __LINE__ << " " << y << " -->\n";
49#define DB_VIS_C2a(x,y)
54 if (s.
empty())
return s;
57 const char *p=s.
data();
63 case ':': result+=
"_1";
break;
64 default: result+=c;
break;
72 return (name==
"align" ||
75 name==
"cellpadding" ||
76 name==
"cellspacing" ||
88 for (
const auto &n : children)
102 if (hasCaption && !inlineImage)
111 t <<
" <informalfigure>\n";
113 t <<
" <mediaobject>\n";
114 t <<
" <imageobject>\n";
122 if (!height.
empty() && !inlineImage) t <<
" width=\"50%\"";
128 t <<
" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name <<
"\">";
129 t <<
"</imagedata>\n";
130 t <<
" </imageobject>\n";
131 if (hasCaption && !inlineImage)
140 if (hasCaption && !inlineImage)
144 t <<
" </mediaobject>\n";
145 if (hasCaption && !inlineImage)
151 t <<
" </informalfigure>\n";
230 m_t <<
"<link xlink:href=\"";
242 m_t <<
"<?linebreak?>";
251 m_t <<
"<informaltable frame='bottom'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>\n";
252 m_t <<
"</entry></row></tbody></tgroup></informaltable>\n";
262 if (s.
enable())
m_t <<
"<emphasis role=\"bold\">";
else m_t <<
"</emphasis>";
265 if (s.
enable())
m_t <<
"<emphasis>";
else m_t <<
"</emphasis>";
270 if (s.
enable())
m_t <<
"<computeroutput>";
else m_t <<
"</computeroutput>";
273 if (s.
enable())
m_t <<
"<subscript>";
else m_t <<
"</subscript>";
276 if (s.
enable())
m_t <<
"<superscript>";
else m_t <<
"</superscript>";
279 if (s.
enable())
m_t <<
"<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
280 else m_t <<
"</entry></row></tbody></tgroup></informaltable>";
285 m_t <<
"<literallayout>";
290 m_t <<
"</literallayout>";
321 m_t <<
"<literallayout><computeroutput>";
329 m_t <<
"</computeroutput></literallayout>";
332 m_t <<
"<literallayout><computeroutput>";
334 m_t <<
"</computeroutput></literallayout>";
340 m_t <<
"<computeroutput>";
342 m_t <<
"</computeroutput>";
365 if (!fileName.empty())
378 "msc {"+s.
text()+
"}",
380 if (!fileName.empty())
393 for (
const auto &baseName: baseNameVector)
402 if (
Config_getBool(MERMAID_RENDER_MODE)!=MERMAID_RENDER_MODE_t::CLIENT_SIDE)
434 m_t <<
"<literallayout><computeroutput>";
445 m_t <<
"</computeroutput></literallayout>";
449 m_t <<
"<literallayout><computeroutput>";
457 m_t <<
"</computeroutput></literallayout>";
471 m_t <<
"<literallayout>";
473 m_t <<
"</literallayout>";
477 m_t <<
"<literallayout><computeroutput>";
486 m_t <<
"</computeroutput></literallayout>";
498 m_t <<
"<programlisting linenumbering=\"unnumbered\">";
511 std::unique_ptr<FileDef> fd;
548 else m_t <<
" <mediaobject>\n";
549 m_t <<
" <imageobject>\n";
550 m_t <<
" <imagedata ";
551 m_t <<
"align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.
relPath() << f.
name() <<
".png\"/>\n";
552 m_t <<
" </imageobject>\n";
554 else m_t <<
" </mediaobject>\n";
561 m_t <<
"<indexterm><primary>";
563 m_t <<
"</primary></indexterm>\n";
587 if (!opt.noPar())
filter(
"[");
589 if (!opt.noPar())
filter(
"]");
605 m_t <<
"<orderedlist>\n";
609 m_t <<
"<itemizedlist>\n";
614 m_t <<
"</orderedlist>\n";
618 m_t <<
"</itemizedlist>\n";
629 m_t <<
"<listitem override=\"unchecked\">";
633 m_t <<
"<listitem override=\"checked\">";
640 m_t <<
"</listitem>";
831 m_t <<
"<formalpara>\n";
839 std::visit(*
this,*s.
title());
849 m_t <<
"</formalpara>\n";
857 m_t <<
"</caution>\n";
860 m_t <<
"</important>\n";
863 m_t <<
"</warning>\n";
866 m_t <<
"</formalpara>\n";
884 m_t <<
"<itemizedlist>\n";
886 m_t <<
"</itemizedlist>\n";
898 m_t <<
"</listitem>\n";
910 std::visit(*
this,*s.
title());
913 m_t <<
"</section>\n";
924 m_t <<
"<itemizedlist>\n";
927 m_t <<
"</orderedlist>\n";
929 m_t <<
"</itemizedlist>\n";
939 bool isFirst = &std::get<DocHtmlListItem>(l->
children().
front())==&s;
942 for (
const auto &opt : s.
attribs())
944 if (opt.name==
"value")
947 int val = opt.value.toInt(&ok);
952 if (value>0 || isFirst)
954 for (
const auto &opt : l->
attribs())
956 if (opt.name==
"type")
959 type =
" numeration=\"arabic\"";
960 else if (opt.value==
"a")
961 type =
" numeration=\"loweralpha\"";
962 else if (opt.value==
"A")
963 type =
" numeration=\"upperalpha\"";
964 else if (opt.value==
"i")
965 type =
" numeration=\"lowerroman\"";
966 else if (opt.value==
"I")
967 type =
" numeration=\"upperroman\"";
969 else if (value==0 && opt.name==
"start")
972 int val = opt.value.toInt(&ok);
978 if (value>0 && !isFirst)
980 m_t <<
"</orderedlist>\n";
982 if (value>0 || isFirst)
984 m_t <<
"<orderedlist";
986 if (value>0)
m_t <<
" startingnumber=\"" << value <<
"\"";
990 m_t <<
"<listitem>\n";
992 m_t <<
"</listitem>\n";
999 m_t <<
"<variablelist>\n";
1001 m_t <<
"</variablelist>\n";
1008 m_t <<
"<varlistentry><term>";
1010 m_t <<
"</term></varlistentry>\n";
1017 m_t <<
"<listitem>";
1019 m_t <<
"</listitem>\n";
1027 m_t <<
"<informaltable frame=\"all\">\n";
1028 m_t <<
" <tgroup cols=\"" << t.
numColumns() <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1032 m_t <<
" <colspec colname='c" << i+1 <<
"'/>\n";
1036 std::visit(*
this,*t.
caption());
1041 m_t <<
" </tgroup>\n";
1042 m_t <<
"</informaltable>\n";
1065 for (
const auto &opt : tr.
attribs())
1078 m_t <<
"</thead><tbody>\n";
1090 for (
const auto &opt : c.
attribs())
1092 if (opt.name==
"colspan")
1095 int cols = opt.value.toInt();
1099 else if (opt.name==
"rowspan")
1101 int extraRows = opt.value.toInt() - 1;
1102 m_t <<
" morerows='" << extraRows <<
"'";
1104 else if (opt.name==
"class")
1106 if (opt.value.startsWith(
"markdownTable"))
1108 if (opt.value.endsWith(
"Right"))
1110 m_t <<
" align='right'";
1112 else if (opt.value.endsWith(
"Left"))
1114 m_t <<
" align='left'";
1116 else if (opt.value.endsWith(
"Center"))
1118 m_t <<
" align='center'";
1148 m_t <<
"</caption>\n";
1162 if (href.
url().
at(0) !=
'#')
1178 m_t <<
"<para><emphasis role=\"bold\">";
1180 m_t <<
"</emphasis></para>";
1191 std::visit(*
this,*summary);
1203 m_t <<
"<formalpara><title>";
1205 m_t <<
"</title></formalpara>\n";
1237 bool exists =
false;
1245 if (!fileName.empty())
1258 bool exists =
false;
1266 if (!fileName.empty())
1279 bool exists =
false;
1287 if (!fileName.empty())
1310 if (
Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE)
return;
1349 m_t <<
"<tocentry>";
1351 m_t <<
"</tocentry>\n";
1368 m_t <<
" <formalpara>\n";
1369 m_t <<
" <title>\n";
1379 m_t <<
"</title>\n";
1381 m_t <<
" <table frame=\"all\">\n";
1387 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1388 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1390 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1391 for (
int i = 1; i <= ncols; i++)
1393 if (i == ncols)
m_t <<
" <colspec colwidth=\"4*\"/>\n";
1394 else m_t <<
" <colspec colwidth=\"1*\"/>\n";
1396 m_t <<
" <tbody>\n";
1398 m_t <<
" </tbody>\n";
1399 m_t <<
" </tgroup>\n";
1400 m_t <<
" </table>\n";
1401 m_t <<
" </para>\n";
1402 m_t <<
" </formalpara>\n";
1446 std::visit(*
this,type);
1453 m_t <<
"<entry></entry>\n";
1465 std::visit(*
this,param);
1473 std::visit(*
this,par);
1475 m_t <<
"</entry>\n";
1484 m_t <<
"<para><link linkend=\"_";
1516 m_t <<
"<blockquote>";
1518 m_t <<
"</blockquote>";
1545 if (!anchor.
empty())
1598 for (
const auto &bName: baseNameVector)
1605 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1621 if (
Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE)
return;
1644 if (
Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE)
return;
1655 visitPreStart(
m_t, children, hasCaption, relPath + shortName +
"." + imgExt, width, height);
1674 int srcLine,
bool newFile
1679 baseName.prepend(
"msc_");
1683 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1712 int srcLine,
bool newFile
1717 baseName.prepend(
"dia_");
1721 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1750 int srcLine,
bool newFile
1755 baseName.prepend(
"dot_");
1760 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.