diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 123 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-html-templates.qdocconf | 18 |
2 files changed, 68 insertions, 73 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 1192daf..68c27db 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -514,14 +514,14 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE]; break; case Atom::Code: - out() << "<pre>" + out() << "<pre class=\"highlightedCode\">" << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), marker,relative)) << "</pre>\n"; break; #ifdef QDOC_QML case Atom::Qml: - out() << "<pre>" + out() << "<pre class=\"highlightedCode\">" << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), marker,relative)) << "</pre>\n"; @@ -529,7 +529,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, #endif case Atom::CodeNew: out() << "<p>you can rewrite it as</p>\n" - << "<pre>" + << "<pre class=\"highlightedCode\">" << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), marker,relative)) << "</pre>\n"; @@ -538,9 +538,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "<p>For example, if you have code like</p>\n"; // fallthrough case Atom::CodeBad: - out() << "<pre><font color=\"#404040\">" + out() << "<pre class=\"highlightedCode\">" << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string())))) - << "</font></pre>\n"; + << "</pre>\n"; break; case Atom::FootnoteLeft: // ### For now @@ -849,7 +849,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, if (atom->next() != 0) text = atom->next()->string(); if (atom->type() == Atom::Image) - out() << "<p align=\"center\">"; + out() << "<p class=\"centerAlign\">"; if (fileName.isEmpty()) { out() << "<font color=\"red\">[Missing image " << protectEnc(atom->string()) << "]</font>"; @@ -868,7 +868,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, case Atom::ImageText: break; case Atom::LegaleseLeft: - out() << "<div style=\"padding: 0.5em; background: #e0e0e0; color: black\">"; + out() << "<div class=\"LegaleseLeft\">"; break; case Atom::LegaleseRight: out() << "</div>"; @@ -910,13 +910,13 @@ int HtmlGenerator::generateAtom(const Atom *atom, else if (atom->string() == ATOM_LIST_VALUE) { threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom); if (threeColumnEnumValueTable) { - out() << "<p><table class=\"valuelist\">" + out() << "<table class=\"valuelist\">" << "<tr><th>Constant</th>" << "<th>Value</th>" << "<th>Description</th></tr>\n"; } else { - out() << "<p><table class=\"valuelist\">" + out() << "<table class=\"valuelist\">" << "<tr><th>Constant</th><th>Value</th></tr>\n"; } } @@ -951,10 +951,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, else { // (atom->string() == ATOM_LIST_VALUE) // ### Trenton - out() << "<tr><td valign=\"top\"><tt>" + out() << "<tr><td class=\"topAlign\"><tt>" << protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), relative))) - << "</tt></td><td align=\"center\" valign=\"top\">"; + << "</tt></td><td class=\"centerAlign topAlign\">"; QString itemValue; if (relative->type() == Node::Enum) { @@ -980,7 +980,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, } else if (atom->string() == ATOM_LIST_VALUE) { if (threeColumnEnumValueTable) { - out() << "</td><td valign=\"top\">"; + out() << "</td><td class=\"topAlign\">"; if (matchAhead(atom, Atom::ListItemRight)) out() << " "; } @@ -1010,7 +1010,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "</dl>\n"; } else if (atom->string() == ATOM_LIST_VALUE) { - out() << "</table></p>\n"; + out() << "</table>\n"; } else { out() << "</ol>\n"; @@ -1091,29 +1091,28 @@ int HtmlGenerator::generateAtom(const Atom *atom, } if (!atom->string().isEmpty()) { if (atom->string().contains("%")) - out() << "<p><table class=\"generic\" width=\"" << atom->string() << "\" " - << "align=\"center\">\n"; + out() << "<table class=\"generic centerAlign\" width=\"" << atom->string() << "\">\n "; else { - out() << "<p><table class=\"generic\" align=\"center\">\n"; + out() << "<table class=\"generic centerAlign\">\n"; } } else { - out() << "<p><table class=\"generic\" align=\"center\">\n"; + out() << "<table class=\"generic centerAlign\">\n"; } numTableRows = 0; break; case Atom::TableRight: - out() << "</table></p>\n"; + out() << "</table>\n"; break; case Atom::TableHeaderLeft: - out() << "<thead><tr valign=\"top\" class=\"qt-style\">"; + out() << "<thead><tr class=\"qt-style topAlign\">"; inTableHeader = true; break; case Atom::TableHeaderRight: out() << "</tr>"; if (matchAhead(atom, Atom::TableHeaderLeft)) { skipAhead = 1; - out() << "\n<tr valign=\"top\" class=\"qt-style\">"; + out() << "\n<tr class=\"qt-style topAlign\">"; } else { out() << "</thead>\n"; @@ -1122,9 +1121,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; case Atom::TableRowLeft: if (++numTableRows % 2 == 1) - out() << "<tr valign=\"top\" class=\"odd\">"; + out() << "<tr class=\"odd topAlign\">"; else - out() << "<tr valign=\"top\" class=\"even\">"; + out() << "<tr class=\"even topAlign\">"; break; case Atom::TableRowRight: out() << "</tr>\n"; @@ -1189,11 +1188,11 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "<a name=\"" << Doc::canonicalTitle(atom->string()) << "\"></a>"; break; case Atom::UnhandledFormat: - out() << "<font color=\"red\"><b><Missing HTML></b></font>"; + out() << "<b class=\"redFont\"><Missing HTML></b>"; break; case Atom::UnknownCommand: - out() << "<font color=\"red\"><b><code>\\" << protectEnc(atom->string()) - << "</code></b></font>"; + out() << "<b class=\"redFont\"><code>\\" << protectEnc(atom->string()) + << "</code></b>"; break; #ifdef QDOC_QML case Atom::QmlText: @@ -1811,7 +1810,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) { if (!inner->includes().isEmpty()) { - out() << "<pre>" + out() << "<pre clas=\"highlightedCode\">" << trimmedTrailing(highlightedCode(indent(codeIndent, marker->markedUpIncludes(inner->includes())), marker,inner)) @@ -1845,8 +1844,8 @@ void HtmlGenerator::generateTableOfContents(const Node *node, QString tdTag; if (numColumns > 1) { - tdTag = "<td width=\"" + QString::number((100 + numColumns - 1) / numColumns) + "%\">"; - out() << "<p><table class=\"toc\" width=\"100%\">\n<tr valign=\"top\">" + tdTag = "<td>"; /* width=\"" + QString::number((100 + numColumns - 1) / numColumns) + "%\">";*/ + out() << "<table class=\"toc\">\n<tr class=\"topAlign\">" << tdTag << "\n"; } @@ -1898,7 +1897,7 @@ void HtmlGenerator::generateTableOfContents(const Node *node, } if (numColumns > 1) - out() << "</td></tr></table></p>\n"; + out() << "</td></tr></table>\n"; inContents = false; inLink = false; @@ -2011,7 +2010,7 @@ void HtmlGenerator::generateNavigationBar(const NavigationBar& bar, { if (bar.prev.begin() != 0 || bar.current.begin() != 0 || bar.next.begin() != 0) { - out() << "<p align=\"right\">"; + out() << "<p class=\"rightAlign\">"; if (bar.prev.begin() != 0) { #if 0 out() << "[<a href=\"" << section.previousBaseName() @@ -2187,7 +2186,7 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, CodeMarker *marker, const NodeMap &nodeMap) { - out() << "<p><table class=\"annotated\">\n"; + out() << "<table class=\"annotated\">\n"; int row = 0; foreach (const QString &name, nodeMap.keys()) { @@ -2197,9 +2196,9 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, continue; if (++row % 2 == 1) - out() << "<tr valign=\"top\" class=\"odd\">"; + out() << "<tr class=\"odd topAlign\">"; else - out() << "<tr valign=\"top\" class=\"even\">"; + out() << "<tr class=\"even topAlign\">"; out() << "<th>"; generateFullName(node, relative, marker); out() << "</th>"; @@ -2219,7 +2218,7 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, } out() << "</tr>\n"; } - out() << "</table></p>\n"; + out() << "</table>\n"; } /*! @@ -2372,7 +2371,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, } firstOffset[NumColumns] = classMap.count(); - out() << "<p><table class=\"generic\">\n"; + out() << "<table class=\"generic\">\n"; for (k = 0; k < numRows; k++) { out() << "<tr>\n"; for (i = 0; i < NumColumns; i++) { @@ -2393,7 +2392,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, currentParagraphNo[i] = NumParagraphs - 1; } #endif - out() << "<td align=\"right\">"; + out() << "<td class=\"rightAlign\">"; if (currentOffsetInParagraph[i] == 0) { // start a new paragraph out() << "<b>" @@ -2436,18 +2435,18 @@ void HtmlGenerator::generateCompactList(const Node *relative, } out() << "</tr>\n"; } - out() << "</table></p>\n"; + out() << "</table>\n"; } void HtmlGenerator::generateFunctionIndex(const Node *relative, CodeMarker *marker) { - out() << "<p align=\"center\"><font size=\"+1\"><b>"; + out() << "<p class=\"centerAlign functionIndex\"><b>"; for (int i = 0; i < 26; i++) { QChar ch('a' + i); out() << QString("<a href=\"#%1\">%2</a> ").arg(ch).arg(ch.toUpper()); } - out() << "</b></font></p>\n"; + out() << "</b></p>\n"; char nextLetter = 'a'; char currentLetter; @@ -2715,8 +2714,8 @@ void HtmlGenerator::generateSection(const NodeList& nl, } else { if (twoColumn) - out() << "<p><table class=\"propsummary\">\n" - << "<tr><td valign=\"top\">"; + out() << "<table class=\"propsummary\">\n" + << "<tr><td class=\"topAlign\">"; out() << "<ul>\n"; } @@ -2729,12 +2728,11 @@ void HtmlGenerator::generateSection(const NodeList& nl, } if (name_alignment) { - out() << "<tr><td class=\"memItemLeft\" " - << "align=\"right\" valign=\"top\">"; + out() << "<tr><td class=\"memItemLeft rightAlign topAlign\"> "; } else { if (twoColumn && i == (int) (nl.count() + 1) / 2) - out() << "</ul></td><td valign=\"top\"><ul>\n"; + out() << "</ul></td><td class=\"topAlign\"><ul>\n"; out() << "<li><div class=\"fn\">"; } @@ -2751,7 +2749,7 @@ void HtmlGenerator::generateSection(const NodeList& nl, else { out() << "</ul>\n"; if (twoColumn) - out() << "</td></tr>\n</table></p>\n"; + out() << "</td></tr>\n</table>\n"; } } } @@ -2777,8 +2775,8 @@ void HtmlGenerator::generateSectionList(const Section& section, } else { if (twoColumn) - out() << "<p><table class=\"propsummary\">\n" - << "<tr><td valign=\"top\">"; + out() << "<table class=\"propsummary\">\n" + << "<tr><td class=\"topAlign\">"; out() << "<ul>\n"; } @@ -2791,12 +2789,11 @@ void HtmlGenerator::generateSectionList(const Section& section, } if (name_alignment) { - out() << "<tr><td class=\"memItemLeft\" " - << "align=\"right\" valign=\"top\">"; + out() << "<tr><td class=\"memItemLeft topAlign rightAlign\"> "; } else { if (twoColumn && i == (int) (section.members.count() + 1) / 2) - out() << "</ul></td><td valign=\"top\"><ul>\n"; + out() << "</ul></td><td class=\"topAlign\"><ul>\n"; out() << "<li><div class=\"fn\">"; } @@ -2813,7 +2810,7 @@ void HtmlGenerator::generateSectionList(const Section& section, else { out() << "</ul>\n"; if (twoColumn) - out() << "</td></tr>\n</table></p>\n"; + out() << "</td></tr>\n</table>\n"; } } @@ -2910,7 +2907,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { if (nameAlignment && !done) {// && (i != 0)) Why was this here? - html += "</td><td class=\"memItemRight\" valign=\"bottom\">"; + html += "</td><td class=\"memItemRight bottomAlign\">"; done = true; } i += 2; @@ -3075,8 +3072,8 @@ void HtmlGenerator::generateSectionList(const Section& section, twoColumn = (section.members.count() >= 5); } if (twoColumn) - out() << "<p><table class=\"generic\">\n" - << "<tr><td valign=\"top\">"; + out() << "<table class=\"generic\">\n" + << "<tr><td class=\"topAlign\">"; out() << "<ul>\n"; int i = 0; @@ -3088,7 +3085,7 @@ void HtmlGenerator::generateSectionList(const Section& section, } if (twoColumn && i == (int) (section.members.count() + 1) / 2) - out() << "</ul></td><td valign=\"top\"><ul>\n"; + out() << "</ul></td><td class=\"topAlign\"><ul>\n"; out() << "<li><div class=\"fn\"></div>"; if (style == CodeMarker::Accessors) @@ -3102,7 +3099,7 @@ void HtmlGenerator::generateSectionList(const Section& section, } out() << "</ul>\n"; if (twoColumn) - out() << "</td></tr>\n</table></p>\n"; + out() << "</td></tr>\n</table>\n"; } if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { @@ -4274,15 +4271,15 @@ void HtmlGenerator::generateQmlSummary(const Section& section, twoColumn = (count >= 5); } if (twoColumn) - out() << "<p><table class=\"qmlsummary\">\n" - << "<tr><td valign=\"top\">"; + out() << "<table class=\"qmlsummary\">\n" + << "<tr><td class=\"topAlign\">"; out() << "<ul>\n"; int row = 0; m = section.members.begin(); while (m != section.members.end()) { if (twoColumn && row == (int) (count + 1) / 2) - out() << "</ul></td><td valign=\"top\"><ul>\n"; + out() << "</ul></td><td class=\"topAlign\"><ul>\n"; out() << "<li><div class=\"fn\"></div>"; generateQmlItem(*m,relative,marker,true); out() << "</li>\n"; @@ -4291,7 +4288,7 @@ void HtmlGenerator::generateQmlSummary(const Section& section, } out() << "</ul>\n"; if (twoColumn) - out() << "</td></tr>\n</table></p>\n"; + out() << "</td></tr>\n</table>\n"; } } @@ -4383,7 +4380,7 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn, const Node* n = myTree->findNode(strList,Node::Fake); if (n && n->subType() == Node::QmlClass) { const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n); - out() << "<p style=\"text-align: center\">"; + out() << "<p class=\"centerAlign\">"; Text text; text << "[Inherits "; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4430,7 +4427,7 @@ void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn, { const ClassNode* cn = qcn->classNode(); if (cn && (cn->status() != Node::Internal)) { - out() << "<p style=\"text-align: center\">"; + out() << "<p class=\"centerAlign\">"; Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); @@ -4461,7 +4458,7 @@ void HtmlGenerator::generateInstantiatedBy(const ClassNode* cn, if (cn && cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) { const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake); if (n && n->subType() == Node::QmlClass) { - out() << "<p style=\"text-align: center\">"; + out() << "<p class=\"centerAlign\">"; Text text; text << "["; text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn)); diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 67a25f3..158aef3 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -2,7 +2,7 @@ HTML.stylesheets = style/style.css HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <div id=\"nav-logo\">\n" \ " <a href=\"index.html\">Home</a></div>\n" \ - " <a href=\"#\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \ + " <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \ " <div id=\"nav-topright\">\n" \ " <ul>\n" \ " <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \ @@ -16,8 +16,8 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " </div>\n" \ " <div id=\"shortCut\">\n" \ " <ul>\n" \ - " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">VERSION 4.7</a></span></li>\n" \ - " <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL QT VERSIONS" \ + " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.7</a></span></li>\n" \ + " <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL Qt VERSIONS" \ " </a></li>\n" \ " </ul>\n" \ " </div>\n" \ @@ -73,9 +73,9 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <ul>\n" \ " <li><a href=\"examples.html\">All examples</a></li>\n" \ " <li><a href=\"tutorials.html\">All tutorials</a></li>\n" \ - " <li><a href=\"#\">Qt Quick examples</a></li>\n" \ - " <li><a href=\"#\">Desktop examples</a></li>\n" \ - " <li><a href=\"#\">Device examples</a></li>\n" \ + " <li><a href=\"examples.html\">Qt Quick examples</a></li>\n" \ + " <li><a href=\"examples.html\">Desktop examples</a></li>\n" \ + " <li><a href=\"examples.html\">Device examples</a></li>\n" \ " </ul>\n" \ " </div>\n" \ " <div class=\"live\">\n" \ @@ -96,7 +96,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <li id=\"medA\" class=\"t_button active\">A</li>\n" \ " <li id=\"bigA\" class=\"t_button\">A</li>\n" \ " <li id=\"print\" class=\"t_button\"><a href=\"javascript:this.print();\">\n" \ - " <img src=\"images/sep.png\" /><img id=\"printIcon\" src=\"images/print.png\" alt=\"Print this page\" /></a></li>\n" \ + " <img src=\"images/sep.png\" alt=\"\" /><img id=\"printIcon\" src=\"images/print.png\" alt=\"Print this page\" /></a></li>\n" \ " </ul>\n" \ " </div>\n" \ " </div>\n" \ @@ -110,7 +110,6 @@ HTML.footer = " </div>\n" \ " <div class=\"ft\">\n" \ " <span></span>\n" \ " </div>\n" \ - " </div>\n" \ " <div class=\"footer\">\n" \ " <p>\n" \ " <acronym title=\"Copyright\">©</acronym> 2008-2010 Nokia Corporation and/or its\n" \ @@ -121,10 +120,10 @@ HTML.footer = " </div>\n" \ " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \ " </div>\n" \ " <div id=\"feedbackBox\">\n" \ - " <form action=\"#\">\n" \ " <div id=\"feedcloseX\">\n" \ " <a href=\"#\" onclick=\"\$(\'#feedbackBox\').hide();\$(\'#blurpage\').hide()\">X</a>\n" \ " </div>\n" \ + " <form action=\"#\">\n" \ " <textarea id=\"feedbox\" rows=\"5\" cols=\"40\">Please submit you feedback...</textarea>\n" \ " <input id=\"feedsubmit\" type=\"submit\" onclick=\"\$(\'#feedbackBox\').hide();\$(\'#blurpage\').hide()\"\n" \ " name=\"feedback\" />\n" \ @@ -132,7 +131,6 @@ HTML.footer = " </div>\n" \ " </div>\n" \ " <div id=\"blurpage\">\n" \ " </div>\n" \ - " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n" \ "<script type=\"text/javascript\">\n" \ " var _gaq = _gaq || [];\n" \ " _gaq.push([\'_setAccount\', \'UA-4457116-5\']);\n" \ |