summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-12-14 12:22:12 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-12-14 12:22:12 (GMT)
commit0fe36ac832abf8f8d438b21fce0177b65b3bbf3a (patch)
tree17e2ee8a244a3a8b5e7ebf6e5a1dd7f895d8f30f
parent53dc4de29913356e9521ac433fb13b36d2b5ab8b (diff)
downloadQt-0fe36ac832abf8f8d438b21fce0177b65b3bbf3a.zip
Qt-0fe36ac832abf8f8d438b21fce0177b65b3bbf3a.tar.gz
Qt-0fe36ac832abf8f8d438b21fce0177b65b3bbf3a.tar.bz2
qdoc: Changed index.qdoc to use new \div command
This is necessary for the Mimir project, but it is also useful for writing html output in that now you can write the index page (and other such pages) using pure qdoc commands. i.e. you don't need to use raw html for this sort of thing anymore.
-rw-r--r--doc/src/index.qdoc166
-rw-r--r--tools/qdoc3/atom.cpp3
-rw-r--r--tools/qdoc3/atom.h2
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp8
-rw-r--r--tools/qdoc3/doc.cpp23
-rw-r--r--tools/qdoc3/htmlgenerator.cpp12
-rw-r--r--tools/qdoc3/test/macros.qdocconf1
-rw-r--r--tools/qdoc3/test/qt-ditaxml.qdocconf1
8 files changed, 131 insertions, 85 deletions
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 57fc18a..aefbea1 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -29,83 +29,91 @@
\page index.html
\keyword Qt Reference Documentation
- \raw HTML
- <div class="indexbox guide" >
- <div class="heading">
- Qt Developer Guide</div>
- <div class="indexboxcont indexboxbar">
- <div class="section indexIcon"><span></span></div>
- <div class="section">
- <p>Qt is a cross-platform application and UI framework. Using Qt, you can write web-enabled applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code.</p>
- </div>
- <div class="section sectionlist">
- <ul>
- <li><a href="gettingstarted.html">Getting started</a></li>
- <li><a href="installation.html">Installation</a></li>
- <li><a href="how-to-learn-qt.html">How to learn Qt</a></li>
- <li><a href="tutorials.html">Tutorials</a></li>
- <li><a href="all-examples.html">Examples</a></li>
- <li><a href="qt4-7-intro.html">What's new in Qt 4.7</a></li>
- </ul>
- </div>
- </div>
- </div>
- <div class="indexbox api">
- <div class="heading">
- Qt API</div>
- <div class="indexboxcont indexboxbar ">
- <div class="sectionlist tricol">
- <ul>
- <li><a href="classes.html">All Classes</a></li>
- <li><a href="functions.html">All Functions</a></li>
- <li><a href="modules.html">All Modules</a></li>
- <li><a href="namespaces.html">All Namespaces</a></li>
- <li><a href="qtglobal.html">Global Declarations</a></li>
- <li><a href="licensing.html">Licenses and Credits</a></li>
- </ul>
- </div>
- <div class="sectionlist tricol">
- <ul>
- <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
- <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
- <li><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
- <li><a href="technology-apis.html">Qt and Key Technologies</a></li>
- <li><a href="best-practices.html">Best Practices Guides</a></li>
- </ul>
- </div>
- <div class="sectionlist">
- <ul>
- <li><a href="qtquick.html">Qt Quick</a></li>
- <li><a href="qdeclarativeintroduction.html">Introduction to QML</a></li>
- <li><a href="qdeclarativeelements.html">QML Elements</a></li>
- <li><a href="qdeclarativeexamples.html">QML Examples and Demos</a></li>
- </ul>
- </div>
- </div>
- </div>
- <div class="indexbox tools">
- <div class="heading">
- Qt Tools</div>
- <div class="indexboxcont">
- <div class="section indexIcon"><span></span></div>
- <div class="section">
- <p>Qt offers a selection of development tools for different tasks. Use Qt Creator for
- project and code management as well as building powerfull UIs.</p>
- </div>
- <div class="section sectionlist">
- <ul>
- <li><a href="http://doc.qt.nokia.com/qtcreator-2.0/index.html">Qt Creator</a></li>
- <li><a href="designer-manual.html">Qt Designer</a></li>
- <li><a href="linguist-manual.html">Qt Linguist</a></li>
- <li><a href="assistant-manual.html">Qt Assistant</a></li>
- <li><a href="qmake-manual.html">Qt qmake</a></li>
- <li><a href="http://doc.qt.nokia.com/qtsimulator-1.0/index.html">Qt Simulator</a></li>
- <li><a href="http://qt.nokia.com/developer/eclipse-integration">Eclipse Integration</a></li>
- <li><a href="http://qt.nokia.com/products/appdev">Add-On Products and Services</a></li>
- <li><a href="qvfb.html">Virtual Framebuffer</a></li>
- </ul>
- </div>
- </div>
- </div>
- \endraw
+ \div {indexbox guide}
+ \div {heading}
+ Qt Developer Guide
+ \enddiv
+ \div {indexboxcont indexboxbar}
+ \div {section indexIcon} \emptyspan
+ \enddiv
+ \div {section}
+ Qt is a cross-platform application and UI
+ framework. Using Qt, you can write web-enabled
+ applications once and deploy them across desktop,
+ mobile and embedded operating systems without
+ rewriting the source code.
+ \enddiv
+ \div {section sectionlist}
+ \list
+ \o \l{Getting Started Guides}{Getting started}
+ \o \l{Installation}{Installation}
+ \o \l{how-to-learn-qt.html}{How to learn Qt}
+ \o \l{tutorials.html}{Tutorials}
+ \o \l{Qt Examples}{Examples}
+ \o \l{qt4-7-intro.html}{What's new in Qt 4.7}
+ \endlist
+ \enddiv
+ \enddiv
+ \enddiv
+ \div {indexbox api}
+ \div {heading}
+ Qt API
+ \enddiv
+ \div {indexboxcont indexboxbar }
+ \div {sectionlist tricol}
+ \list
+ \o \l{All Classes}{All Classes}
+ \o \l{All Functions}{All Functions}
+ \o \l{All Modules}{All Modules}
+ \o \l{All Namespaces}{All Namespaces}
+ \o \l{Global Qt Declarations}{Global Declarations}
+ \o \l{Qt Licenses and Credits}{Licenses and Credits}
+ \endlist
+ \enddiv
+ \div {sectionlist tricol}
+ \list
+ \o \l{qt-basic-concepts.html}{Programming with Qt}
+ \o \l{qt-gui-concepts.html}{UI Design with Qt}
+ \o \l{developing-with-qt.html}{Cross-platform and Platform-specific}
+ \o \l{technology-apis.html}{Qt and Key Technologies}
+ \o \l{best-practices.html}{Best Practices Guides}
+ \endlist
+ \enddiv
+ \div {sectionlist}
+ \list
+ \o \l{qtquick.html}{Qt Quick}
+ \o \l{qdeclarativeintroduction.html}{Introduction to QML}
+ \o \l{qdeclarativeelements.html}{QML Elements}
+ \o \l{qdeclarativeexamples.html}{QML Examples and Demos}
+ \endlist
+ \enddiv
+ \enddiv
+ \enddiv
+ \div {indexbox tools}
+ \div {heading}
+ Qt Tools
+ \enddiv
+ \div {indexboxcont}
+ \div {section indexIcon} \emptyspan
+ \enddiv
+ \div {section}
+ Qt offers a selection of development tools for
+ different tasks. Use Qt Creator for project and code
+ management as well as building powerfull UIs.
+ \enddiv
+ \div {section sectionlist}
+ \list
+ \o \l{http://doc.qt.nokia.com/qtcreator-2.0/index.html}{Qt Creator}
+ \o \l{designer-manual.html}{Qt Designer}
+ \o \l{linguist-manual.html}{Qt Linguist}
+ \o \l{assistant-manual.html}{Qt Assistant}
+ \o \l{qmake-manual.html}{Qt qmake}
+ \o \l{http://doc.qt.nokia.com/qtsimulator-1.0/index.html}{Qt Simulator}
+ \o \l{http://qt.nokia.com/developer/eclipse-integration}{Eclipse Integration}
+ \o \l{http://qt.nokia.com/products/appdev}{Add-On Products and Services}
+ \o \l{qvfb.html}{Virtual Framebuffer}
+ \endlist
+ \enddiv
+ \enddiv
+ \enddiv
*/
diff --git a/tools/qdoc3/atom.cpp b/tools/qdoc3/atom.cpp
index d18c3c4..301244d 100644
--- a/tools/qdoc3/atom.cpp
+++ b/tools/qdoc3/atom.cpp
@@ -107,6 +107,7 @@ QString Atom::UPPERROMAN_ ("upperroman");
\value CodeOld
\value CodeQuoteArgument
\value CodeQuoteCommand
+ \value Div
\value EndQmlText
\value FormatElse
\value FormatEndif
@@ -179,6 +180,8 @@ static const struct {
{ "CodeOld", Atom::CodeOld },
{ "CodeQuoteArgument", Atom::CodeQuoteArgument },
{ "CodeQuoteCommand", Atom::CodeQuoteCommand },
+ { "Div", Atom::Div },
+ { "EndDiv", Atom::EndDiv },
#ifdef QDOC_QML
{ "EndQmlText", Atom::EndQmlText },
#endif
diff --git a/tools/qdoc3/atom.h b/tools/qdoc3/atom.h
index 4639711..fe85aec 100644
--- a/tools/qdoc3/atom.h
+++ b/tools/qdoc3/atom.h
@@ -72,7 +72,9 @@ class Atom
CodeOld,
CodeQuoteArgument,
CodeQuoteCommand,
+ Div,
#ifdef QDOC_QML
+ EndDiv,
EndQmlText,
#endif
FootnoteLeft,
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index 57a6e8d..7b40886 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -751,6 +751,14 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
writeCharacters(trimmedTrailing(plainCode(atom->string())));
xmlWriter().writeEndElement(); // </codeblock>
break;
+ case Atom::Div:
+ xmlWriter().writeStartElement("bodydiv");
+ if (!atom->string().isEmpty())
+ xmlWriter().writeAttribute("outputclass", atom->string());
+ break;
+ case Atom::EndDiv:
+ xmlWriter().writeEndElement(); // </bodydiv>
+ break;
case Atom::FootnoteLeft:
// ### For now
if (in_para) {
diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp
index 9a154f8..1c72f54 100644
--- a/tools/qdoc3/doc.cpp
+++ b/tools/qdoc3/doc.cpp
@@ -74,11 +74,11 @@ struct Macro
enum {
CMD_A, CMD_ABSTRACT, CMD_ANNOTATEDLIST, CMD_BADCODE,
CMD_BASENAME, CMD_BOLD, CMD_BRIEF, CMD_C, CMD_CAPTION,
- CMD_CHAPTER, CMD_CODE, CMD_CODELINE, CMD_DOTS, CMD_ELSE,
- CMD_ENDABSTRACT, CMD_ENDCHAPTER, CMD_ENDCODE,
- CMD_ENDFOOTNOTE, CMD_ENDIF, CMD_ENDLEGALESE, CMD_ENDLINK,
- CMD_ENDLIST, CMD_ENDOMIT, CMD_ENDPART, CMD_ENDQUOTATION,
- CMD_ENDRAW, CMD_ENDSECTION1, CMD_ENDSECTION2,
+ CMD_CHAPTER, CMD_CODE, CMD_CODELINE, CMD_DIV, CMD_DOTS,
+ CMD_ELSE, CMD_ENDABSTRACT, CMD_ENDCHAPTER, CMD_ENDCODE,
+ CMD_ENDDIV, CMD_ENDFOOTNOTE, CMD_ENDIF, CMD_ENDLEGALESE,
+ CMD_ENDLINK, CMD_ENDLIST, CMD_ENDOMIT, CMD_ENDPART,
+ CMD_ENDQUOTATION, CMD_ENDRAW, CMD_ENDSECTION1, CMD_ENDSECTION2,
CMD_ENDSECTION3, CMD_ENDSECTION4, CMD_ENDSIDEBAR,
CMD_ENDTABLE, CMD_EXPIRE, CMD_FOOTNOTE, CMD_GENERATELIST,
CMD_GRANULARITY, CMD_HEADER, CMD_I, CMD_IF, CMD_IMAGE,
@@ -117,11 +117,13 @@ static struct {
{ "chapter", CMD_CHAPTER, 0 },
{ "code", CMD_CODE, 0 },
{ "codeline", CMD_CODELINE, 0},
+ { "div", CMD_DIV, 0 },
{ "dots", CMD_DOTS, 0 },
{ "else", CMD_ELSE, 0 },
{ "endabstract", CMD_ENDABSTRACT, 0 },
{ "endchapter", CMD_ENDCHAPTER, 0 },
{ "endcode", CMD_ENDCODE, 0 },
+ { "enddiv", CMD_ENDDIV, 0 },
{ "endfootnote", CMD_ENDFOOTNOTE, 0 },
{ "endif", CMD_ENDIF, 0 },
{ "endlegalese", CMD_ENDLEGALESE, 0 },
@@ -555,6 +557,11 @@ void DocParser::parse(const QString& source,
append(Atom::QmlText);
break;
#endif
+ case CMD_DIV:
+ leavePara();
+ x = getArgument(true);
+ append(Atom::Div, x);
+ break;
case CMD_CODELINE:
{
if (!quoting) {
@@ -622,6 +629,10 @@ void DocParser::parse(const QString& source,
case CMD_ENDCODE:
closeCommand(cmd);
break;
+ case CMD_ENDDIV:
+ append(Atom::EndDiv);
+ closeCommand(cmd);
+ break;
#ifdef QDOC_QML
case CMD_ENDQML:
closeCommand(cmd);
@@ -2348,6 +2359,8 @@ int DocParser::endCmdFor(int cmd)
return CMD_ENDCHAPTER;
case CMD_CODE:
return CMD_ENDCODE;
+ case CMD_DIV:
+ return CMD_ENDDIV;
#ifdef QDOC_QML
case CMD_QML:
return CMD_ENDQML;
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index b5295c8..40cfba3 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -211,13 +211,13 @@ static void addLink(const QString &linkTarget,
HtmlGenerator::HtmlGenerator()
: helpProjectWriter(0),
inLink(false),
+ inObsoleteLink(false),
inContents(false),
inSectionHeading(false),
inTableHeader(false),
numTableRows(0),
threeColumnEnumValueTable(true),
funcLeftParen("\\S(\\()"),
- inObsoleteLink(false),
myTree(0),
slow(false),
obsoleteLinks(false)
@@ -511,6 +511,13 @@ int HtmlGenerator::generateAtom(const Atom *atom,
<< trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string()))))
<< "</pre>\n";
break;
+ case Atom::Div:
+ out() << "<div";
+ if (!atom->string().isEmpty())
+ out() << " class=\"" << atom->string() << "\">";
+ else
+ out() << ">";
+ break;
case Atom::FootnoteLeft:
// ### For now
if (in_para) {
@@ -1129,6 +1136,9 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << "<b class=\"redFont\"><code>\\" << protectEnc(atom->string())
<< "</code></b>";
break;
+ case Atom::EndDiv:
+ out() << "</div>";
+ break;
#ifdef QDOC_QML
case Atom::QmlText:
case Atom::EndQmlText:
diff --git a/tools/qdoc3/test/macros.qdocconf b/tools/qdoc3/test/macros.qdocconf
index 510a8b3..2262daa 100644
--- a/tools/qdoc3/test/macros.qdocconf
+++ b/tools/qdoc3/test/macros.qdocconf
@@ -34,3 +34,4 @@ macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
macro.endfloat.HTML = "</div>"
macro.clearfloat.HTML = "<br style=\"clear: both\" />"
+macro.emptyspan.HTML = "<span></span>"
diff --git a/tools/qdoc3/test/qt-ditaxml.qdocconf b/tools/qdoc3/test/qt-ditaxml.qdocconf
index bc32149..211bdb2 100644
--- a/tools/qdoc3/test/qt-ditaxml.qdocconf
+++ b/tools/qdoc3/test/qt-ditaxml.qdocconf
@@ -46,3 +46,4 @@ macro.beginfloatleft.HTML = " "
macro.beginfloatright.HTML = " "
macro.endfloat.HTML = " "
macro.clearfloat.HTML = " "
+macro.emptyspan.DITAXML = " "