From 64087b078f3767a2190f2b4a0d4aca2a6165ebda Mon Sep 17 00:00:00 2001 From: Kevin Wright Date: Mon, 26 Jul 2010 18:44:10 +0200 Subject: Fixed the following sub-tasks for QTBUG-12192 * Qt Simulator link missing * Integration and add-ins (on the front page, link leads to an alternative start page) * Qt Creator (on the front page link leads to Manual version 1.3) * Getting Started (on the front page) link broken * More... (in Global Declarations) link broken Additionally: There was an issue with the documentation used within Assistant/Creator that appears to have no bug report filed. An alternate "offline" form of the documentation (inspired by the newly redesigned online version) was being installed, but had significant issues within Assistant and Creator. It appears that within qdoc3 some changes had been made towards using this newer documentation format, but those changes were not working properly. I fixed qdoc3 so that the original offline documentation design is the default, but there is room to use the configuration files to call the any of the three documentation designs (new online, new offline, and old offline). --- doc/src/index.qdoc | 5 +- tools/qdoc3/config.h | 1 + tools/qdoc3/htmlgenerator.cpp | 203 +++++++++++++++++----------- tools/qdoc3/htmlgenerator.h | 5 + tools/qdoc3/test/assistant.qdocconf | 3 + tools/qdoc3/test/designer.qdocconf | 3 + tools/qdoc3/test/linguist.qdocconf | 3 + tools/qdoc3/test/qdeclarative.qdocconf | 3 + tools/qdoc3/test/qmake.qdocconf | 3 + tools/qdoc3/test/qt-api-only.qdocconf | 3 + tools/qdoc3/test/qt-build-docs.qdocconf | 3 + tools/qdoc3/test/qt-html-templates.qdocconf | 3 + tools/qdoc3/test/qt.qdocconf | 4 +- 13 files changed, 162 insertions(+), 80 deletions(-) diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 0ecae59..bd3ac05 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -94,11 +94,12 @@
diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h index af58a3f..b087b1c 100644 --- a/tools/qdoc3/config.h +++ b/tools/qdoc3/config.h @@ -143,6 +143,7 @@ class Config #define CONFIG_NATURALLANGUAGE "naturallanguage" #define CONFIG_OBSOLETELINKS "obsoletelinks" #define CONFIG_ONLINE "online" +#define CONFIG_OFFLINE "offline" #define CONFIG_CREATOR "creator" #define CONFIG_OUTPUTDIR "outputdir" #define CONFIG_OUTPUTENCODING "outputencoding" diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 416d44a..76d8c0d 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -219,7 +219,8 @@ HtmlGenerator::HtmlGenerator() inTableHeader(false), numTableRows(0), threeColumnEnumValueTable(true), - offlineDocs(true), + offlineDocs(false), + onlineDocs(false), creatorDocs(true), funcLeftParen("\\S(\\()"), myTree(0), @@ -271,6 +272,12 @@ void HtmlGenerator::initializeGenerator(const Config &config) postPostHeader = config.getString(HtmlGenerator::format() + Config::dot + HTMLGENERATOR_POSTPOSTHEADER); + creatorPostHeader = config.getString(HtmlGenerator::format() + + Config::dot + + HTMLGENERATOR_CREATORPOSTHEADER); + creatorPostPostHeader = config.getString(HtmlGenerator::format() + + Config::dot + + HTMLGENERATOR_CREATORPOSTPOSTHEADER); footer = config.getString(HtmlGenerator::format() + Config::dot + HTMLGENERATOR_FOOTER); @@ -282,8 +289,13 @@ void HtmlGenerator::initializeGenerator(const Config &config) HTMLGENERATOR_GENERATEMACREFS); project = config.getString(CONFIG_PROJECT); - offlineDocs = !config.getBool(CONFIG_ONLINE); - creatorDocs = false; //!config.getBool(CONFIG_CREATOR); + + onlineDocs = config.getBool(CONFIG_ONLINE); + + offlineDocs = config.getBool(CONFIG_OFFLINE); + + creatorDocs = config.getBool(CONFIG_CREATOR); + projectDescription = config.getString(CONFIG_DESCRIPTION); if (projectDescription.isEmpty() && !project.isEmpty()) projectDescription = project + " Reference Documentation"; @@ -1615,7 +1627,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) } else { generateExtractionMark(fake, DetailedDescriptionMark); - out() << "
\n"; // QTBUG-9504 + out() << "
\n"; // QTBUG-9504 } generateBody(fake, marker); @@ -1781,64 +1793,94 @@ void HtmlGenerator::generateHeader(const QString& title, else shortVersion = "Qt " + shortVersion + ": "; } - // Generating page title + + // Generating page title out() << " " << shortVersion << protectEnc(title) << "\n"; - // Adding style sheet - out() << " "; - // Adding jquery and functions - providing online tools and search features - out() << " \n"; - out() << " \n"; - // Adding style and js for small windows - out() << " \n"; - out() << " "; - out() << " \n"; - out() << " "; + // Adding style sheet + out() << " \n"; + // Adding jquery and functions - providing online tools and search features + out() << " \n"; + out() << " \n"; + // Adding style and js for small windows + out() << " \n"; + out() << " "; + out() << " \n"; + out() << " \n"; - // Adding syntax highlighter // future release + // Adding syntax highlighter // future release - // Setting assistant configuration - if (offlineDocs) - { - out() << " "; // Only for Qt Creator - out() << "\n"; - out() << "\n"; // offline for Assistant - } - if (creatorDocs) - { - out() << " "; // Only for Qt Creator - out() << "\n"; - out() << "\n"; // offline for Creator - } - // Setting online doc configuration - else - { - // Browser spec styles - out() << " \n"; - out() << "\n"; - out() << "\n"; - out() << "\n"; + // Setting some additional style sheet related details depending on configuration (e.g. online/offline) + + + if(onlineDocs==true) // onlineDocs is for the web + { + // Browser spec styles + out() << " \n"; + out() << "\n"; + out() << "\n"; + out() << "\n"; - out() << "\n"; - // CheckEmptyAndLoadList activating search - out() << "\n"; - } + out() << "\n"; + // CheckEmptyAndLoadList activating search + out() << "\n"; + } + else if (offlineDocs == true) // offlineDocs is for ??? + { + out() << "\n"; + out() << "\n"; // offline + } + else if (creatorDocs == true) // creatorDocs is for Assistant/Creator + { + out() << "\n"; + out() << "\n"; // offline narrow + } + // default -- not used except if one forgets to set any of the above settings to true + else + { + out() << "\n"; + out() << "\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()); +#endif + + + if(onlineDocs==true) // onlineDocs is for the web + { + out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + generateBreadCrumbs(title,node,marker); + out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + } + else if (offlineDocs == true) // offlineDocs is for ??? + { + out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + generateBreadCrumbs(title,node,marker); + out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + } + else if (creatorDocs == true) // creatorDocs is for Assistant/Creator + { + out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + generateBreadCrumbs(title,node,marker); + out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + } + // default -- not used except if one forgets to set any of the above settings to true + else + { + out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + generateBreadCrumbs(title,node,marker); + out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + } #if 0 // Removed for new doc format. MWS if (node && !node->links().empty()) @@ -1873,29 +1915,33 @@ void HtmlGenerator::generateFooter(const Node *node) out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version()) << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()); - if (offlineDocs) - { - out() << "\n"; - } - if (creatorDocs) - { - out() << "\n"; - } - else - { - out() << " \n"; - out() << " \n"; - out() << "\n"; - } + if (onlineDocs == true) + { + out() << " \n"; + out() << " \n"; + out() << "\n"; + } + else if (offlineDocs == true) + { + out() << "\n"; + } + else if (creatorDocs == true) + { + out() << "\n"; + } + else + { + out() << "\n"; + } out() << "\n"; } @@ -1907,11 +1953,14 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, generateExtractionMark(node, BriefMark); out() << "

