diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-08-06 12:30:42 (GMT) |
---|---|---|
committer | Jesper Thomschutz <jesper.thomschutz@nokia.com> | 2010-08-09 12:36:30 (GMT) |
commit | 5ef8bec14447789deb90c87b3d7e745b4613986f (patch) | |
tree | 5526404e6a3a14bbf0042d6d2683c56c35b7e321 | |
parent | 3ebf35e60abe181ad3a5a3b99ea82708b3ed0114 (diff) | |
download | Qt-5ef8bec14447789deb90c87b3d7e745b4613986f.zip Qt-5ef8bec14447789deb90c87b3d7e745b4613986f.tar.gz Qt-5ef8bec14447789deb90c87b3d7e745b4613986f.tar.bz2 |
doc: Re-introduced next/previous page links in the footer.
Task-Nr: QTBUG-12278
(cherry picked from commit 2118f407b02654e9e3c6706647e8b9b711e8982b)
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index e6396fe..34c2565 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1937,6 +1937,61 @@ void HtmlGenerator::generateHeader(const QString& title, } } + navigationLinks.clear(); + + if (node && !node->links().empty()) { + QPair<QString,QString> linkPair; + QPair<QString,QString> anchorPair; + const Node *linkNode; + + if (node->links().contains(Node::PreviousLink)) { + linkPair = node->links()[Node::PreviousLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " <link rel=\"prev\" href=\"" + << anchorPair.first << "\" />\n"; + + navigationLinks += "[Previous: <a href=\"" + anchorPair.first + "\">"; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protect(anchorPair.second); + else + navigationLinks += protect(linkPair.second); + navigationLinks += "</a>]\n"; + } + if (node->links().contains(Node::NextLink)) { + linkPair = node->links()[Node::NextLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + + out() << " <link rel=\"next\" href=\"" + << anchorPair.first << "\" />\n"; + + navigationLinks += "[Next: <a href=\"" + anchorPair.first + "\">"; + if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) + navigationLinks += protect(anchorPair.second); + else + navigationLinks += protect(linkPair.second); + navigationLinks += "</a>]\n"; + } + if (node->links().contains(Node::StartLink)) { + linkPair = node->links()[Node::StartLink]; + linkNode = findNodeForTarget(linkPair.first, node, marker); + if (!linkNode || linkNode == node) + anchorPair = linkPair; + else + anchorPair = anchorForNode(linkNode); + out() << " <link rel=\"start\" href=\"" + << anchorPair.first << "\" />\n"; + } + } + #if 0 // Removed for new doc format. MWS if (node && !node->links().empty()) out() << "<p>\n" << navigationLinks << "</p>\n"; |