From afe51035be938b90b1790aa40937a93207ccdd34 Mon Sep 17 00:00:00 2001
From: albert-github
Date: Sun, 5 Jan 2020 12:19:00 +0100
Subject: Showing information from all `*only commands in XML output
This fix reverts the changes from #381 (i.e issue #4214 "htmlonly content appears in generated XML output (Origin: bugzilla 646002)", as XML is seen as an output format that can be further processed and therefore should contain all possible information.
---
doc/commands.doc | 35 +++++++++++++++++++++--------------
src/xmldocvisitor.cpp | 27 ++++++++++++++++++++++++++-
templates/xml/compound.xsd | 1 +
testing/020/indexpage.xml | 16 ++++++++++++++--
testing/020_only.dox | 2 +-
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".
\htmlonly
\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 `` 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 `` 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 `` 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".
\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 `` 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 `` 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 << "";
break;
case DocVerbatim::HtmlOnly:
+ if (s->isBlock())
+ {
+ m_t << "";
+ }
+ else
+ {
+ m_t << "";
+ }
+ filter(s->text());
+ m_t << "";
+ break;
case DocVerbatim::RtfOnly:
+ m_t << "";
+ filter(s->text());
+ m_t << "";
+ break;
case DocVerbatim::ManOnly:
+ m_t << "";
+ filter(s->text());
+ m_t << "";
+ break;
case DocVerbatim::LatexOnly:
+ m_t << "";
+ filter(s->text());
+ m_t << "";
+ break;
case DocVerbatim::DocbookOnly:
- /* nothing */
+ m_t << "";
+ filter(s->text());
+ m_t << "";
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 @@
+
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 @@
- Text.
+ Text.
+HTML
+
+HTML with block
+
+RTF
+
+Man
+
+LaTeX
+
XML
- More text.
+
+DocBook
+ More text.
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.
--
cgit v0.12