"; generateText(brief, node, marker); + if (!relative || node == relative) out() << " More...

\n"; + + generateExtractionMark(node, EndMark); } } diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index aaf2318..d92c349 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -294,6 +294,7 @@ class HtmlGenerator : public PageGenerator bool inTableHeader; int numTableRows; bool threeColumnEnumValueTable; + bool onlineDocs; bool offlineDocs; bool creatorDocs; QString link; @@ -302,6 +303,8 @@ class HtmlGenerator : public PageGenerator QString style; QString postHeader; QString postPostHeader; + QString creatorPostHeader; + QString creatorPostPostHeader; QString footer; QString address; bool pleaseGenerateMacRef; @@ -339,6 +342,8 @@ class HtmlGenerator : public PageGenerator #define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me #define HTMLGENERATOR_POSTHEADER "postheader" #define HTMLGENERATOR_POSTPOSTHEADER "postpostheader" +#define HTMLGENERATOR_CREATORPOSTHEADER "postheader" +#define HTMLGENERATOR_CREATORPOSTPOSTHEADER "postpostheader" #define HTMLGENERATOR_STYLE "style" #define HTMLGENERATOR_STYLESHEETS "stylesheets" #define HTMLGENERATOR_CUSTOMHEADELEMENTS "customheadelements" diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 8d5fa89..efe3b3b 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -7,6 +7,9 @@ include(qt-defines.qdocconf) project = Qt Assistant description = Qt Assistant Manual url = http://qt.nokia.com/doc/4.7 +online = false +offline = false +creator = true indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index b1f37dc..0595417 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -7,6 +7,9 @@ include(qt-defines.qdocconf) project = Qt Designer description = Qt Designer Manual url = http://qt.nokia.com/doc/4.7 +online = false +offline = false +creator = true indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index 26fb55c..7dd57fb 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -7,6 +7,9 @@ include(qt-defines.qdocconf) project = Qt Linguist description = Qt Linguist Manual url = http://qt.nokia.com/doc/4.7 +online = false +offline = false +creator = true indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index facec5c..0cff98e 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -8,6 +8,9 @@ project = Qml description = Qml Reference Documentation url = http://qt.nokia.com/doc/4.7/ qmlonly = true +online = false +offline = false +creator = true edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \ QtXmlPatterns QtTest diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index f069129..c666288 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -7,6 +7,9 @@ include(qt-defines.qdocconf) project = QMake description = QMake Manual url = http://qt.nokia.com/doc/4.7 +online = false +offline = false +creator = true indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf index bf6c0dc..1ec0c6b 100644 --- a/tools/qdoc3/test/qt-api-only.qdocconf +++ b/tools/qdoc3/test/qt-api-only.qdocconf @@ -5,6 +5,9 @@ include(qt-build-docs.qdocconf) # qmake.qdocconf). url = ./ +online = false +offline = false +creator = true # Ensures that the documentation for the tools is not included in the generated # .qhp file. diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 4ac4f47..f663016 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -7,6 +7,9 @@ include(qt-defines.qdocconf) project = Qt description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.7 +online = false +offline = false +creator = true sourceencoding = UTF-8 outputencoding = UTF-8 diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index b428a90..e439708 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -3,6 +3,9 @@ HTML.stylesheets = style/style.css \ style/style_ie7.css \ style/style_ie8.css \ style/style_ie6.css + +HTML.creatorpostheader = "**\n" +HTML.creatorpostpostheader = "***\n" HTML.postheader = "
\n" \ "
\n" \ diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index e4ed1bc..08492e3 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -9,7 +9,9 @@ versionsym = version = %VERSION% description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.7 -online = true +online = false +offline = false +creator = true sourceencoding = UTF-8 outputencoding = UTF-8 -- cgit v0.12