diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 81 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 9 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-html-templates.qdocconf | 5 | ||||
-rw-r--r-- | tools/qdoc3/text.h | 2 |
4 files changed, 68 insertions, 29 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 6c0369b..7064160 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -259,6 +259,9 @@ void HtmlGenerator::initializeGenerator(const Config &config) postHeader = config.getString(HtmlGenerator::format() + Config::dot + HTMLGENERATOR_POSTHEADER); + postPostHeader = config.getString(HtmlGenerator::format() + + Config::dot + + HTMLGENERATOR_POSTPOSTHEADER); footer = config.getString(HtmlGenerator::format() + Config::dot + HTMLGENERATOR_FOOTER); @@ -1671,31 +1674,44 @@ QString HtmlGenerator::fileExtension(const Node * /* node */) const return "html"; } -#if 0 -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>Qt Reference Documentation</title> - <link rel="stylesheet" type="text/css" href="style/style.css" /> - <!--[if IE]> - <meta name="MSSmartTagsPreventParsing" content="true"> - <meta http-equiv="imagetoolbar" content="no"> - <![endif]--> - <!--[if lt IE 7]> - <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> - <![endif]--> - <!--[if IE 7]> - <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> - <![endif]--> - <!--[if IE 8]> - <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> - <![endif]--> - - <script src="scripts/jquery.js" type="text/javascript"></script> - -</head> -#endif +void HtmlGenerator::generateBreadCrumbs(const QString& title, + const Node *node, + CodeMarker *marker) +{ + Text breadcrumb; + if (node->type() == Node::Class) { + const ClassNode* cn = static_cast<const ClassNode*>(node); + QString name = node->moduleName(); + if (!name.isEmpty()) { + out() << " <li>"; + breadcrumb << Atom(Atom::AutoLink,name); + generateText(breadcrumb, node, marker); + out() << "</li>\n"; + } + breadcrumb.clear(); + if (!cn->name().isEmpty()) { + out() << " <li>"; + breadcrumb << Atom(Atom::AutoLink,cn->name()); + generateText(breadcrumb, 0, marker); + out() << "</li>\n"; + } + } + else if (node->type() == Node::Fake) { + const FakeNode* fn = static_cast<const FakeNode*>(node); + if (node->subType() == Node::Module) { + } + else if (node->subType() == Node::Page) { + } + else if (node->subType() == Node::QmlClass) { + } + else if (node->subType() == Node::Example) { + } + } + else if (node->type() == Node::Namespace) { + const NamespaceNode* nsn = static_cast<const NamespaceNode*>(node); + } +} + void HtmlGenerator::generateHeader(const QString& title, const Node *node, @@ -1748,9 +1764,13 @@ void HtmlGenerator::generateHeader(const QString& title, else out() << "<body class=\"\">\n"; +#ifdef GENERATE_MAC_REFS if (mainPage) generateMacRef(node, marker); +#endif out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + generateBreadCrumbs(title,node,marker); + out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); #if 0 // Removed for new docf format. MWS if (node && !node->links().empty()) @@ -3687,10 +3707,14 @@ void HtmlGenerator::generateDetailedMember(const Node *node, { const EnumNode *enume; +#ifdef GENERATE_MAC_REFS generateMacRef(node, marker); +#endif if (node->type() == Node::Enum && (enume = static_cast<const EnumNode *>(node))->flagsType()) { +#ifdef GENERATE_MAC_REFS generateMacRef(enume->flagsType(), marker); +#endif out() << "<h3 class=\"flags\">"; out() << "<a name=\"" + refForNode(node) + "\"></a>"; generateSynopsis(enume, relative, marker, CodeMarker::Detailed); @@ -4204,6 +4228,10 @@ void HtmlGenerator::generateStatus(const Node *node, CodeMarker *marker) } } +#ifdef GENERATE_MAC_REFS +/* + No longer valid. + */ void HtmlGenerator::generateMacRef(const Node *node, CodeMarker *marker) { if (!pleaseGenerateMacRef || marker == 0) @@ -4213,6 +4241,7 @@ void HtmlGenerator::generateMacRef(const Node *node, CodeMarker *marker) foreach (const QString &macRef, macRefs) out() << "<a name=\"" << "//apple_ref/" << macRef << "\"></a>\n"; } +#endif void HtmlGenerator::beginLink(const QString &link, const Node *node, @@ -4314,7 +4343,9 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, CodeMarker *marker) { const QmlPropertyNode* qpn = 0; +#ifdef GENERATE_MAC_REFS generateMacRef(node, marker); +#endif out() << "<div class=\"qmlitem\">"; if (node->subType() == Node::QmlPropertyGroup) { const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(node); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 2a365e9..68e620e 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -131,6 +131,9 @@ class HtmlGenerator : public PageGenerator const Node *relative, CodeMarker *marker, const Atom *atom = 0); + void generateBreadCrumbs(const QString& title, + const Node *node, + CodeMarker *marker); void generateHeader(const QString& title, const Node *node = 0, CodeMarker *marker = 0, bool mainPage = true); void generateTitle(const QString& title, @@ -262,7 +265,9 @@ class HtmlGenerator : public PageGenerator virtual void generateIndex(const QString &fileBase, const QString &url, const QString &title); +#ifdef GENERATE_MAC_REFS void generateMacRef(const Node *node, CodeMarker *marker); +#endif void beginLink(const QString &link, const Node *node, const Node *relative, @@ -303,6 +308,7 @@ class HtmlGenerator : public PageGenerator QRegExp funcLeftParen; QString style; QString postHeader; + QString postPostHeader; QString footer; QString address; bool pleaseGenerateMacRef; @@ -337,8 +343,9 @@ class HtmlGenerator : public PageGenerator #define HTMLGENERATOR_ADDRESS "address" #define HTMLGENERATOR_FOOTER "footer" -#define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me +#define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me #define HTMLGENERATOR_POSTHEADER "postheader" +#define HTMLGENERATOR_POSTPOSTHEADER "postpostheader" #define HTMLGENERATOR_STYLE "style" #define HTMLGENERATOR_STYLESHEETS "stylesheets" #define HTMLGENERATOR_CUSTOMHEADELEMENTS "customheadelements" diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 8253c45..944a32c 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -87,8 +87,9 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <div class=\"breadcrumb toolblock\">\n" \ " <ul>\n" \ " <li class=\"first\"><a href=\"index.html\">Home</a></li>\n" \ - " <!-- Bread crumbs goes here -->\n" \ - " </ul>\n" \ + " <!-- Bread crumbs goes here -->\n" + +HTML.postpostheader = " </ul>\n" \ " </div>\n" \ " <div class=\"toolbuttons toolblock\">\n" \ " <ul>\n" \ diff --git a/tools/qdoc3/text.h b/tools/qdoc3/text.h index fa3ecda..879f6da 100644 --- a/tools/qdoc3/text.h +++ b/tools/qdoc3/text.h @@ -75,6 +75,7 @@ class Text const Atom *lastAtom() const { return last; } Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0) const; void dump() const; + void clear(); static Text subText(const Atom *begin, const Atom *end = 0); static Text sectionHeading(const Atom *sectionBegin); @@ -82,7 +83,6 @@ class Text static int compare(const Text &text1, const Text &text2); private: - void clear(); Atom *first; Atom *last; |