summaryrefslogtreecommitdiffstats
path: root/src/qdoc/webxmlgenerator.h
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2017-09-12 11:08:57 +0200
committerTopi Reiniƶ <topi.reinio@qt.io>2017-10-17 10:59:59 +0000
commit0f49c09a6fc5d03b100766e781fc0c98cfbdea7a (patch)
tree7505158b3c51369d9274449ed29527a72a8613d6 /src/qdoc/webxmlgenerator.h
parent9b2f166d7c94a8c4385fce1ce55513d677f981b3 (diff)
qdoc: Revive the WebXML generator
Reintroduce the WebXML generator that was last seen in Qt 4.7 - this generator produces XML output similar to .index files, with embedded documentation content. To be used for generating documentation for the PySide project. Uses code from QDocIndexFiles to generate the elements. The generator itself is a specialization of the HTML generator as a lot of the code common to all generators is implemented in the HTML generator and not the base class. This could be cleaned up later on. To use the generator, set the 'outputformats' .qdocconf variable: outputformats = WebXML In addition for PySide/Shiboken, \snippet commands must be configured to generate <snippet> elements instead of hardcoded <code> snippets: quotinginformation = true Task-number: PYSIDE-363 Change-Id: I6b0770c5cd0db3e374f63f9c437fa9e8a77d3f8d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc/webxmlgenerator.h')
-rw-r--r--src/qdoc/webxmlgenerator.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/qdoc/webxmlgenerator.h b/src/qdoc/webxmlgenerator.h
new file mode 100644
index 000000000..fb1a05ebe
--- /dev/null
+++ b/src/qdoc/webxmlgenerator.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef WEBXMLGENERATOR_H
+#define WEBXMLGENERATOR_H
+
+#include <QtCore/qxmlstream.h>
+
+#include "codemarker.h"
+#include "config.h"
+#include "htmlgenerator.h"
+
+QT_BEGIN_NAMESPACE
+
+class WebXMLGenerator : public HtmlGenerator
+{
+public:
+ explicit WebXMLGenerator() {}
+ ~WebXMLGenerator() {}
+
+ void initializeGenerator(const Config &config) override;
+ void terminateGenerator() override;
+ QString format() override;
+ //void generateDocs() override;
+
+protected:
+ int generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker) override;
+ void generateClassLikeNode(Aggregate *inner, CodeMarker *marker) override;
+ void generateDocumentNode(DocumentNode *dn, CodeMarker *marker) override;
+ void generateAggregate(Aggregate *node) override;
+ QString fileExtension() const override;
+
+ virtual const Atom *addAtomElements(QXmlStreamWriter &writer, const Atom *atom,
+ const Node *relative, CodeMarker *marker);
+ virtual void generateIndexSections(QXmlStreamWriter &writer, Node *node,
+ CodeMarker *marker);
+
+
+private:
+ const QPair<QString,QString> anchorForNode(const Node *node);
+ void generateAnnotatedList(QXmlStreamWriter &writer, const Node *relative, const NodeMap &nodeMap);
+ void generateFullName(QXmlStreamWriter &writer, const Node *node,
+ const Node *relative);
+ void generateRelations(QXmlStreamWriter &writer, const Node *node);
+ void startLink(QXmlStreamWriter &writer, const Atom *atom, const Node *node,
+ const QString &link);
+ QString targetType(const Node *node);
+
+ bool inLink;
+ bool inContents;
+ bool inSectionHeading;
+ bool inTableHeader;
+ int numTableRows;
+ bool threeColumnEnumValueTable;
+ QString quoteCommand;
+};
+
+QT_END_NAMESPACE
+
+#endif