summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-01-06 18:39:56 (GMT)
committerGitHub <noreply@github.com>2020-01-06 18:39:56 (GMT)
commitf8c32f996cac5db890c29958989d25ada389772b (patch)
tree6fc7a78206a4b68e2f519a46f0104f8beb4391f9
parentd6ab8a10db09394f2e8368b6f4e787910481f91c (diff)
parentafe51035be938b90b1790aa40937a93207ccdd34 (diff)
downloadDoxygen-f8c32f996cac5db890c29958989d25ada389772b.zip
Doxygen-f8c32f996cac5db890c29958989d25ada389772b.tar.gz
Doxygen-f8c32f996cac5db890c29958989d25ada389772b.tar.bz2
Merge pull request #7481 from albert-github/feature/bug_xmlout_for_only
Showing information from all \*only commands in XML output
-rw-r--r--doc/commands.doc35
-rw-r--r--src/xmldocvisitor.cpp27
-rw-r--r--templates/xml/compound.xsd1
-rw-r--r--testing/020/indexpage.xml16
-rw-r--r--testing/020_only.dox2
5 files changed, 63 insertions, 18 deletions
diff --git a/doc/commands.doc b/doc/commands.doc
index 9bd3f66..3415dce 100644
--- a/doc/commands.doc
+++ b/doc/commands.doc
@@ -2498,6 +2498,7 @@ Commands for displaying examples
Files or directories that doxygen should look for can be specified using the
\ref cfg_example_path "EXAMPLE_PATH" tag of doxygen's configuration file.
+ \sa section \ref cmdlatexonly "\\latexonly".
<hr>
\htmlonly</p><center><p>\endhtmlonly
@@ -2697,8 +2698,9 @@ only copy the detailed documentation, not the brief description.
\section cmddocbookonly \\docbookonly
\addindex \\docbookonly
- Starts a block of text that will be verbatim included in the
- generated DocBook documentation only. The block ends with a
+ Starts a block of text that only will be verbatim included in the
+ generated DocBook documentation and tagged with `<docbookonly>` in the generated
+ XML output. The block ends with a
\ref cmdenddocbookonly "\\enddocbookonly" command.
\sa section \ref cmdmanonly "\\manonly",
@@ -3142,8 +3144,9 @@ class Receiver
\section cmdhtmlonly \\htmlonly ["[block]"]
\addindex \\htmlonly
- Starts a block of text that will be verbatim included in the
- generated HTML documentation only. The block ends with a
+ Starts a block of text that only will be verbatim included in the
+ generated HTML documentation and tagged with `<htmlonly>` in the generated
+ XML output. The block ends with a
\ref cmdendhtmlonly "\\endhtmlonly" command.
This command can be used to include HTML code that is too complex
@@ -3233,8 +3236,9 @@ class Receiver
\section cmdlatexonly \\latexonly
\addindex \\latexonly
- Starts a block of text that will be verbatim included in the
- generated \LaTeX documentation only. The block ends with a
+ Starts a block of text that only will be verbatim included in the
+ generated \LaTeX documentation and tagged with `<latexonly>` in the generated
+ XML output. The block ends with a
\ref cmdendlatexonly "\\endlatexonly" command.
This command can be used to include \LaTeX code that is too
@@ -3249,15 +3253,17 @@ class Receiver
\sa sections \ref cmdrtfonly "\\rtfonly",
\ref cmdxmlonly "\\xmlonly",
\ref cmdmanonly "\\manonly",
- \ref cmdhtmlonly "\\htmlonly", and
- \ref cmdhtmlonly "\\docbookonly".
+ \ref cmdhtmlonly "\\htmlonly",
+ \ref cmddocbookonly "\\docbookonly", and
+ \ref cmdlatexinclude "\\latexinclude".
<hr>
\section cmdmanonly \\manonly
\addindex \\manonly
- Starts a block of text that will be verbatim included in the
- generated MAN documentation only. The block ends with a
+ Starts a block of text that only will be verbatim included in the
+ generated MAN documentation and tagged with `<manonly>` in the generated
+ XML output. The block ends with a
\ref cmdendmanonly "\\endmanonly" command.
This command can be used to include groff code directly into
@@ -3334,8 +3340,9 @@ class Receiver
\section cmdrtfonly \\rtfonly
\addindex \\rtfonly
- Starts a block of text that will be verbatim included in the
- generated RTF documentation only. The block ends with a
+ Starts a block of text that only will be verbatim included in the
+ generated RTF documentation and tagged with `<rtfonly>` in the generated
+ XML output. The block ends with a
\ref cmdendrtfonly "\\endrtfonly" command.
This command can be used to include RTF code that is too complex
@@ -3371,8 +3378,8 @@ class Receiver
\section cmdxmlonly \\xmlonly
\addindex \\xmlonly
- Starts a block of text that will be verbatim included in the
- generated XML output only. The block ends with a
+ Starts a block of text that only will be verbatim included in the
+ generated XML output. The block ends with a
\ref cmdendxmlonly "\\endxmlonly" command.
This command can be used to include custom XML tags.
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 1e6becb..019bef1 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -265,11 +265,36 @@ void XmlDocVisitor::visit(DocVerbatim *s)
m_t << "</verbatim>";
break;
case DocVerbatim::HtmlOnly:
+ if (s->isBlock())
+ {
+ m_t << "<htmlonly block=\"yes\">";
+ }
+ else
+ {
+ m_t << "<htmlonly>";
+ }
+ filter(s->text());
+ m_t << "</htmlonly>";
+ break;
case DocVerbatim::RtfOnly:
+ m_t << "<rtfonly>";
+ filter(s->text());
+ m_t << "</rtfonly>";
+ break;
case DocVerbatim::ManOnly:
+ m_t << "<manonly>";
+ filter(s->text());
+ m_t << "</manonly>";
+ break;
case DocVerbatim::LatexOnly:
+ m_t << "<latexonly>";
+ filter(s->text());
+ m_t << "</latexonly>";
+ break;
case DocVerbatim::DocbookOnly:
- /* nothing */
+ m_t << "<docbookonly>";
+ filter(s->text());
+ m_t << "</docbookonly>";
break;
case DocVerbatim::XmlOnly:
m_t << s->text();
diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd
index ef1374f..67d7843 100644
--- a/templates/xml/compound.xsd
+++ b/templates/xml/compound.xsd
@@ -426,6 +426,7 @@
<xsd:element name="xmlonly" type="xsd:string" />
<xsd:element name="rtfonly" type="xsd:string" />
<xsd:element name="latexonly" type="xsd:string" />
+ <xsd:element name="docbookonly" type="xsd:string" />
<xsd:element name="image" type="docImageType" />
<xsd:element name="dot" type="docImageType" />
<xsd:element name="msc" type="docImageType" />
diff --git a/testing/020/indexpage.xml b/testing/020/indexpage.xml
index 8bfb472..8820cf7 100644
--- a/testing/020/indexpage.xml
+++ b/testing/020/indexpage.xml
@@ -6,9 +6,21 @@
<briefdescription>
</briefdescription>
<detaileddescription>
- <para>Text.
+ <para>Text. <htmlonly>
+HTML
+</htmlonly> <htmlonly block="yes">
+HTML with block
+</htmlonly> <rtfonly>
+RTF
+</rtfonly> <manonly>
+Man
+</manonly> <latexonly>
+LaTeX
+</latexonly>
XML
- More text. </para>
+ <docbookonly>
+DocBook
+</docbookonly> More text. </para>
</detaileddescription>
</compounddef>
</doxygen>
diff --git a/testing/020_only.dox b/testing/020_only.dox
index f8e2ce1..fc5afc8 100644
--- a/testing/020_only.dox
+++ b/testing/020_only.dox
@@ -1,4 +1,4 @@
-// objective: test the \*only and \*endonly commands
+// objective: test the \*only and \end*only commands
// check: indexpage.xml
/** \mainpage
* Text.