42#define DB_VIS_C DB_VIS_C1(m_t)
43#define DB_VIS_C1(x) x << "<!-- DB_VIS_C " << __LINE__ << " -->\n";
44#define DB_VIS_C2(y) DB_VIS_C2a(m_t,y)
45#define DB_VIS_C2a(x,y) x << "<!-- DB_VIS_C " << __LINE__ << " " << y << " -->\n";
50#define DB_VIS_C2a(x,y)
58 const char *p=s.
data();
64 case ':': result+=
"_1";
break;
65 default: result+=c;
break;
73 return (name==
"align" ||
76 name==
"cellpadding" ||
77 name==
"cellspacing" ||
89 for (
const auto &n : children)
103 if (hasCaption && !inlineImage)
112 t <<
" <informalfigure>\n";
114 t <<
" <mediaobject>\n";
115 t <<
" <imageobject>\n";
123 if (!height.
isEmpty() && !inlineImage) t <<
" width=\"50%\"";
129 t <<
" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name <<
"\">";
130 t <<
"</imagedata>\n";
131 t <<
" </imageobject>\n";
132 if (hasCaption && !inlineImage)
141 if (hasCaption && !inlineImage)
145 t <<
" </mediaobject>\n";
146 if (hasCaption && !inlineImage)
152 t <<
" </informalfigure>\n";
231 m_t <<
"<link xlink:href=\"";
243 m_t <<
"<?linebreak?>";
252 m_t <<
"<informaltable frame='bottom'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>\n";
253 m_t <<
"</entry></row></tbody></tgroup></informaltable>\n";
263 if (s.
enable())
m_t <<
"<emphasis role=\"bold\">";
else m_t <<
"</emphasis>";
266 if (s.
enable())
m_t <<
"<emphasis>";
else m_t <<
"</emphasis>";
271 if (s.
enable())
m_t <<
"<computeroutput>";
else m_t <<
"</computeroutput>";
274 if (s.
enable())
m_t <<
"<subscript>";
else m_t <<
"</subscript>";
277 if (s.
enable())
m_t <<
"<superscript>";
else m_t <<
"</superscript>";
280 if (s.
enable())
m_t <<
"<informaltable frame='none'><tgroup cols='1'><colspec align='center'/><tbody><row><entry align='center'>";
281 else m_t <<
"</entry></row></tbody></tgroup></informaltable>";
286 m_t <<
"<literallayout>";
291 m_t <<
"</literallayout>";
322 m_t <<
"<literallayout><computeroutput>";
330 m_t <<
"</computeroutput></literallayout>";
333 m_t <<
"<literallayout><computeroutput>";
335 m_t <<
"</computeroutput></literallayout>";
341 m_t <<
"<computeroutput>";
343 m_t <<
"</computeroutput>";
366 if (!fileName.isEmpty())
379 "msc {"+s.
text()+
"}",
381 if (!fileName.isEmpty())
394 for (
const auto &baseName: baseNameVector)
403 if (
Config_getBool(MERMAID_RENDER_MODE)!=MERMAID_RENDER_MODE_t::CLIENT_SIDE)
435 m_t <<
"<literallayout><computeroutput>";
446 m_t <<
"</computeroutput></literallayout>";
450 m_t <<
"<literallayout><computeroutput>";
458 m_t <<
"</computeroutput></literallayout>";
472 m_t <<
"<literallayout>";
474 m_t <<
"</literallayout>";
478 m_t <<
"<literallayout><computeroutput>";
487 m_t <<
"</computeroutput></literallayout>";
499 m_t <<
"<programlisting linenumbering=\"unnumbered\">";
512 std::unique_ptr<FileDef> fd;
549 else m_t <<
" <mediaobject>\n";
550 m_t <<
" <imageobject>\n";
551 m_t <<
" <imagedata ";
552 m_t <<
"align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << f.
relPath() << f.
name() <<
".png\"/>\n";
553 m_t <<
" </imageobject>\n";
555 else m_t <<
" </mediaobject>\n";
562 m_t <<
"<indexterm><primary>";
564 m_t <<
"</primary></indexterm>\n";
588 if (!opt.noPar())
filter(
"[");
590 if (!opt.noPar())
filter(
"]");
606 m_t <<
"<orderedlist>\n";
610 m_t <<
"<itemizedlist>\n";
615 m_t <<
"</orderedlist>\n";
619 m_t <<
"</itemizedlist>\n";
630 m_t <<
"<listitem override=\"unchecked\">";
634 m_t <<
"<listitem override=\"checked\">";
641 m_t <<
"</listitem>";
760 m_t <<
"<formalpara><title>" <<
theTranslator->trPrecondition() <<
"</title>\n";
770 m_t <<
"<formalpara><title>" <<
theTranslator->trPostcondition() <<
"</title>\n";
780 m_t <<
"<formalpara><title>" <<
theTranslator->trCopyright() <<
"</title>\n";
790 m_t <<
"<formalpara><title>" <<
theTranslator->trInvariant() <<
"</title>\n";
821 m_t <<
"<important><title>" <<
theTranslator->trImportant() <<
"</title>\n";
832 m_t <<
"<formalpara>\n";
840 std::visit(*
this,*s.
title());
850 m_t <<
"</formalpara>\n";
858 m_t <<
"</caution>\n";
861 m_t <<
"</important>\n";
864 m_t <<
"</warning>\n";
867 m_t <<
"</formalpara>\n";
885 m_t <<
"<itemizedlist>\n";
887 m_t <<
"</itemizedlist>\n";
899 m_t <<
"</listitem>\n";
911 std::visit(*
this,*s.
title());
914 m_t <<
"</section>\n";
925 m_t <<
"<itemizedlist>\n";
928 m_t <<
"</orderedlist>\n";
930 m_t <<
"</itemizedlist>\n";
940 bool isFirst = &std::get<DocHtmlListItem>(l->
children().
front())==&s;
943 for (
const auto &opt : s.
attribs())
945 if (opt.name==
"value")
948 int val = opt.value.toInt(&ok);
953 if (value>0 || isFirst)
955 for (
const auto &opt : l->
attribs())
957 if (opt.name==
"type")
960 type =
" numeration=\"arabic\"";
961 else if (opt.value==
"a")
962 type =
" numeration=\"loweralpha\"";
963 else if (opt.value==
"A")
964 type =
" numeration=\"upperalpha\"";
965 else if (opt.value==
"i")
966 type =
" numeration=\"lowerroman\"";
967 else if (opt.value==
"I")
968 type =
" numeration=\"upperroman\"";
970 else if (value==0 && opt.name==
"start")
973 int val = opt.value.toInt(&ok);
979 if (value>0 && !isFirst)
981 m_t <<
"</orderedlist>\n";
983 if (value>0 || isFirst)
985 m_t <<
"<orderedlist";
987 if (value>0)
m_t <<
" startingnumber=\"" << value <<
"\"";
991 m_t <<
"<listitem>\n";
993 m_t <<
"</listitem>\n";
1000 m_t <<
"<variablelist>\n";
1002 m_t <<
"</variablelist>\n";
1009 m_t <<
"<varlistentry><term>";
1011 m_t <<
"</term></varlistentry>\n";
1018 m_t <<
"<listitem>";
1020 m_t <<
"</listitem>\n";
1028 m_t <<
"<informaltable frame=\"all\">\n";
1029 m_t <<
" <tgroup cols=\"" << t.
numColumns() <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1033 m_t <<
" <colspec colname='c" << i+1 <<
"'/>\n";
1037 std::visit(*
this,*t.
caption());
1042 m_t <<
" </tgroup>\n";
1043 m_t <<
"</informaltable>\n";
1066 for (
const auto &opt : tr.
attribs())
1079 m_t <<
"</thead><tbody>\n";
1091 for (
const auto &opt : c.
attribs())
1093 if (opt.name==
"colspan")
1096 int cols = opt.value.toInt();
1100 else if (opt.name==
"rowspan")
1102 int extraRows = opt.value.toInt() - 1;
1103 m_t <<
" morerows='" << extraRows <<
"'";
1105 else if (opt.name==
"class")
1107 if (opt.value.startsWith(
"markdownTable"))
1109 if (opt.value.endsWith(
"Right"))
1111 m_t <<
" align='right'";
1113 else if (opt.value.endsWith(
"Left"))
1115 m_t <<
" align='left'";
1117 else if (opt.value.endsWith(
"Center"))
1119 m_t <<
" align='center'";
1149 m_t <<
"</caption>\n";
1163 if (href.
url().
at(0) !=
'#')
1179 m_t <<
"<para><emphasis role=\"bold\">";
1181 m_t <<
"</emphasis></para>";
1192 std::visit(*
this,*summary);
1204 m_t <<
"<formalpara><title>";
1206 m_t <<
"</title></formalpara>\n";
1238 bool exists =
false;
1246 if (!fileName.isEmpty())
1259 bool exists =
false;
1267 if (!fileName.isEmpty())
1280 bool exists =
false;
1288 if (!fileName.isEmpty())
1311 if (
Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE)
return;
1350 m_t <<
"<tocentry>";
1352 m_t <<
"</tocentry>\n";
1369 m_t <<
" <formalpara>\n";
1370 m_t <<
" <title>\n";
1380 m_t <<
"</title>\n";
1382 m_t <<
" <table frame=\"all\">\n";
1388 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1389 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1391 m_t <<
" <tgroup cols=\"" << ncols <<
"\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1392 for (
int i = 1; i <= ncols; i++)
1394 if (i == ncols)
m_t <<
" <colspec colwidth=\"4*\"/>\n";
1395 else m_t <<
" <colspec colwidth=\"1*\"/>\n";
1397 m_t <<
" <tbody>\n";
1399 m_t <<
" </tbody>\n";
1400 m_t <<
" </tgroup>\n";
1401 m_t <<
" </table>\n";
1402 m_t <<
" </para>\n";
1403 m_t <<
" </formalpara>\n";
1447 std::visit(*
this,type);
1454 m_t <<
"<entry></entry>\n";
1466 std::visit(*
this,param);
1474 std::visit(*
this,par);
1476 m_t <<
"</entry>\n";
1485 m_t <<
"<para><link linkend=\"_";
1517 m_t <<
"<blockquote>";
1519 m_t <<
"</blockquote>";
1599 for (
const auto &bName: baseNameVector)
1606 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1622 if (
Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE)
return;
1645 if (
Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE)
return;
1656 visitPreStart(
m_t, children, hasCaption, relPath + shortName +
"." + imgExt, width, height);
1675 int srcLine,
bool newFile
1680 baseName.prepend(
"msc_");
1684 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1713 int srcLine,
bool newFile
1718 baseName.prepend(
"dia_");
1722 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
".png", width, height);
1751 int srcLine,
bool newFile
1756 baseName.prepend(
"dot_");
1761 visitPreStart(
m_t, children, hasCaption, relPath + baseName +
"." + imgExt, width, height);
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &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.
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
QCString includeFileName() const
QCString exampleFile() const
Node representing an included text block from file.
QCString extension() const
bool stripCodeComments() const
QCString exampleFile() 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.
QCString 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.
QCString language() const
const DocNodeList & children() const
QCString exampleFile() const
Node representing a VHDL flow chart.
CodeParserInterface & getCodeParser(const QCString &langExt)
void pushHidden(bool hide)
Node representing some amount of white space.
Node representing a word.
Node representing an item of a cross-referenced list.
void visitPreStart(TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
void endDiaFile(bool hasCaption)
void operator()(const DocWord &)
void filter(const QCString &str, const bool retainNewLine=false)
void startDotFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine, bool newFile=true)
void visitChildren(const T &t)
void startLink(const QCString &file, const QCString &anchor)
void endMermaidFile(bool hasCaption)
void startMscFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine, bool newFile=true)
void startMermaidFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
void endPlantUmlFile(bool hasCaption)
void visitCaption(const DocNodeList &children)
void writeDiaFile(const QCString &fileName, const DocVerbatim &s)
void endDotFile(bool hasCaption)
void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
void writeMermaidFile(const QCString &fileName, const DocVerbatim &s)
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void endMscFile(bool hasCaption)
DocbookDocVisitor(TextStream &t, OutputCodeList &ci, const QCString &langExt)
void startDiaFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine, bool newFile=true)
void startPlantUmlFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void writeDotFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
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 QCString absFilePath() const =0
Minimal replacement for QFileInfo.
std::string fileName() const
std::string dirPath(bool absPath=true) const
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.
void generateMermaidOutput(const QCString &baseName, const QCString &outDir, ImageFormat format, bool toIndex)
Register a generated Mermaid image with the index.
static QCString imageExtension(ImageFormat imageFormat)
static MermaidManager & instance()
static ImageFormat convertToImageFormat(OutputFormat outputFormat)
QCString writeMermaidSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, ImageFormat format, const QCString &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 QCString &baseName, const QCString &outDir, OutputFormat format, bool toIndex)
Convert a PlantUML file to an image.
StringVector writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
static PlantumlManager & instance()
This is an alternative implementation of QCString.
size_t length() const
Returns the length of the string, not counting the 0-terminator.
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
char & at(size_t i)
Returns a reference to the character at index i.
bool isEmpty() const
Returns TRUE iff the string is empty.
const std::string & str() const
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Text streaming class that buffers data.
#define Config_getBool(name)
#define Config_getString(name)
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine, bool toIndex)
QCString convertToDocBook(const QCString &s, const bool retainNewline)
static QCString filterId(const QCString &s)
static bool supportedHtmlAttribute(const QCString &name)
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine, bool toIndex)
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Translator * theTranslator
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &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)
QCString writeFileContents(const QCString &baseName, const QCString &extension, const QCString &content, bool &exists)
Thread-safe function to write a string to a file.
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
QCString stripPath(const QCString &s)
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
QCString getDotImageExtension()
QCString makeBaseName(const QCString &name, const QCString &ext)
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
QCString getFileNameExtension(const QCString &fn)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
A bunch of utility functions.