From 69a5b6f739e514f75a74444313597b40d30ee827 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 9 Mar 2011 08:47:27 +0100 Subject: qdoc: Added element and its contents to the metadata. --- tools/qdoc3/ditaxmlgenerator.cpp | 31 ++++++++++++++++++++++++++----- tools/qdoc3/ditaxmlgenerator.h | 2 ++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 66f4a91..cc7b1da 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -440,7 +440,8 @@ void DitaXmlGenerator::initializeGenerator(const Config &config) Config::dot + DITAXMLGENERATOR_CUSTOMHEADELEMENTS); codeIndent = config.getInt(CONFIG_CODEINDENT); - + version = config.getString(CONFIG_VERSION); + vrm = version.split("."); } /*! @@ -5536,9 +5537,9 @@ void DitaXmlGenerator::writeDitaMap() \list \o - \o + \o * \o - \o + \o * \o \o \o @@ -5547,13 +5548,13 @@ void DitaXmlGenerator::writeDitaMap() \o \o \o - \o + \o * \o \o \o \o \o - \o + \o * \o \o \o @@ -5563,6 +5564,8 @@ void DitaXmlGenerator::writeDitaMap() \o \o \endlist + + \node * means the tag has been used. */ void @@ -5610,6 +5613,24 @@ DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker) } xmlWriter().writeCharacters(category); writeEndTag(); // + if (vrm.size() > 0) { + qDebug() << "VRM" << vrm; + writeStartTag(DT_prodinfo); + writeStartTag(DT_prodname); + xmlWriter().writeCharacters(projectDescription); + writeEndTag(); // + writeStartTag(DT_vrmlist); + writeStartTag(DT_vrm); + if (vrm.size() > 0) + xmlWriter().writeAttribute("version",vrm[0]); + if (vrm.size() > 1) + xmlWriter().writeAttribute("release",vrm[1]); + if (vrm.size() > 2) + xmlWriter().writeAttribute("modification",vrm[2]); + writeEndTag(); // + writeEndTag(); // + writeEndTag(); // + } writeEndTag(); // writeEndTag(); // } diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 32a9b94..3e66318 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -468,6 +468,8 @@ class DitaXmlGenerator : public PageGenerator QString projectDescription; QString projectUrl; QString navigationLinks; + QString version; + QStringList vrm; QStringList stylesheets; QStringList customHeadElements; const Tree* myTree; -- cgit v0.12 From fcc8a1b6ff261f128969458146185c9ed9d5892b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 10 Mar 2011 08:14:27 +0100 Subject: qdoc: Added element to contain the module name. --- tools/qdoc3/ditaxmlgenerator.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index cc7b1da..6ea371c 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -5614,7 +5614,6 @@ DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker) xmlWriter().writeCharacters(category); writeEndTag(); // if (vrm.size() > 0) { - qDebug() << "VRM" << vrm; writeStartTag(DT_prodinfo); writeStartTag(DT_prodname); xmlWriter().writeCharacters(projectDescription); @@ -5629,6 +5628,12 @@ DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker) xmlWriter().writeAttribute("modification",vrm[2]); writeEndTag(); // writeEndTag(); // + QString component = inner->moduleName(); + if (!component.isEmpty()) { + writeStartTag(DT_component); + xmlWriter().writeCharacters(component); + writeEndTag(); // + } writeEndTag(); // } writeEndTag(); // -- cgit v0.12 From e6589006ce57734f25c1ac44434457d5e523fdf0 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 10 Mar 2011 09:25:47 +0100 Subject: qdoc: Added and elements. --- tools/qdoc3/ditaxmlgenerator.cpp | 32 +++++++++++++++++++++++--------- tools/qdoc3/node.cpp | 16 ++++++++++++++++ tools/qdoc3/node.h | 6 ++++++ 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 6ea371c..2c02892 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -5540,7 +5540,7 @@ void DitaXmlGenerator::writeDitaMap() \o * \o \o * - \o + \o * \o \o \o @@ -5550,19 +5550,19 @@ void DitaXmlGenerator::writeDitaMap() \o \o * \o - \o + \o * \o - \o - \o + \o * + \o * \o * - \o + \o * \o \o \o \o \o - \o - \o + \o * + \o * \endlist \node * means the tag has been used. @@ -5575,13 +5575,27 @@ DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker) return; writeStartTag(DT_prolog); - writeStartTag(DT_author); QString author = inner->author(); + writeStartTag(DT_author); if (author.isEmpty()) author = "Qt Development Frameworks"; xmlWriter().writeCharacters(author); writeEndTag(); // - + + QString publisher = inner->publisher(); + writeStartTag(DT_publisher); + if (publisher.isEmpty()) + publisher = "Nokia"; + xmlWriter().writeCharacters(publisher); + writeEndTag(); // + + QString permissions = inner->permissions(); + writeStartTag(DT_permissions); + if (permissions.isEmpty()) + permissions = "all"; + xmlWriter().writeAttribute("view",permissions); + writeEndTag(); // + writeStartTag(DT_metadata); writeStartTag(DT_category); QString category = "Page"; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 161c87a..3b1f280 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -779,6 +779,22 @@ void InnerNode::removeChild(Node *child) Sets the \a author. */ +/*! \fn QString InnerNode::publisher() const + Returns the publisher. + */ + +/*! \fn void InnerNode::setPublisher(const QString& publisher) + Sets the \a publisher. + */ + +/*! \fn QString InnerNode::permissions() const + Returns the permissions. + */ + +/*! \fn void InnerNode::setPermissions(const QString& permissions) + Sets the \a permissions. + */ + /*! Find the module (QtCore, QtGui, etc.) to which the class belongs. We do this by obtaining the full path to the header file's location diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 3869e68..92a7c9f 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -264,6 +264,10 @@ class InnerNode : public Node QString author() const { return author_; } void setAuthor(const QString& author) { author_ = author; } + QString publisher() const { return publisher_; } + void setPublisher(const QString& publisher) { publisher_ = publisher; } + QString permissions() const { return permissions_; } + void setPermissions(const QString& permissions) { permissions_ = permissions; } QStringList primaryKeys(); QStringList secondaryKeys(); const QStringList& pageKeywords() const { return pageKeywds; } @@ -283,6 +287,8 @@ class InnerNode : public Node void removeRelated(Node* pseudoChild); QString author_; + QString publisher_; + QString permissions_; QStringList pageKeywds; QStringList inc; NodeList children; -- cgit v0.12