aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generators/qtdoc/qtdocgenerator.cpp33
-rw-r--r--generators/qtdoc/qtdocgenerator.h3
2 files changed, 34 insertions, 2 deletions
diff --git a/generators/qtdoc/qtdocgenerator.cpp b/generators/qtdoc/qtdocgenerator.cpp
index d301a0cd..6e851995 100644
--- a/generators/qtdoc/qtdocgenerator.cpp
+++ b/generators/qtdoc/qtdocgenerator.cpp
@@ -24,6 +24,7 @@
#include "qtdocgenerator.h"
#include <reporthandler.h>
#include <qtdocparser.h>
+#include <doxygenparser.h>
#include <typedatabase.h>
#include <algorithm>
#include <QtCore/QStack>
@@ -145,6 +146,32 @@ QtXmlToSphinx::QtXmlToSphinx(QtDocGenerator* generator, const QString& doc, cons
m_handlerMap.insert("printuntil", &QtXmlToSphinx::handleUselessTag);
m_handlerMap.insert("relation", &QtXmlToSphinx::handleUselessTag);
+ // Doxygen tags
+ m_handlerMap.insert("title", &QtXmlToSphinx::handleHeadingTag);
+ m_handlerMap.insert("ref", &QtXmlToSphinx::handleParaTag);
+ m_handlerMap.insert("computeroutput", &QtXmlToSphinx::handleParaTag);
+ m_handlerMap.insert("detaileddescription", &QtXmlToSphinx::handleParaTag);
+ m_handlerMap.insert("name", &QtXmlToSphinx::handleParaTag);
+ m_handlerMap.insert("listitem", &QtXmlToSphinx::handleItemTag);
+ m_handlerMap.insert("parametername", &QtXmlToSphinx::handleItemTag);
+ m_handlerMap.insert("parameteritem", &QtXmlToSphinx::handleItemTag);
+ m_handlerMap.insert("ulink", &QtXmlToSphinx::handleLinkTag);
+ m_handlerMap.insert("itemizedlist", &QtXmlToSphinx::handleListTag);
+ m_handlerMap.insert("parameternamelist", &QtXmlToSphinx::handleListTag);
+ m_handlerMap.insert("parameterlist", &QtXmlToSphinx::handleListTag);
+
+ // Doxygen ignored tags
+ m_handlerMap.insert("highlight", &QtXmlToSphinx::handleIgnoredTag);
+ m_handlerMap.insert("linebreak", &QtXmlToSphinx::handleIgnoredTag);
+ m_handlerMap.insert("programlisting", &QtXmlToSphinx::handleIgnoredTag);
+ m_handlerMap.insert("xreftitle", &QtXmlToSphinx::handleIgnoredTag);
+ m_handlerMap.insert("sp", &QtXmlToSphinx::handleIgnoredTag);
+ m_handlerMap.insert("entry", &QtXmlToSphinx::handleIgnoredTag);
+ m_handlerMap.insert("simplesect", &QtXmlToSphinx::handleIgnoredTag);
+ m_handlerMap.insert("verbatim", &QtXmlToSphinx::handleIgnoredTag);
+ m_handlerMap.insert("xrefsect", &QtXmlToSphinx::handleIgnoredTag);
+ m_handlerMap.insert("xrefdescription", &QtXmlToSphinx::handleIgnoredTag);
+
m_result = transform(doc);
}
@@ -929,7 +956,7 @@ static QString getFuncName(const AbstractMetaFunction* cppFunc) {
return result.replace("::", ".");
}
-QtDocGenerator::QtDocGenerator() : m_docParser(new QtDocParser)
+QtDocGenerator::QtDocGenerator() : m_docParser(0)
{
}
@@ -1599,6 +1626,9 @@ bool QtDocGenerator::doSetup(const QMap<QString, QString>& args)
m_codeSnippetDirs = args.value("documentation-code-snippets-dir", m_libSourceDir).split(PATH_SEP);
m_extraSectionDir = args.value("documentation-extra-sections-dir");
+ m_docParser = args.value("doc-parser") == "doxygen" ? reinterpret_cast<DocParser*>(new DoxygenParser) : reinterpret_cast<DocParser*>(new QtDocParser);
+ ReportHandler::warning("doc-parser: " + args.value("doc-parser"));
+
if (m_libSourceDir.isEmpty() || m_docDataDir.isEmpty()) {
ReportHandler::warning("Documentation data dir and/or Qt source dir not informed, "
"documentation will not be extracted from Qt sources.");
@@ -1614,6 +1644,7 @@ bool QtDocGenerator::doSetup(const QMap<QString, QString>& args)
QMap<QString, QString> QtDocGenerator::options() const
{
QMap<QString, QString> options;
+ options.insert("doc-parser", "The documentation parser used to interpret the documentaion input files (qdoc3|doxygen)");
options.insert("library-source-dir", "Directory where library source code is located");
options.insert("documentation-data-dir", "Directory with XML files generated by documentation tool (qdoc3 or Doxygen)");
options.insert("documentation-code-snippets-dir", "Directory used to search code snippets used by the documentation");
diff --git a/generators/qtdoc/qtdocgenerator.h b/generators/qtdoc/qtdocgenerator.h
index 660d28bb..d88e3eef 100644
--- a/generators/qtdoc/qtdocgenerator.h
+++ b/generators/qtdoc/qtdocgenerator.h
@@ -29,6 +29,7 @@
#include <QXmlStreamReader>
#include <abstractmetalang.h>
#include "generator.h"
+#include "docparser.h"
class QtDocParser;
class AbstractMetaFunction;
@@ -219,7 +220,7 @@ private:
QString m_extraSectionDir;
QStringList m_functionList;
QMap<QString, QStringList> m_packages;
- QtDocParser* m_docParser;
+ DocParser* m_docParser;
};
#endif // DOCGENERATOR_H