summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/htmlgenerator.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-03 08:38:32 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-03 08:38:32 (GMT)
commita8829a52d65a9759d5dffe98fb07b384c54db1c8 (patch)
tree59559409ffaa4f204685bdf1ab7e0721d79203b1 /tools/qdoc3/htmlgenerator.cpp
parenta7189fb75a168f89db07d07eeb4f7fcd35d69942 (diff)
parentab9cb342554e89e0ff51afe3e8063d2719af16b1 (diff)
downloadQt-a8829a52d65a9759d5dffe98fb07b384c54db1c8.zip
Qt-a8829a52d65a9759d5dffe98fb07b384c54db1c8.tar.gz
Qt-a8829a52d65a9759d5dffe98fb07b384c54db1c8.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (30 commits) Revert "Split Symbian bearer plugin into three platform specfic plugins" Don't poll non-polling engines when configurations are in use. Doc: updating images Fix a corner case where a gesture sometimes doesn't start. write PO files without duplicated message ids my changes Fix failing bypassShaping autotest on the Mac OS X More Pixmap cache key optimizations QNAM: Improve child deletion order QSslCertificate: support large serial numbers Split Symbian bearer plugin into three platform specfic plugins Doc: adding offline docs to assistant and Qt Creator. Improving small docs and adding highlighting Some optimizations for QImage::load() fix setRawData() Fix QML crashes on the N900 doc: Added DITA XML generator Fix build failure on Symbian 3.1. Add the Qt::TextBypassShaping flag. QTextEngine: skip an unnecessary call to GetDeviceCaps on Windows. Add my 4.7.0 changes ...
Diffstat (limited to 'tools/qdoc3/htmlgenerator.cpp')
-rw-r--r--tools/qdoc3/htmlgenerator.cpp134
1 files changed, 74 insertions, 60 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index b103981..f6b8c06 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -519,14 +519,14 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE];
break;
case Atom::Code:
- out() << "<pre class=\"highlightedCode\">"
+ out() << "<pre class=\"highlightedCode brush: cpp\">"
<< trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
marker,relative))
<< "</pre>\n";
break;
#ifdef QDOC_QML
case Atom::Qml:
- out() << "<pre class=\"highlightedCode\">"
+ out() << "<pre class=\"highlightedCode brush: cpp\">"
<< trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
marker,relative))
<< "</pre>\n";
@@ -534,7 +534,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
#endif
case Atom::CodeNew:
out() << "<p>you can rewrite it as</p>\n"
- << "<pre class=\"highlightedCode\">"
+ << "<pre class=\"highlightedCode brush: cpp\">"
<< trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
marker,relative))
<< "</pre>\n";
@@ -543,7 +543,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << "<p>For example, if you have code like</p>\n";
// fallthrough
case Atom::CodeBad:
- out() << "<pre class=\"highlightedCode\">"
+ out() << "<pre class=\"highlightedCode brush: cpp\">"
<< trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string()))))
<< "</pre>\n";
break;
@@ -1711,62 +1711,49 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title,
if (node->type() == Node::Class) {
const ClassNode* cn = static_cast<const ClassNode*>(node);
QString name = node->moduleName();
- out() << " <li><a href=\"modules.html\">All Modules</a></li>";
+ out() << " <li><a href=\"modules.html\">Modules</a></li>";
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";
- }
+ if (!cn->name().isEmpty())
+ out() << " <li>" << cn->name() << "</li>\n";
}
else if (node->type() == Node::Fake) {
const FakeNode* fn = static_cast<const FakeNode*>(node);
if (node->subType() == Node::Module) {
- out() << " <li><a href=\"modules.html\">All Modules</a></li>";
+ out() << " <li><a href=\"modules.html\">Modules</a></li>";
QString name = node->name();
- if (!name.isEmpty()) {
- out() << " <li>";
- breadcrumb << Atom(Atom::AutoLink,name);
- generateText(breadcrumb, 0, marker);
- out() << "</li>\n";
- }
+ if (!name.isEmpty())
+ out() << " <li>" << name << "</li>\n";
}
else if (node->subType() == Node::Group) {
if (fn->name() == QString("modules"))
- out() << " <li><a href=\"modules.html\">All Modules</a></li>";
+ out() << " <li>Modules</li>";
else {
- out() << " <li><a href=\"" << fn->name() << "\">" << title
- << "</a></li>";
+ out() << " <li>" << title << "</li>";
}
}
else if (node->subType() == Node::Page) {
if (fn->name() == QString("examples.html")) {
- out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
+ out() << " <li>Examples</li>";
}
else if (fn->name().startsWith("examples-")) {
out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
- out() << " <li><a href=\"" << fn->name() << "\">" << title
- << "</a></li>";
+ out() << " <li>" << title << "</li>";
}
else if (fn->name() == QString("namespaces.html")) {
- out() << " <li><a href=\"namespaces.html\">All Namespaces</a></li>";
+ out() << " <li>Namespaces</li>";
}
else {
- out() << " <li><a href=\"" << fn->name() << "\">" << title
- << "</a></li>";
+ out() << " <li>" << title << "</li>";
}
}
else if (node->subType() == Node::QmlClass) {
out() << " <li><a href=\"qdeclarativeelements.html\">QML Elements</a></li>";
- out() << " <li><a href=\"" << fn->name() << "\">" << title
- << "</a></li>";
+ out() << " <li>" << title << "</li>";
}
else if (node->subType() == Node::Example) {
out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
@@ -1775,16 +1762,12 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title,
QString t = CodeParser::titleFromName(name);
out() << " <li><a href=\"" << name << "\">"
<< t << "</a></li>";
- out() << " <li><a href=\"" << sl.at(0)
- << "-" << sl.at(sl.size()-1) << ".html\">"
- << title << "</a></li>";
+ out() << " <li>" << title << "</li>";
}
}
else if (node->type() == Node::Namespace) {
- const NamespaceNode* nsn = static_cast<const NamespaceNode*>(node);
- out() << " <li><a href=\"namespaces.html\">All Namespaces</a></li>";
- out() << " <li><a href=\"" << fileName(nsn) << "\">" << title
- << "</a></li>";
+ out() << " <li><a href=\"namespaces.html\">Namespaces</a></li>";
+ out() << " <li>" << title << "</li>";
}
}
@@ -1814,31 +1797,51 @@ void HtmlGenerator::generateHeader(const QString& title,
out() << " <title>" << shortVersion << protectEnc(title) << "</title>\n";
- out() << " <!--[if IE]>";
- out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">";
- out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">";
- out() << "<![endif]-->";
- out() << "<!--[if lt IE 7]>";
- out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">";
- out() << "<![endif]-->";
- out() << "<!--[if IE 7]>";
- out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">";
- out() << "<![endif]-->";
- out() << "<!--[if IE 8]>";
- out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">";
- out() << "<![endif]-->";
-
-
//out() << " <title>Qt Reference Documentation</title>";
- out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n";
- out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
- out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
- out() << "</head>\n";
if (offlineDocs)
- out() << "<body class=\"offline\" onload=\"CheckEmptyAndLoadList();\">\n";
+ {
+ out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/OfflineStyle.css\" />";
+ out() << "</head>\n";
+ out() << "<body class=\"offline narrow\" >\n"; // narrow mainly for Creator
+ }
else
- out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
+ {
+ out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\"\n />";
+ out() << " <!--[if IE]>\n";
+ out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
+ out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
+ out() << "<![endif]-->\n";
+ out() << "<!--[if lt IE 7]>\n";
+ out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n";
+ out() << "<![endif]-->\n";
+ out() << "<!--[if IE 7]>\n";
+ out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n";
+ out() << "<![endif]-->\n";
+ out() << "<!--[if IE 8]>\n";
+ out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
+ out() << "<![endif]-->\n";
+ // jquery functions
+ out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
+ out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+ // menus and small docs js and css
+ out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
+ out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
+ out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
+ out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />";
+
+ // syntax highlighter js and css
+ // out() << " <link type=\"text/css\" rel=\"stylesheet\" href=\"style/shCore.css\"/>\n";
+ // out() << " <link type=\"text/css\" rel=\"stylesheet\" href=\"style/shThemeDefault.css\"/>\n";
+ // out() << " <script type=\"text/javascript\" src=\"scripts/shCore.js\"></script>\n";
+ // out() << " <script type=\"text/javascript\" src=\"scripts/shBrushCpp.js\"></script>\n";
+ // out() << " <script type=\"text/javascript\">\n";
+ // out() << " SyntaxHighlighter.all();\n";
+ // out() << " </script>\n";
+
+ out() << "</head>\n";
+ out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
+ }
#ifdef GENERATE_MAC_REFS
if (mainPage)
@@ -1880,8 +1883,16 @@ void HtmlGenerator::generateFooter(const Node *node)
out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version())
<< QString(address).replace("\\" + COMMAND_VERSION, myTree->version());
- out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+
+ if (offlineDocs)
+ {
out() << "</body>\n";
+ }
+ else
+ {
+ out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+ out() << "</body>\n";
+ }
out() << "</html>\n";
}
@@ -1903,7 +1914,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker)
{
if (!inner->includes().isEmpty()) {
- out() << "<pre class=\"highlightedCode\">"
+ out() << "<pre class=\"highlightedCode brush: cpp\">"
<< trimmedTrailing(highlightedCode(indent(codeIndent,
marker->markedUpIncludes(inner->includes())),
marker,inner))
@@ -2127,6 +2138,8 @@ void HtmlGenerator::generateNavigationBar(const NavigationBar& bar,
out() << "</a>]\n";
#endif
}
+ if (fake->name() != QString("index.html"))
+ {
if (bar.current.begin() != 0) {
out() << "[<a href=\"" << "home"
<< ".html\">Home</a>]\n";
@@ -2138,6 +2151,7 @@ void HtmlGenerator::generateNavigationBar(const NavigationBar& bar,
out() << "</a>]\n";
}
out() << "</p>\n";
+ }
}
}
#endif