diff options
Diffstat (limited to 'tools/qdoc3')
-rw-r--r-- | tools/qdoc3/config.h | 1 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 203 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 5 | ||||
-rw-r--r-- | tools/qdoc3/test/assistant.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/designer.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/linguist.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/qdeclarative.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/qmake.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-api-only.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-build-docs.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-html-templates.qdocconf | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/qt.qdocconf | 4 |
12 files changed, 159 insertions, 78 deletions
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() << "<div class=\"descr\">\n"; // QTBUG-9504 + out() << "<div class=\"descr\"> <a name=\"" << registerRef("details") << "\"></a>\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() << " <title>" << shortVersion << protectEnc(title) << "</title>\n"; - // Adding style sheet - out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; - // Adding jquery and functions - providing online tools and search features - out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n"; - out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; - // Adding style and js for small windows - out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n"; - out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />"; - out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n"; - out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />"; + // Adding style sheet + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n"; + // Adding jquery and functions - providing online tools and search features + out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n"; + out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; + // Adding style and js for small windows + out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />"; + out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />\n"; - // Adding syntax highlighter // future release + // Adding syntax highlighter // future release - // Setting assistant configuration - if (offlineDocs) - { - out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Only for Qt Creator - out() << "</head>\n"; - out() << "<body class=\"offline \">\n"; // offline for Assistant - } - if (creatorDocs) - { - out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Only for Qt Creator - out() << "</head>\n"; - out() << "<body class=\"offline narrow creator\">\n"; // offline for Creator - } - // Setting online doc configuration - else - { - // Browser spec styles - 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"; + // 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() << " <!--[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"; - out() << "</head>\n"; - // CheckEmptyAndLoadList activating search - out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; - } + out() << "</head>\n"; + // CheckEmptyAndLoadList activating search + out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; + } + else if (offlineDocs == true) // offlineDocs is for ??? + { + out() << "</head>\n"; + out() << "<body class=\"offline \">\n"; // offline + } + else if (creatorDocs == true) // creatorDocs is for Assistant/Creator + { + out() << "</head>\n"; + out() << "<body class=\"offline narrow creator\">\n"; // offline narrow + } + // default -- not used except if one forgets to set any of the above settings to true + else + { + out() << "</head>\n"; + out() << "<body>\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() << "</body>\n"; - } - if (creatorDocs) - { - out() << "</body>\n"; - } - else - { - out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; - out() << " <!-- <script type=\"text/javascript\">\n"; - out() << " var _gaq = _gaq || [];\n"; - out() << " _gaq.push(['_setAccount', 'UA-4457116-5']);\n"; - out() << " _gaq.push(['_trackPageview']);\n"; - out() << " (function() {\n"; - out() << " var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n"; - out() << " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n"; - out() << " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n"; - out() << " })();\n"; - out() << " </script> -->\n"; - out() << "</body>\n"; - } + if (onlineDocs == true) + { + out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; + out() << " <!-- <script type=\"text/javascript\">\n"; + out() << " var _gaq = _gaq || [];\n"; + out() << " _gaq.push(['_setAccount', 'UA-4457116-5']);\n"; + out() << " _gaq.push(['_trackPageview']);\n"; + out() << " (function() {\n"; + out() << " var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n"; + out() << " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n"; + out() << " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n"; + out() << " })();\n"; + out() << " </script> -->\n"; + out() << "</body>\n"; + } + else if (offlineDocs == true) + { + out() << "</body>\n"; + } + else if (creatorDocs == true) + { + out() << "</body>\n"; + } + else + { + out() << "</body>\n"; + } out() << "</html>\n"; } @@ -1907,11 +1953,14 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, generateExtractionMark(node, BriefMark); out() << "<p>"; generateText(brief, node, marker); + if (!relative || node == relative) out() << " <a href=\"#"; else out() << " <a href=\"" << linkForNode(node, relative) << "#"; out() << registerRef("details") << "\">More...</a></p>\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 = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <div class=\"content\"> \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 |