From 0fe36ac832abf8f8d438b21fce0177b65b3bbf3a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 14 Dec 2010 13:22:12 +0100 Subject: 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. --- doc/src/index.qdoc | 166 ++++++++++++++++++----------------- tools/qdoc3/atom.cpp | 3 + tools/qdoc3/atom.h | 2 + tools/qdoc3/ditaxmlgenerator.cpp | 8 ++ tools/qdoc3/doc.cpp | 23 +++-- tools/qdoc3/htmlgenerator.cpp | 12 ++- tools/qdoc3/test/macros.qdocconf | 1 + tools/qdoc3/test/qt-ditaxml.qdocconf | 1 + 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 -
-
- Qt Developer Guide
-
-
-
-

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.

-
- -
-
-
-
- Qt API
- -
-
-
- Qt Tools
-
-
-
-

Qt offers a selection of development tools for different tasks. Use Qt Creator for - project and code management as well as building powerfull UIs.

-
- -
-
- \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(); // break; + case Atom::Div: + xmlWriter().writeStartElement("bodydiv"); + if (!atom->string().isEmpty()) + xmlWriter().writeAttribute("outputclass", atom->string()); + break; + case Atom::EndDiv: + xmlWriter().writeEndElement(); // + 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())))) << "\n"; break; + case Atom::Div: + out() << "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() << "\\" << protectEnc(atom->string()) << ""; break; + case Atom::EndDiv: + out() << ""; + 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 = "
" macro.beginfloatright.HTML = "
" macro.endfloat.HTML = "
" macro.clearfloat.HTML = "
" +macro.emptyspan.HTML = "" 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 = " " -- cgit v0.12