Doxygen
Loading...
Searching...
No Matches
docbookvisitor.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2020 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#include "docbookvisitor.h"
17#include "docparser.h"
18#include "language.h"
19#include "doxygen.h"
20#include "outputgen.h"
21#include "docbookgen.h"
22#include "dot.h"
23#include "message.h"
24#include "util.h"
25#include "parserintf.h"
26#include "filename.h"
27#include "config.h"
28#include "filedef.h"
29#include "msc.h"
30#include "dia.h"
31#include "htmlentity.h"
32#include "emoji.h"
33#include "plantuml.h"
34#include "mermaid.h"
35#include "fileinfo.h"
36#include "portable.h"
37#include "codefragment.h"
38#include "cite.h"
39#include "md5.h"
40
41#if 0
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";
46#else
47#define DB_VIS_C
48#define DB_VIS_C1(x)
49#define DB_VIS_C2(y)
50#define DB_VIS_C2a(x,y)
51#endif
52
53static QCString filterId(const QCString &s)
54{
55 if (s.isEmpty()) return s;
56 QCString result;
57 result.reserve(s.length()+8);
58 const char *p=s.data();
59 char c=0;
60 while ((c=*p++))
61 {
62 switch (c)
63 {
64 case ':': result+="_1"; break;
65 default: result+=c; break;
66 }
67 }
68 return result;
69}
70
71static bool supportedHtmlAttribute(const QCString &name)
72{
73 return (name=="align" ||
74 name=="bgcolor" ||
75 name=="border" ||
76 name=="cellpadding" ||
77 name=="cellspacing" ||
78 name=="class" ||
79 name=="frame" ||
80 name=="label" ||
81 name=="style" ||
82 name=="width" ||
83 name=="tabstyle" ||
84 name=="title");
85}
86
88{
89 for (const auto &n : children)
90 {
91 std::visit(*this,n);
92 }
93}
94
96 const DocNodeList &children,
97 bool hasCaption,
98 const QCString &name,
99 const QCString &width,
100 const QCString &height,
101 bool inlineImage)
102{
103 if (hasCaption && !inlineImage)
104 {
105 t << " <figure>\n";
106 t << " <title>\n";
107 visitCaption(children);
108 t << " </title>\n";
109 }
110 else
111 {
112 t << " <informalfigure>\n";
113 }
114 t << " <mediaobject>\n";
115 t << " <imageobject>\n";
116 t << " <imagedata";
117 if (!width.isEmpty())
118 {
119 t << " width=\"" << convertToDocBook(width) << "\"";
120 }
121 else
122 {
123 if (!height.isEmpty() && !inlineImage) t << " width=\"50%\"";
124 }
125 if (!height.isEmpty())
126 {
127 t << " depth=\"" << convertToDocBook(height) << "\"";
128 }
129 t << " align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name << "\">";
130 t << "</imagedata>\n";
131 t << " </imageobject>\n";
132 if (hasCaption && !inlineImage)
133 {
134 t << " <!--\n"; // Needed for general formatting with title for other formats
135 }
136}
137
138void DocbookDocVisitor::visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage)
139{
140 t << "\n";
141 if (hasCaption && !inlineImage)
142 {
143 t << " -->\n"; // Needed for general formatting with title for other formats
144 }
145 t << " </mediaobject>\n";
146 if (hasCaption && !inlineImage)
147 {
148 t << " </figure>\n";
149 }
150 else
151 {
152 t << " </informalfigure>\n";
153 }
154}
155
157 : m_t(t), m_ci(ci),m_langExt(langExt)
158{
160 // m_t << "<section>\n";
161}
162
163//--------------------------------------
164// visitor functions for leaf nodes
165//--------------------------------------
166
168{
170 if (m_hide) return;
171 filter(w.word());
172}
173
175{
177 if (m_hide) return;
178 startLink(w.file(),w.anchor());
179 filter(w.word());
180 endLink();
181}
182
184{
186 if (m_hide) return;
187 if (m_insidePre)
188 {
189 m_t << w.chars();
190 }
191 else
192 {
193 m_t << " ";
194 }
195}
196
198{
200 if (m_hide) return;
201 const char *res = HtmlEntityMapper::instance().docbook(s.symbol());
202 if (res)
203 {
204 m_t << res;
205 }
206 else
207 {
208 err("DocBook: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
209 }
210}
211
213{
215 if (m_hide) return;
216 const char *res = EmojiEntityMapper::instance().unicode(s.index());
217 if (res)
218 {
219 m_t << res;
220 }
221 else
222 {
223 m_t << s.name();
224 }
225}
226
228{
230 if (m_hide) return;
231 m_t << "<link xlink:href=\"";
232 if (u.isEmail()) m_t << "mailto:";
233 filter(u.url());
234 m_t << "\">";
235 filter(u.url());
236 m_t << "</link>";
237}
238
240{
242 if (m_hide) return;
243 m_t << "<?linebreak?>";
244 // gives nicer results but gives problems as it is not allowed in <pare> and also problems with dblatex
245 // m_t << "\n" << "<sbr/>\n";
246}
247
249{
251 if (m_hide) return;
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";
254}
255
257{
259 if (m_hide) return;
260 switch (s.style())
261 {
263 if (s.enable()) m_t << "<emphasis role=\"bold\">"; else m_t << "</emphasis>";
264 break;
266 if (s.enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
267 break;
271 if (s.enable()) m_t << "<computeroutput>"; else m_t << "</computeroutput>";
272 break;
274 if (s.enable()) m_t << "<subscript>"; else m_t << "</subscript>";
275 break;
277 if (s.enable()) m_t << "<superscript>"; else m_t << "</superscript>";
278 break;
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>";
282 break;
284 if (s.enable())
285 {
286 m_t << "<literallayout>";
288 }
289 else
290 {
291 m_t << "</literallayout>";
293 }
294 break;
295 /* There is no equivalent Docbook tag for rendering Small text */
296 case DocStyleChange::Small: /* XSLT Stylesheets can be used */ break;
297 /* HTML only */
298 case DocStyleChange::Cite: break;
299 case DocStyleChange::S: break;
300 case DocStyleChange::Strike: break;
301 case DocStyleChange::Del: break;
302 case DocStyleChange::Underline: break;
303 case DocStyleChange::Ins: break;
304 case DocStyleChange::Div: /* HTML only */ break;
305 case DocStyleChange::Span: /* HTML only */ break;
306 }
307}
308
310{
312 if (m_hide) return;
313 QCString lang = m_langExt;
314 if (!s.language().isEmpty()) // explicit language setting
315 {
316 lang = s.language();
317 }
318 SrcLangExt langExt = getLanguageFromCodeLang(lang);
319 switch(s.type())
320 {
322 m_t << "<literallayout><computeroutput>";
324 s.text(),
325 langExt,
326 Config_getBool(STRIP_CODE_COMMENTS),
328 .setExample(s.isExample(),s.exampleFile())
329 );
330 m_t << "</computeroutput></literallayout>";
331 break;
333 m_t << "<literallayout><computeroutput>";
334 filter(s.text());
335 m_t << "</computeroutput></literallayout>";
336 break;
338 filter(s.text(), true);
339 break;
341 m_t << "<computeroutput>";
342 filter(s.text(), true);
343 m_t << "</computeroutput>";
344 break;
346 break;
348 break;
350 break;
352 break;
354 break;
356 m_t << s.text();
357 break;
358 case DocVerbatim::Dot:
359 {
360 m_t << "<para>\n";
361 bool exists = false;
362 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/inline_dotgraph_", // baseName
363 ".dot", // extension
364 s.text(), // contents
365 exists);
366 if (!fileName.isEmpty())
367 {
368 writeDotFile(fileName, s, !exists);
369 }
370 m_t << "</para>\n";
371 }
372 break;
373 case DocVerbatim::Msc:
374 {
375 m_t << "<para>\n";
376 bool exists = false;
377 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/inline_mscgraph_", // baseName
378 ".msc", // extension
379 "msc {"+s.text()+"}", // contents
380 exists);
381 if (!fileName.isEmpty())
382 {
383 writeMscFile(fileName,s,!exists);
384 }
385 m_t << "</para>\n";
386 }
387 break;
389 {
390 QCString docbookOutput = Config_getString(DOCBOOK_OUTPUT);
391 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(docbookOutput,
393 s.engine(),s.srcFile(),s.srcLine(),true);
394 for (const auto &baseName: baseNameVector)
395 {
396 m_t << "<para>\n";
397 writePlantUMLFile(baseName,s);
398 m_t << "</para>\n";
399 }
400 }
401 break;
403 if (Config_getBool(MERMAID_RENDER_MODE)!=MERMAID_RENDER_MODE_t::CLIENT_SIDE)
404 {
405 auto docbookOutput = Config_getString(DOCBOOK_OUTPUT);
406 auto outputFormat = MermaidManager::OutputFormat::Docbook;
407 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
408 auto baseName = MermaidManager::instance().writeMermaidSource(docbookOutput,
409 s.exampleFile(),s.text(),imageFormat,
410 s.srcFile(),s.srcLine());
411 m_t << "<para>\n";
412 writeMermaidFile(baseName,s);
413 m_t << "</para>\n";
414 }
415 break;
416 }
417}
418
420{
422 if (m_hide) return;
423 m_t << "<anchor xml:id=\"_" << stripPath(anc.file()) << "_1" << filterId(anc.anchor()) << "\"/>";
424}
425
427{
429 if (m_hide) return;
431 switch(inc.type())
432 {
434 {
435 m_t << "<literallayout><computeroutput>";
436 FileInfo cfi( inc.file().str() );
437 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
439 inc.text(),
440 langExt,
441 inc.stripCodeComments(),
443 .setExample(inc.isExample(),inc.exampleFile())
444 .setFileDef(fd.get())
445 );
446 m_t << "</computeroutput></literallayout>";
447 }
448 break;
450 m_t << "<literallayout><computeroutput>";
452 inc.text(),
453 langExt,
454 inc.stripCodeComments(),
456 .setExample(inc.isExample(),inc.exampleFile())
457 );
458 m_t << "</computeroutput></literallayout>";
459 break;
467 break;
469 m_t << inc.text();
470 break;
472 m_t << "<literallayout>";
473 filter(inc.text());
474 m_t << "</literallayout>";
475 break;
478 m_t << "<literallayout><computeroutput>";
480 inc.file(),
481 inc.blockId(),
482 inc.context(),
484 inc.trimLeft(),
486 );
487 m_t << "</computeroutput></literallayout>";
488 break;
489 }
490}
491
493{
495 if (op.isFirst())
496 {
497 if (!m_hide)
498 {
499 m_t << "<programlisting linenumbering=\"unnumbered\">";
500 }
502 m_hide = TRUE;
503 }
505 if (locLangExt.isEmpty()) locLangExt = m_langExt;
506 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
507 if (op.type()!=DocIncOperator::Skip)
508 {
509 m_hide = popHidden();
510 if (!m_hide)
511 {
512 std::unique_ptr<FileDef> fd;
513 if (!op.includeFileName().isEmpty())
514 {
515 FileInfo cfi( op.includeFileName().str() );
516 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
517 }
518
519 getCodeParser(locLangExt).parseCode(m_ci,op.context(),
520 op.text(),langExt,
523 .setExample(op.isExample(), op.exampleFile())
524 .setFileDef(fd.get())
525 .setStartLine(op.line())
527 );
528 }
530 m_hide=TRUE;
531 }
532 if (op.isLast())
533 {
534 m_hide = popHidden();
535 if (!m_hide) m_t << "</programlisting>";
536 }
537 else
538 {
539 if (!m_hide) m_t << "\n";
540 }
541}
542
544{
546 if (m_hide) return;
547
548 if (f.isInline()) m_t << "<inlinemediaobject>\n";
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";
554 if (f.isInline()) m_t << "</inlinemediaobject>\n";
555 else m_t << " </mediaobject>\n";
556}
557
559{
561 if (m_hide) return;
562 m_t << "<indexterm><primary>";
563 filter(ie.entry());
564 m_t << "</primary></indexterm>\n";
565}
566
568{
570 // m_t << "<simplesect/>";
571}
572
574{
576 if (m_hide) return;
577 auto opt = cite.option();
578 if (!cite.file().isEmpty())
579 {
580 if (!opt.noCite()) startLink(cite.file(),filterId(cite.anchor()));
581
582 filter(cite.getText());
583
584 if (!opt.noCite()) endLink();
585 }
586 else
587 {
588 if (!opt.noPar()) filter("[");
589 filter(cite.target());
590 if (!opt.noPar()) filter("]");
591
592 }
593
594}
595
596//--------------------------------------
597// visitor functions for compound nodes
598//--------------------------------------
599
601{
603 if (m_hide) return;
604 if (l.isEnumList())
605 {
606 m_t << "<orderedlist>\n";
607 }
608 else
609 {
610 m_t << "<itemizedlist>\n";
611 }
612 visitChildren(l);
613 if (l.isEnumList())
614 {
615 m_t << "</orderedlist>\n";
616 }
617 else
618 {
619 m_t << "</itemizedlist>\n";
620 }
621}
622
624{
626 if (m_hide) return;
627 switch (li.itemNumber())
628 {
629 case DocAutoList::Unchecked: // unchecked
630 m_t << "<listitem override=\"unchecked\">";
631 break;
632 case DocAutoList::Checked_x: // checked with x
633 case DocAutoList::Checked_X: // checked with X
634 m_t << "<listitem override=\"checked\">";
635 break;
636 default:
637 m_t << "<listitem>";
638 break;
639 }
640 visitChildren(li);
641 m_t << "</listitem>";
642}
643
645{
647 if (m_hide) return;
648 m_t << "\n";
649 m_t << "<para>";
650 visitChildren(p);
651 m_t << "</para>";
652 m_t << "\n";
653}
654
660
662{
664 if (m_hide) return;
665 switch(s.type())
666 {
668 if (m_insidePre)
669 {
670 m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>\n";
671 }
672 else
673 {
674 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>\n";
675 }
676 break;
678 if (m_insidePre)
679 {
680 m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>\n";
681 }
682 else
683 {
684 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>\n";
685 }
686 break;
688 if (m_insidePre)
689 {
690 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>\n";
691 }
692 else
693 {
694 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>\n";
695 }
696 break;
698 if (m_insidePre)
699 {
700 m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>\n";
701 }
702 else
703 {
704 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>\n";
705 }
706 break;
708 if (m_insidePre)
709 {
710 m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>\n";
711 }
712 else
713 {
714 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>\n";
715 }
716 break;
718 if (m_insidePre)
719 {
720 m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>\n";
721 }
722 else
723 {
724 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>\n";
725 }
726 break;
728 if (m_insidePre)
729 {
730 m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>\n";
731 }
732 else
733 {
734 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>\n";
735 }
736 break;
738 if (m_insidePre)
739 {
740 m_t << "<note><title>" << theTranslator->trNote() << "</title>\n";
741 }
742 else
743 {
744 m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>\n";
745 }
746 break;
748 if (m_insidePre)
749 {
750 m_t << "<warning><title>" << theTranslator->trWarning() << "</title>\n";
751 }
752 else
753 {
754 m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>\n";
755 }
756 break;
758 if (m_insidePre)
759 {
760 m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>\n";
761 }
762 else
763 {
764 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>\n";
765 }
766 break;
768 if (m_insidePre)
769 {
770 m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>\n";
771 }
772 else
773 {
774 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>\n";
775 }
776 break;
778 if (m_insidePre)
779 {
780 m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>\n";
781 }
782 else
783 {
784 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>\n";
785 }
786 break;
788 if (m_insidePre)
789 {
790 m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>\n";
791 }
792 else
793 {
794 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>\n";
795 }
796 break;
798 // <remark> is miising the <title> possibility
799 if (m_insidePre)
800 {
801 m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>\n";
802 }
803 else
804 {
805 m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>\n";
806 }
807 break;
809 if (m_insidePre)
810 {
811 m_t << "<caution><title>" << theTranslator->trAttention() << "</title>\n";
812 }
813 else
814 {
815 m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>\n";
816 }
817 break;
819 if (m_insidePre)
820 {
821 m_t << "<important><title>" << theTranslator->trImportant() << "</title>\n";
822 }
823 else
824 {
825 m_t << "<important><title>" << convertToDocBook(theTranslator->trImportant()) << "</title>\n";
826 }
827 break;
831 if (s.hasTitle())
832 m_t << "<formalpara>\n";
833 else
834 m_t << "<para>\n";
835 break;
836 }
837
838 if (s.title())
839 {
840 std::visit(*this,*s.title());
841 }
842 visitChildren(s);
843
844 switch(s.type())
845 {
849 if (s.hasTitle())
850 m_t << "</formalpara>\n";
851 else
852 m_t << "</para>\n";
853 break;
855 m_t << "</note>\n";
856 break;
858 m_t << "</caution>\n";
859 break;
861 m_t << "</important>\n";
862 break;
864 m_t << "</warning>\n";
865 break;
866 default:
867 m_t << "</formalpara>\n";
868 break;
869 }
870}
871
873{
875 if (m_hide) return;
876 if (t.hasTitle()) m_t << "<title>";
877 visitChildren(t);
878 if (t.hasTitle()) m_t << "</title>";
879}
880
882{
884 if (m_hide) return;
885 m_t << "<itemizedlist>\n";
886 visitChildren(l);
887 m_t << "</itemizedlist>\n";
888}
889
891{
893 if (m_hide) return;
894 m_t << "<listitem>";
895 if (li.paragraph())
896 {
897 visit(*this,*li.paragraph());
898 }
899 m_t << "</listitem>\n";
900}
901
903{
905 if (m_hide) return;
906 m_t << "<section xml:id=\"_" << stripPath(s.file());
907 if (!s.anchor().isEmpty()) m_t << "_1" << s.anchor();
908 m_t << "\">\n";
909 if (s.title())
910 {
911 std::visit(*this,*s.title());
912 }
913 visitChildren(s);
914 m_t << "</section>\n";
915}
916
918{
920 if (m_hide) return;
921 if (s.children().empty()) return;
922 // opening tag for ordered list will be handled in DocHtmlListItem
923 // due to (re-)numbering possibilities
924 if (s.type()!=DocHtmlList::Ordered)
925 m_t << "<itemizedlist>\n";
926 visitChildren(s);
927 if (s.type()==DocHtmlList::Ordered)
928 m_t << "</orderedlist>\n";
929 else
930 m_t << "</itemizedlist>\n";
931}
932
934{
936 if (m_hide) return;
937 const DocHtmlList *l = std::get_if<DocHtmlList>(s.parent());
938 if (l->type()==DocHtmlList::Ordered)
939 {
940 bool isFirst = &std::get<DocHtmlListItem>(l->children().front())==&s;
941 int value = 0;
942 QCString type;
943 for (const auto &opt : s.attribs())
944 {
945 if (opt.name=="value")
946 {
947 bool ok = false;
948 int val = opt.value.toInt(&ok);
949 if (ok) value = val;
950 }
951 }
952
953 if (value>0 || isFirst)
954 {
955 for (const auto &opt : l->attribs())
956 {
957 if (opt.name=="type")
958 {
959 if (opt.value=="1")
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\"";
969 }
970 else if (value==0 && opt.name=="start")
971 {
972 bool ok = false;
973 int val = opt.value.toInt(&ok);
974 if (ok) value = val;
975 }
976 }
977 }
978
979 if (value>0 && !isFirst)
980 {
981 m_t << "</orderedlist>\n";
982 }
983 if (value>0 || isFirst)
984 {
985 m_t << "<orderedlist";
986 if (!type.isEmpty()) m_t << type.data();
987 if (value>0) m_t << " startingnumber=\"" << value << "\"";
988 m_t << ">\n";
989 }
990 }
991 m_t << "<listitem>\n";
992 visitChildren(s);
993 m_t << "</listitem>\n";
994}
995
997{
999 if (m_hide) return;
1000 m_t << "<variablelist>\n";
1001 visitChildren(l);
1002 m_t << "</variablelist>\n";
1003}
1004
1006{
1008 if (m_hide) return;
1009 m_t << "<varlistentry><term>";
1010 visitChildren(dt);
1011 m_t << "</term></varlistentry>\n";
1012}
1013
1015{
1017 if (m_hide) return;
1018 m_t << "<listitem>";
1019 visitChildren(dd);
1020 m_t << "</listitem>\n";
1021}
1022
1024{
1026 m_bodySet.push(false);
1027 if (m_hide) return;
1028 m_t << "<informaltable frame=\"all\">\n";
1029 m_t << " <tgroup cols=\"" << t.numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1030 for (uint32_t i = 0; i <t.numColumns(); i++)
1031 {
1032 // do something with colwidth based of cell width specification (be aware of possible colspan in the header)?
1033 m_t << " <colspec colname='c" << i+1 << "'/>\n";
1034 }
1035 if (t.caption())
1036 {
1037 std::visit(*this,*t.caption());
1038 }
1039 visitChildren(t);
1040 if (m_bodySet.top()) m_t << " </tbody>\n";
1041 m_bodySet.pop();
1042 m_t << " </tgroup>\n";
1043 m_t << "</informaltable>\n";
1044}
1045
1047{
1049 m_colCnt = 0;
1050 if (m_hide) return;
1051
1052 if (tr.isHeading())
1053 {
1054 if (m_bodySet.top()) m_t << "</tbody>\n";
1055 m_bodySet.top() = false;
1056 m_t << "<thead>\n";
1057 }
1058 else if (!m_bodySet.top())
1059 {
1060 m_bodySet.top() = true;
1061 m_t << "<tbody>\n";
1062 }
1063
1064 m_t << " <row ";
1065
1066 for (const auto &opt : tr.attribs())
1067 {
1068 if (supportedHtmlAttribute(opt.name))
1069 {
1070 // process supported attributes only
1071 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1072 }
1073 }
1074 m_t << ">\n";
1075 visitChildren(tr);
1076 m_t << "</row>\n";
1077 if (tr.isHeading())
1078 {
1079 m_t << "</thead><tbody>\n";
1080 m_bodySet.top() = true;
1081 }
1082}
1083
1085{
1087 m_colCnt++;
1088 if (m_hide) return;
1089 m_t << "<entry";
1090
1091 for (const auto &opt : c.attribs())
1092 {
1093 if (opt.name=="colspan")
1094 {
1095 m_t << " namest='c" << m_colCnt << "'";
1096 int cols = opt.value.toInt();
1097 m_colCnt += (cols - 1);
1098 m_t << " nameend='c" << m_colCnt << "'";
1099 }
1100 else if (opt.name=="rowspan")
1101 {
1102 int extraRows = opt.value.toInt() - 1;
1103 m_t << " morerows='" << extraRows << "'";
1104 }
1105 else if (opt.name=="class")
1106 {
1107 if (opt.value.startsWith("markdownTable")) // handle markdown generated attributes
1108 {
1109 if (opt.value.endsWith("Right"))
1110 {
1111 m_t << " align='right'";
1112 }
1113 else if (opt.value.endsWith("Left"))
1114 {
1115 m_t << " align='left'";
1116 }
1117 else if (opt.value.endsWith("Center"))
1118 {
1119 m_t << " align='center'";
1120 }
1121 // skip 'markdownTable*' value ending with "None"
1122 }
1123 else
1124 {
1125 m_t << " class='" << convertToDocBook(opt.value) << "'";
1126 }
1127 }
1128 else if (supportedHtmlAttribute(opt.name))
1129 {
1130 // process supported attributes only
1131 m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
1132 }
1133 }
1134 m_t << ">";
1135 visitChildren(c);
1136 m_t << "</entry>";
1137}
1138
1140{
1142 if (m_hide) return;
1143 m_t << "<caption>";
1144 if (!c.file().isEmpty())
1145 {
1146 m_t << "<anchor xml:id=\"_" << stripPath(c.file()) << "_1" << filterId(c.anchor()) << "\"/>";
1147 }
1148 visitChildren(c);
1149 m_t << "</caption>\n";
1150}
1151
1153{
1155 if (m_hide) return;
1156 visitChildren(i);
1157}
1158
1160{
1162 if (m_hide) return;
1163 if (href.url().at(0) != '#')
1164 {
1165 m_t << "<link xlink:href=\"" << convertToDocBook(href.url()) << "\">";
1166 }
1167 else
1168 {
1169 startLink(href.file(),filterId(href.url().mid(1)));
1170 }
1171 visitChildren(href);
1172 m_t << "</link>";
1173}
1174
1176{
1178 if (m_hide) return;
1179 m_t << "<para><emphasis role=\"bold\">";
1180 visitChildren(s);
1181 m_t << "</emphasis></para>";
1182}
1183
1185{
1187 if (m_hide) return;
1188 m_t << "\n";
1189 auto summary = d.summary();
1190 if (summary)
1191 {
1192 std::visit(*this,*summary);
1193 }
1194 m_t << "<para>";
1195 visitChildren(d);
1196 m_t << "</para>";
1197 m_t << "\n";
1198}
1199
1201{
1203 if (m_hide) return;
1204 m_t << "<formalpara><title>";
1205 visitChildren(h);
1206 m_t << "</title></formalpara>\n";
1207}
1208
1210{
1212 if (img.type()==DocImage::DocBook)
1213 {
1214 if (m_hide) return;
1215 m_t << "\n";
1216 QCString baseName=stripPath(img.name());
1217 visitPreStart(m_t, img.children(), img.hasCaption(), img.relPath() + baseName, img.width(), img.height(), img.isInlineImage());
1218 visitChildren(img);
1220 QCString file;
1221 bool ambig = false;
1222 FileDef *fd=findFileDef(Doxygen::imageNameLinkedMap, baseName, ambig);
1223 if (fd)
1224 {
1225 file=fd->absFilePath();
1226 }
1227 copyFile(file,Config_getString(DOCBOOK_OUTPUT)+"/"+baseName);
1228 }
1229 else // skip other formats
1230 {
1231 }
1232}
1233
1235{
1237 if (m_hide) return;
1238 bool exists = false;
1239 std::string inBuf;
1240 if (readInputFile(df.file(),inBuf))
1241 {
1242 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1243 ".dot", // extension
1244 inBuf, // contents
1245 exists);
1246 if (!fileName.isEmpty())
1247 {
1248 startDotFile(fileName,df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine(),!exists);
1249 visitChildren(df);
1250 endDotFile(df.hasCaption());
1251 }
1252 }
1253}
1254
1256{
1258 if (m_hide) return;
1259 bool exists = false;
1260 std::string inBuf;
1261 if (readInputFile(df.file(),inBuf))
1262 {
1263 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1264 ".msc", // extension
1265 inBuf, // contents
1266 exists);
1267 if (!fileName.isEmpty())
1268 {
1269 startMscFile(fileName,df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine(),!exists);
1270 visitChildren(df);
1271 endMscFile(df.hasCaption());
1272 }
1273 }
1274}
1275
1277{
1279 if (m_hide) return;
1280 bool exists = false;
1281 std::string inBuf;
1282 if (readInputFile(df.file(),inBuf))
1283 {
1284 auto fileName = writeFileContents(Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1285 ".dia", // extension
1286 inBuf, // contents
1287 exists);
1288 if (!fileName.isEmpty())
1289 {
1290 startDiaFile(fileName,df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine(),!exists);
1291 visitChildren(df);
1292 endDiaFile(df.hasCaption());
1293 }
1294 }
1295}
1296
1298{
1300 if (m_hide) return;
1301 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1302 startPlantUmlFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1303 visitChildren(df);
1305}
1306
1308{
1310 if (m_hide) return;
1311 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1312 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(DOCBOOK_OUTPUT)+"/"+stripPath(df.file()));
1313 startMermaidFile(df.file(),df.relPath(),df.width(),df.height(),df.hasCaption(),df.children(),df.srcFile(),df.srcLine());
1314 visitChildren(df);
1316}
1317
1319{
1321 if (m_hide) return;
1322 startLink(lnk.file(),lnk.anchor());
1323 visitChildren(lnk);
1324 endLink();
1325}
1326
1328{
1330 if (m_hide) return;
1331 if (ref.isSubPage())
1332 {
1333 startLink(QCString(),ref.anchor());
1334 }
1335 else
1336 {
1337 if (!ref.file().isEmpty()) startLink(ref.file(),ref.anchor());
1338 }
1339
1340 if (!ref.hasLinkText()) filter(ref.targetTitle());
1341 visitChildren(ref);
1342 if (!ref.file().isEmpty()) endLink();
1343}
1344
1346{
1348 if (m_hide) return;
1349 //m_t << "<tocentry xml:idref=\"_" << stripPath(ref->file()) << "_1" << ref->anchor() << "\">";
1350 m_t << "<tocentry>";
1351 visitChildren(ref);
1352 m_t << "</tocentry>\n";
1353}
1354
1356{
1358 if (m_hide) return;
1359 m_t << "<toc>\n";
1360 visitChildren(l);
1361 m_t << "</toc>\n";
1362}
1363
1365{
1367 if (m_hide) return;
1368 m_t << "\n";
1369 m_t << " <formalpara>\n";
1370 m_t << " <title>\n";
1371 switch(s.type())
1372 {
1373 case DocParamSect::Param: m_t << theTranslator->trParameters(); break;
1374 case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break;
1375 case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break;
1376 case DocParamSect::TemplateParam: m_t << theTranslator->trTemplateParameters(); break;
1377 default:
1378 ASSERT(0);
1379 }
1380 m_t << "</title>\n";
1381 m_t << " <para>\n";
1382 m_t << " <table frame=\"all\">\n";
1383 int ncols = 2;
1384 if (s.type() == DocParamSect::Param)
1385 {
1386 bool hasInOutSpecs = s.hasInOutSpecifier();
1387 bool hasTypeSpecs = s.hasTypeSpecifier();
1388 if (hasInOutSpecs && hasTypeSpecs) ncols += 2;
1389 else if (hasInOutSpecs || hasTypeSpecs) ncols += 1;
1390 }
1391 m_t << " <tgroup cols=\"" << ncols << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n";
1392 for (int i = 1; i <= ncols; i++)
1393 {
1394 if (i == ncols) m_t << " <colspec colwidth=\"4*\"/>\n";
1395 else m_t << " <colspec colwidth=\"1*\"/>\n";
1396 }
1397 m_t << " <tbody>\n";
1398 visitChildren(s);
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";
1404 m_t << " ";
1405}
1406
1408{
1410 if (m_hide) return;
1411 m_t << " " << sep.chars() << " ";
1412}
1413
1415{
1417 if (m_hide) return;
1418 m_t << " <row>\n";
1419
1420 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1421 if (sect && sect->hasInOutSpecifier())
1422 {
1423 m_t << "<entry>";
1425 {
1426 if (pl.direction()==DocParamSect::In)
1427 {
1428 m_t << "in";
1429 }
1430 else if (pl.direction()==DocParamSect::Out)
1431 {
1432 m_t << "out";
1433 }
1434 else if (pl.direction()==DocParamSect::InOut)
1435 {
1436 m_t << "in,out";
1437 }
1438 }
1439 m_t << "</entry>";
1440 }
1441
1442 if (sect && sect->hasTypeSpecifier())
1443 {
1444 m_t << "<entry>";
1445 for (const auto &type : pl.paramTypes())
1446 {
1447 std::visit(*this,type);
1448 }
1449 m_t << "</entry>";
1450 }
1451
1452 if (pl.parameters().empty())
1453 {
1454 m_t << "<entry></entry>\n";
1455 }
1456 else
1457 {
1458 m_t << "<entry>";
1459 int cnt = 0;
1460 for (const auto &param : pl.parameters())
1461 {
1462 if (cnt)
1463 {
1464 m_t << ", ";
1465 }
1466 std::visit(*this,param);
1467 cnt++;
1468 }
1469 m_t << "</entry>";
1470 }
1471 m_t << "<entry>";
1472 for (const auto &par : pl.paragraphs())
1473 {
1474 std::visit(*this,par);
1475 }
1476 m_t << "</entry>\n";
1477 m_t << " </row>\n";
1478}
1479
1481{
1483 if (m_hide) return;
1484 if (x.title().isEmpty()) return;
1485 m_t << "<para><link linkend=\"_";
1486 m_t << stripPath(x.file()) << "_1" << x.anchor();
1487 m_t << "\">";
1488 filter(x.title());
1489 m_t << "</link>";
1490 m_t << " ";
1491 visitChildren(x);
1492 if (x.title().isEmpty()) return;
1493 m_t << "</para>";
1494}
1495
1497{
1499 if (m_hide) return;
1500 startLink(ref.file(),ref.anchor());
1501 visitChildren(ref);
1502 endLink();
1503 m_t << " ";
1504}
1505
1507{
1509 visitChildren(t);
1510}
1511
1512
1514{
1516 if (m_hide) return;
1517 m_t << "<blockquote>";
1518 visitChildren(q);
1519 m_t << "</blockquote>";
1520}
1521
1523{
1525 // TODO: to be implemented
1526}
1527
1529{
1531 if (m_hide) return;
1532 visitChildren(b);
1533}
1534
1535
1536void DocbookDocVisitor::filter(const QCString &str, const bool retainNewLine)
1537{
1539 m_t << convertToDocBook(str, retainNewLine);
1540}
1541
1542void DocbookDocVisitor::startLink(const QCString &file,const QCString &anchor)
1543{
1545 m_t << "<link linkend=\"_" << stripPath(file);
1546 if (!anchor.isEmpty())
1547 {
1548 if (!file.isEmpty()) m_t << "_1";
1549 m_t << anchor;
1550 }
1551 m_t << "\">";
1552}
1553
1555{
1557 m_t << "</link>";
1558}
1559
1560void DocbookDocVisitor::writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1561{
1563 QCString shortName = makeBaseName(fileName,".msc");
1564 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1565 if (newFile) writeMscGraphFromFile(fileName,outDir,shortName,MscOutputFormat::BITMAP,s.srcFile(),s.srcLine(),false);
1566 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(), s.height());
1569}
1570
1572{
1574 QCString shortName = stripPath(baseName);
1575 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1577 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + ".png", s.width(),s.height());
1580}
1581
1583 const QCString &relPath,
1584 const QCString &width,
1585 const QCString &height,
1586 bool hasCaption,
1587 const DocNodeList &children,
1588 const QCString &srcFile,
1589 int srcLine
1590 )
1591{
1593 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1594 std::string inBuf;
1595 readInputFile(fileName,inBuf);
1596 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(outDir,
1597 QCString(),inBuf,PlantumlManager::PUML_BITMAP,QCString(),srcFile,srcLine,false);
1598 bool first = true;
1599 for (const auto &bName: baseNameVector)
1600 {
1601 QCString baseName=makeBaseName(bName,".pu");
1603 if (!first) endPlantUmlFile(hasCaption);
1604 first = false;
1605 m_t << "<para>\n";
1606 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1607 }
1608}
1609
1611{
1613 if (m_hide) return;
1614 m_t << "\n";
1615 visitPostEnd(m_t, hasCaption);
1616 m_t << "</para>\n";
1617}
1618
1620{
1622 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1623 auto shortName = stripPath(baseName);
1624 auto outDir = Config_getString(DOCBOOK_OUTPUT);
1625 auto outputFormat = MermaidManager::OutputFormat::Docbook;
1626 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
1627 auto imgExt = MermaidManager::imageExtension(imageFormat);
1628 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
1629 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + "." + imgExt, s.width(),s.height());
1632}
1633
1635 const QCString &relPath,
1636 const QCString &width,
1637 const QCString &height,
1638 bool hasCaption,
1639 const DocNodeList &children,
1640 const QCString &srcFile,
1641 int srcLine
1642 )
1643{
1645 if (Config_getBool(MERMAID_RENDER_MODE)==MERMAID_RENDER_MODE_t::CLIENT_SIDE) return;
1646 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1647 std::string inBuf;
1648 readInputFile(fileName,inBuf);
1649 auto outputFormat = MermaidManager::OutputFormat::Docbook;
1650 auto imageFormat = MermaidManager::convertToImageFormat(outputFormat);
1651 auto imgExt = MermaidManager::imageExtension(imageFormat);
1652 auto baseName = MermaidManager::instance().writeMermaidSource(outDir,QCString(),inBuf,imageFormat,srcFile,srcLine);
1653 auto shortName = stripPath(baseName);
1654 MermaidManager::instance().generateMermaidOutput(baseName,outDir,imageFormat,false);
1655 m_t << "<para>\n";
1656 visitPreStart(m_t, children, hasCaption, relPath + shortName + "." + imgExt, width, height);
1657}
1658
1660{
1662 if (m_hide) return;
1663 m_t << "\n";
1664 visitPostEnd(m_t, hasCaption);
1665 m_t << "</para>\n";
1666}
1667
1669 const QCString &relPath,
1670 const QCString &width,
1671 const QCString &height,
1672 bool hasCaption,
1673 const DocNodeList &children,
1674 const QCString &srcFile,
1675 int srcLine, bool newFile
1676 )
1677{
1679 QCString baseName=makeBaseName(fileName,".msc");
1680 baseName.prepend("msc_");
1681 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1682 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine,false);
1683 m_t << "<para>\n";
1684 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1685}
1686
1688{
1690 if (m_hide) return;
1691 visitPostEnd(m_t, hasCaption);
1692 m_t << "</para>\n";
1693}
1694
1696{
1698 QCString shortName = stripPath(baseName);
1699 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1700 writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DiaOutputFormat::BITMAP,s.srcFile(),s.srcLine(),false);
1701 visitPreStart(m_t, s.children(), s.hasCaption(), shortName, s.width(),s.height());
1704}
1705
1707 const QCString &relPath,
1708 const QCString &width,
1709 const QCString &height,
1710 bool hasCaption,
1711 const DocNodeList &children,
1712 const QCString &srcFile,
1713 int srcLine, bool newFile
1714 )
1715{
1717 QCString baseName=makeBaseName(fileName,".dia");
1718 baseName.prepend("dia_");
1719 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1720 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine,false);
1721 m_t << "<para>\n";
1722 visitPreStart(m_t, children, hasCaption, relPath + baseName + ".png", width, height);
1723}
1724
1726{
1728 if (m_hide) return;
1729 visitPostEnd(m_t, hasCaption);
1730 m_t << "</para>\n";
1731}
1732
1733void DocbookDocVisitor::writeDotFile(const QCString &fileName, const DocVerbatim &s, bool newFile)
1734{
1736 QCString shortName = makeBaseName(fileName,".dot");
1737 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1738 if (newFile) writeDotGraphFromFile(fileName,outDir,shortName,GraphOutputFormat::BITMAP,s.srcFile(),s.srcLine(),false);
1739 visitPreStart(m_t, s.children(), s.hasCaption(), s.relPath() + shortName + "." + getDotImageExtension(), s.width(),s.height());
1742}
1743
1745 const QCString &relPath,
1746 const QCString &width,
1747 const QCString &height,
1748 bool hasCaption,
1749 const DocNodeList &children,
1750 const QCString &srcFile,
1751 int srcLine, bool newFile
1752 )
1753{
1755 QCString baseName=makeBaseName(fileName,".dot");
1756 baseName.prepend("dot_");
1757 QCString outDir = Config_getString(DOCBOOK_OUTPUT);
1758 QCString imgExt = getDotImageExtension();
1759 if (newFile) writeDotGraphFromFile(fileName,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine,false);
1760 m_t << "<para>\n";
1761 visitPreStart(m_t, children, hasCaption, relPath + baseName + "." + imgExt, width, height);
1762}
1763
1765{
1767 if (m_hide) return;
1768 m_t << "\n";
1769 visitPostEnd(m_t, hasCaption);
1770 m_t << "</para>\n";
1771}
1772
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.
Definition docnode.h:229
QCString anchor() const
Definition docnode.h:232
QCString file() const
Definition docnode.h:233
Node representing an auto List.
Definition docnode.h:571
bool isEnumList() const
Definition docnode.h:580
Node representing an item of a auto list.
Definition docnode.h:595
int itemNumber() const
Definition docnode.h:598
Node representing a citation of some bibliographic reference.
Definition docnode.h:245
QCString getText() const
Definition docnode.cpp:974
CiteInfoOption option() const
Definition docnode.h:253
QCString target() const
Definition docnode.h:252
QCString anchor() const
Definition docnode.h:251
QCString file() const
Definition docnode.h:248
DocNodeList & children()
Definition docnode.h:143
Node representing a dia file.
Definition docnode.h:731
QCString relPath() const
Definition docnode.h:686
QCString height() const
Definition docnode.h:689
QCString srcFile() const
Definition docnode.h:691
QCString file() const
Definition docnode.h:685
int srcLine() const
Definition docnode.h:692
bool hasCaption() const
Definition docnode.h:687
QCString width() const
Definition docnode.h:688
Node representing a dot file.
Definition docnode.h:713
Node representing an emoji.
Definition docnode.h:341
int index() const
Definition docnode.h:345
QCString name() const
Definition docnode.h:344
Node representing an item of a cross-referenced list.
Definition docnode.h:529
QCString name() const
Definition docnode.h:532
bool isInline() const
Definition docnode.h:536
QCString relPath() const
Definition docnode.h:534
Node representing a Hypertext reference.
Definition docnode.h:832
QCString url() const
Definition docnode.h:839
QCString file() const
Definition docnode.h:840
Node representing a horizontal ruler.
Definition docnode.h:216
Node representing an HTML blockquote.
Definition docnode.h:1297
Node representing a HTML table caption.
Definition docnode.h:1234
QCString anchor() const
Definition docnode.h:1241
QCString file() const
Definition docnode.h:1240
Node representing a HTML table cell.
Definition docnode.h:1199
const HtmlAttribList & attribs() const
Definition docnode.h:1211
Node representing a HTML description data.
Definition docnode.h:1187
Node representing a Html description list.
Definition docnode.h:910
Node representing a Html description item.
Definition docnode.h:897
Node Html details.
Definition docnode.h:866
const DocNodeVariant * summary() const
Definition docnode.h:873
Node Html heading.
Definition docnode.h:882
Node representing a Html list.
Definition docnode.h:1009
const HtmlAttribList & attribs() const
Definition docnode.h:1015
Type type() const
Definition docnode.h:1014
Node representing a HTML list item.
Definition docnode.h:1171
const HtmlAttribList & attribs() const
Definition docnode.h:1176
Node representing a HTML table row.
Definition docnode.h:1252
bool isHeading() const
Definition docnode.cpp:2002
const HtmlAttribList & attribs() const
Definition docnode.h:1258
Node Html summary.
Definition docnode.h:853
Node representing a HTML table.
Definition docnode.h:1275
size_t numColumns() const
Definition docnode.h:1284
const DocNodeVariant * caption() const
Definition docnode.cpp:2250
Node representing an image.
Definition docnode.h:642
QCString relPath() const
Definition docnode.h:652
QCString name() const
Definition docnode.h:648
QCString height() const
Definition docnode.h:651
Type type() const
Definition docnode.h:647
QCString width() const
Definition docnode.h:650
@ DocBook
Definition docnode.h:644
bool isInlineImage() const
Definition docnode.h:654
bool hasCaption() const
Definition docnode.h:649
Node representing a include/dontinclude operator block.
Definition docnode.h:477
bool stripCodeComments() const
Definition docnode.h:506
bool isLast() const
Definition docnode.h:503
QCString includeFileName() const
Definition docnode.h:509
QCString text() const
Definition docnode.h:499
QCString context() const
Definition docnode.h:501
QCString exampleFile() const
Definition docnode.h:508
int line() const
Definition docnode.h:497
Type type() const
Definition docnode.h:485
bool isFirst() const
Definition docnode.h:502
bool showLineNo() const
Definition docnode.h:498
bool isExample() const
Definition docnode.h:507
Node representing an included text block from file.
Definition docnode.h:435
QCString blockId() const
Definition docnode.h:454
QCString extension() const
Definition docnode.h:450
bool stripCodeComments() const
Definition docnode.h:455
@ LatexInclude
Definition docnode.h:437
@ SnippetWithLines
Definition docnode.h:438
@ DontIncWithLines
Definition docnode.h:439
@ IncWithLines
Definition docnode.h:438
@ HtmlInclude
Definition docnode.h:437
@ VerbInclude
Definition docnode.h:437
@ DontInclude
Definition docnode.h:437
@ DocbookInclude
Definition docnode.h:439
Type type() const
Definition docnode.h:451
QCString exampleFile() const
Definition docnode.h:457
QCString text() const
Definition docnode.h:452
QCString file() const
Definition docnode.h:449
bool trimLeft() const
Definition docnode.h:459
bool isExample() const
Definition docnode.h:456
QCString context() const
Definition docnode.h:453
Node representing an entry in the index.
Definition docnode.h:552
QCString entry() const
Definition docnode.h:559
Node representing an internal section of documentation.
Definition docnode.h:978
Node representing an internal reference to some item.
Definition docnode.h:816
QCString file() const
Definition docnode.h:820
QCString anchor() const
Definition docnode.h:822
Node representing a line break.
Definition docnode.h:202
Node representing a word that can be linked to something.
Definition docnode.h:165
QCString file() const
Definition docnode.h:171
QCString word() const
Definition docnode.h:170
QCString anchor() const
Definition docnode.h:174
Node representing a mermaid file.
Definition docnode.h:749
Node representing a msc file.
Definition docnode.h:722
DocNodeVariant * parent()
Definition docnode.h:90
Node representing an block of paragraphs.
Definition docnode.h:988
Node representing a paragraph in the documentation tree.
Definition docnode.h:1089
Node representing a parameter list.
Definition docnode.h:1131
const DocNodeList & parameters() const
Definition docnode.h:1135
const DocNodeList & paramTypes() const
Definition docnode.h:1136
DocParamSect::Direction direction() const
Definition docnode.h:1139
const DocNodeList & paragraphs() const
Definition docnode.h:1137
Node representing a parameter section.
Definition docnode.h:1062
bool hasInOutSpecifier() const
Definition docnode.h:1078
bool hasTypeSpecifier() const
Definition docnode.h:1079
Type type() const
Definition docnode.h:1077
Node representing a uml file.
Definition docnode.h:740
Node representing a reference to some item.
Definition docnode.h:787
QCString anchor() const
Definition docnode.h:794
QCString targetTitle() const
Definition docnode.h:795
bool isSubPage() const
Definition docnode.h:801
QCString file() const
Definition docnode.h:791
bool hasLinkText() const
Definition docnode.h:797
Root node of documentation tree.
Definition docnode.h:1319
Node representing a reference to a section.
Definition docnode.h:944
Node representing a list of section references.
Definition docnode.h:968
Node representing a normal section.
Definition docnode.h:923
QCString file() const
Definition docnode.h:931
QCString anchor() const
Definition docnode.h:929
const DocNodeVariant * title() const
Definition docnode.h:928
Node representing a separator.
Definition docnode.h:365
QCString chars() const
Definition docnode.h:369
Node representing a simple list.
Definition docnode.h:999
Node representing a simple list item.
Definition docnode.h:1159
const DocNodeVariant * paragraph() const
Definition docnode.h:1163
Node representing a simple section.
Definition docnode.h:1026
Type type() const
Definition docnode.h:1035
const DocNodeVariant * title() const
Definition docnode.h:1042
bool hasTitle() const
Definition docnode.cpp:3145
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1053
Node representing a style change.
Definition docnode.h:268
Style style() const
Definition docnode.h:307
bool enable() const
Definition docnode.h:309
Node representing a special symbol.
Definition docnode.h:328
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:332
Root node of a text fragment.
Definition docnode.h:1310
Node representing a simple section title.
Definition docnode.h:608
bool hasTitle() const
Definition docnode.h:613
Node representing a URL (or email address).
Definition docnode.h:188
QCString url() const
Definition docnode.h:192
bool isEmail() const
Definition docnode.h:193
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:376
QCString srcFile() const
Definition docnode.h:397
int srcLine() const
Definition docnode.h:398
QCString height() const
Definition docnode.h:392
bool hasCaption() const
Definition docnode.h:390
QCString language() const
Definition docnode.h:388
const DocNodeList & children() const
Definition docnode.h:395
bool isExample() const
Definition docnode.h:385
QCString context() const
Definition docnode.h:384
Type type() const
Definition docnode.h:382
QCString text() const
Definition docnode.h:383
QCString exampleFile() const
Definition docnode.h:386
QCString engine() const
Definition docnode.h:393
QCString relPath() const
Definition docnode.h:387
@ JavaDocLiteral
Definition docnode.h:378
QCString width() const
Definition docnode.h:391
Node representing a VHDL flow chart.
Definition docnode.h:758
CodeParserInterface & getCodeParser(const QCString &langExt)
void pushHidden(bool hide)
bool popHidden()
Node representing some amount of white space.
Definition docnode.h:354
QCString chars() const
Definition docnode.h:358
Node representing a word.
Definition docnode.h:153
QCString word() const
Definition docnode.h:156
Node representing an item of a cross-referenced list.
Definition docnode.h:621
QCString anchor() const
Definition docnode.h:625
QCString file() const
Definition docnode.h:624
QCString title() const
Definition docnode.h:626
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)
OutputCodeList & m_ci
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
Definition doxygen.h:105
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity.
Definition emoji.cpp:2016
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978
A model of a file symbol.
Definition filedef.h:99
virtual QCString absFilePath() const =0
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
std::string fileName() const
Definition fileinfo.cpp:118
std::string dirPath(bool absPath=true) const
Definition fileinfo.cpp:137
bool empty() const
checks whether the container is empty
Definition growvector.h:140
T & front()
access the first element
Definition growvector.h:130
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.
Definition mermaid.cpp:117
static QCString imageExtension(ImageFormat imageFormat)
Definition mermaid.cpp:43
static MermaidManager & instance()
Definition mermaid.cpp:33
static ImageFormat convertToImageFormat(OutputFormat outputFormat)
Definition mermaid.cpp:54
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.
Definition mermaid.cpp:70
Class representing a list of different code generators.
Definition outputlist.h:165
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format, bool toIndex)
Convert a PlantUML file to an image.
Definition plantuml.cpp:202
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.
Definition plantuml.cpp:31
static PlantumlManager & instance()
Definition plantuml.cpp:232
This is an alternative implementation of QCString.
Definition qcstring.h:101
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:593
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
const std::string & str() const
Definition qcstring.h:552
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
Definition qcstring.h:185
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172
Text streaming class that buffers data.
Definition textstream.h:36
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine, bool toIndex)
Definition dia.cpp:28
QCString convertToDocBook(const QCString &s, const bool retainNewline)
static QCString filterId(const QCString &s)
#define DB_VIS_C
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)
Definition dot.cpp:230
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:268
Translator * theTranslator
Definition language.cpp:71
#define err(fmt,...)
Definition message.h:127
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine, bool toIndex)
Definition msc.cpp:157
Portable versions of functions that are platform dependent.
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
Options to configure the code parser.
Definition parserintf.h:78
CodeParserOptions & setStartLine(int lineNr)
Definition parserintf.h:101
CodeParserOptions & setShowLineNumbers(bool enable)
Definition parserintf.h:113
CodeParserOptions & setFileDef(const FileDef *fd)
Definition parserintf.h:98
SrcLangExt
Definition types.h:207
QCString writeFileContents(const QCString &baseName, const QCString &extension, const QCString &content, bool &exists)
Thread-safe function to write a string to a file.
Definition util.cpp:6977
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5231
QCString stripPath(const QCString &s)
Definition util.cpp:4969
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:5570
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5249
QCString getDotImageExtension()
Definition util.cpp:6307
QCString makeBaseName(const QCString &name, const QCString &ext)
Definition util.cpp:4985
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:5875
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5273
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:2904
A bunch of utility functions.