diff options
Diffstat (limited to 'tools/qdoc3/ditaxmlgenerator.cpp')
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 131 |
1 files changed, 122 insertions, 9 deletions
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index affe9e1..66f4a91 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -96,11 +96,21 @@ QString DitaXmlGenerator::ditaTags[] = "apiDesc", "APIMap", "apiName", + "audience", + "author", "b", "body", "bodydiv", + "brand", + "category", "codeblock", "comment", + "component", + "copyrholder", + "copyright", + "copyryear", + "created", + "critdates", "cxxAPIMap", "cxxClass", "cxxClassAbstract", @@ -194,6 +204,8 @@ QString DitaXmlGenerator::ditaTags[] = "cxxVariableReimplemented", "cxxVariableScopedName", "cxxVariableStorageClassSpecifierStatic", + "data", + "data-about", "dd", "dl", "dlentry", @@ -203,21 +215,33 @@ QString DitaXmlGenerator::ditaTags[] = "i", "image", "keyword", + "keywords", "li", "link", "linktext", "lq", + "metadata", "ol", + "othermeta", "p", "parameter", + "permissions", "ph", + "platform", "pre", + "prodinfo", + "prodname", + "prolog", + "publisher", "related-links", + "resourceid", + "revised", "row", "section", "sectiondiv", "shortdesc", "simpletable", + "source", "stentry", "sthead", "strow", @@ -233,8 +257,11 @@ QString DitaXmlGenerator::ditaTags[] = "topicmeta", "topicref", "tt", - "ul", "u", + "ul", + "unknown", + "vrm", + "vrmlist", "xref", "" }; @@ -1497,7 +1524,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } } else { - qDebug() << "ATTR:" << attr; QStringList spans = attr.split(","); if (spans.size() == 2) { if ((spans[0].toInt()>1) || (spans[1].toInt()>1)) { @@ -1611,9 +1637,8 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark */ generateHeader(inner, fullTitle); generateBrief(inner, marker); // <shortdesc> - - // not included: <prolog> - + writeProlog(inner,marker); + writeStartTag(DT_cxxClassDetail); writeStartTag(DT_cxxClassDefinition); writeLocation(nsn); @@ -1735,8 +1760,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateHeader(inner, fullTitle); generateBrief(inner, marker); // <shortdesc> - - // not included: <prolog> + writeProlog(inner,marker); writeStartTag(DT_cxxClassDetail); writeStartTag(DT_cxxClassDefinition); @@ -1877,6 +1901,8 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark */ generateHeader(inner, fullTitle); generateBrief(inner, marker); // <shortdesc> + writeProlog(inner,marker); + writeStartTag(DT_cxxClassDetail); writeStartTag(DT_apiDesc); xmlWriter().writeAttribute("spectitle",title); @@ -1996,9 +2022,8 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateHeader(inner, fullTitle); generateBrief(inner, marker); // <shortdesc> + writeProlog(inner,marker); - // not included: <prolog> - writeStartTag(DT_cxxClassDetail); writeStartTag(DT_apiDesc); xmlWriter().writeAttribute("spectitle",title); @@ -2107,6 +2132,8 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode* fake, CodeMarker* marker generateHeader(fake, fullTitle); generateBrief(fake, marker); // <shortdesc> + writeProlog(fake, marker); + writeStartTag(DT_body); if (fake->subType() == Node::Module) { generateStatus(fake, marker); @@ -5501,4 +5528,90 @@ void DitaXmlGenerator::writeDitaMap() endSubPage(); } +/*! + Writes the <prolog> element for the \a inner node + using the \a marker. The <prolog> element contains + the <metadata> element, plus some others. This + function writes one or more of these elements: + + \list + \o <audience> + \o <author> + \o <brand> + \o <category> + \o <compomnent> + \o <copyrholder> + \o <copyright> + \o <created> + \o <copyryear> + \o <critdates> + \o <keyword> + \o <keywords> + \o <metadata> + \o <othermeta> + \o <permissions> + \o <platform> + \o <prodinfo> + \o <prodname> + \o <prolog> + \o <publisher> + \o <resourceid> + \o <revised> + \o <source> + \o <tm> + \o <unknown> + \o <vrm> + \o <vrmlist> + \endlist + + */ +void +DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker) +{ + if (!inner) + return; + writeStartTag(DT_prolog); + + writeStartTag(DT_author); + QString author = inner->author(); + if (author.isEmpty()) + author = "Qt Development Frameworks"; + xmlWriter().writeCharacters(author); + writeEndTag(); // <author> + + writeStartTag(DT_metadata); + writeStartTag(DT_category); + QString category = "Page"; + if (inner->type() == Node::Class) + category = "C++ Class"; + else if (inner->type() == Node::Namespace) + category = "C++ Namespace"; + else if (inner->type() == Node::Fake) { + if (inner->subType() == Node::QmlBasicType) + category = "QML Class"; + else if (inner->subType() == Node::QmlClass) + category = "QML Basic Type"; + else if (inner->subType() == Node::HeaderFile) + category = "Header File"; + else if (inner->subType() == Node::Module) + category = "Module"; + else if (inner->subType() == Node::File) + category = "Example Source File"; + else if (inner->subType() == Node::Example) + category = "Example"; + else if (inner->subType() == Node::Image) + category = "Image"; + else if (inner->subType() == Node::Group) + category = "Group"; + else if (inner->subType() == Node::Page) + category = "Page"; + else if (inner->subType() == Node::ExternalPage) + category = "External Page"; // Is this necessary? + } + xmlWriter().writeCharacters(category); + writeEndTag(); // <category> + writeEndTag(); // <metadata> + writeEndTag(); // <prolog> +} + QT_END_NAMESPACE |